Present modally in Flutter?

Go to Section B(push) animation can be achieved by following:

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

Go to Section C(present modally) animation can be achieved by following:

Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => SectionCRoute(), fullscreenDialog: true),
              );

You can push like this:

Navigator.of(context).push(
        CupertinoPageRoute(
                fullscreenDialog: true,
                builder: (context) => SomePage(),
        ),
);

Hope this helps.

Tags:

Flutter