Single page navigation with flutter web


you can keep all widgets on one page package by creating a switch statement in your build page. switch between different widget when rendering the scaffolding.

Alejandro Aviña
Author by

Alejandro Aviña

Updated on January 04, 2023


  • Alejandro Aviña
    Alejandro Aviña over 1 year

    I'm trying to create a web app that only renders one page, and the other pages (or views) are rendered when you press a button related to that specific view. Like the Flutter Gallery website, when you click on a widget info in the "Categories" section

    Is there any workaround for this or do I have to create my own router?

  • Alejandro Aviña
    Alejandro Aviña almost 2 years
    Pretty much like an IndexedStack I guess, I'll give it a try
  • Golden Lion
    Golden Lion almost 2 years
    Yes. Most flutter controls use a model for controlling which widget to render. In the case of bottomnavigationbutton an index is used to determine with widget to render in a switch statement