Flutter - Display the SnackBar using the GlobalKey

Поделиться
HTML-код
  • Опубликовано: 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...
  • ХоббиХобби

Комментарии • 8

  • @cristianperesdelima7402
    @cristianperesdelima7402 5 лет назад +2

    incredible video, not even in the documentation is so clear. Thank you. Hi here from Brazil.

  • @thepiratescookbook4017
    @thepiratescookbook4017 3 года назад

    great pace

  • @kishanv9879
    @kishanv9879 6 лет назад +1

    Searched everywhere but the answer is here. Great explanation on global keys.

  • @Cajaba100
    @Cajaba100 3 года назад

    Great video, I from Brazil, how can i put validator in the fields implying that I move to the next screen?

  • @kishanv9879
    @kishanv9879 6 лет назад +1

    Please post a video how to efficiently use global keys

  • @kennethn.9960
    @kennethn.9960 4 года назад

    Great tutorial.
    Thanks Brandon

  • @tomaszkuklis4357
    @tomaszkuklis4357 5 лет назад +6

    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

    • @laujimmy8635
      @laujimmy8635 4 года назад

      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