Flutter - Display the SnackBar using the GlobalKey
ฝัง
- เผยแพร่เมื่อ 29 มี.ค. 2018
- In this video I cover displaying the snack bar using the global key.
In this episode I cover:
- Create an app with two tabs
- Construct a GlobalKey for the Page Scaffold
- Pass the GlobalKey to the tabs widgets
- On change in tab will show the Snackbar
Source code used in this episode:
gist.github.com/branflake2267... - แนวปฏิบัติและการใช้ชีวิต
incredible video, not even in the documentation is so clear. Thank you. Hi here from Brazil.
Searched everywhere but the answer is here. Great explanation on global keys.
great pace
Great video, I from Brazil, how can i put validator in the fields implying that I move to the next screen?
Please post a video how to efficiently use global keys
Great tutorial.
Thanks Brandon
Brandon, thanks for the video. I'm just starting with flutter and wondering why we couldn't just use `Scaffold.of(context).showSnackBar()` here ? Best
You can, however, you will need to use a Builder to wrap around the Scaffold and use the context given by the Builder => build: (context) to display the snackBar.
stackoverflow.com/questions/51304568/scaffold-of-called-with-a-context-that-does-not-contain-a-scaffold