Skip to content

Show InfoBar without BuildContext #989

Answered by bdlukaa
Nilsuuus asked this question in Q&A
Discussion options

You must be logged in to vote

¹ You not having access to a build context is probably a design fault in your app.
² Yes, it is totally possible! You can use a navigatorKey to access the navigator context:

final navigatorKey = GlobalKey<NavigatorState>();

FluentApp(
  navigatorKey: navigatorKey,
),

final context = navigatorKey.currentContext;
if (context != null) {
  ...
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bdlukaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants