Search code snippets, questions, articles...

Navigate to a page in Flutter

Navigator.push(
    context,
    MaterialPageRoute(
        builder: (context) => PageName(
          data: data,
        ),
    ),
);

Navigator.push can be used to open a page in Flutter. You need to pass context and MaterialPageRoute which has a builder function where you can pass page name and its data if required.

Search Index Data (The code snippet can also be found with below search text)

Open page in Flutter
Was this helpful?
0 Comments
Programming Feeds
Learn something new everyday on Devsheet