[Flutter]Define a Global BuildContext & Its Usage
[Flutter]Define a Global BuildContext & Its Usage
*This post is more like a note to myself. It’s simple, just add static keyword when defining a BuildContext. It’s useful when you want to display a Toast or SnackBar in global context, or update an UI, the data will update, not only within one context (context of current page or exited or popped page and so on) but also in other contexts. For example: //To define global context class…
View On WordPress











