Ad

Add Different Routes/screens To Flutter App

- 1 answer

I'm trying to add multiple screens to my flutter app but can't get it to work. And there are no tutorials/ guides to do this.

Does anyone have an example on how to accomplish this.

Thanks in advance.

Ad

Answer

You can use the Navigator

It's use is demonstrated in the Stocks example in https://github.com/flutter/flutter/blob/c8447c91a93cdee28eddb01ee3ace27b9362220f/packages/flutter/test/widgets/navigator_test.dart

Navigator.pushNamed(context, '/second');
...
onTap: () => Navigator.pop(context),

Navigator can also be used without Scaffold.

I run into an exception when I tried which I haven't yet found out how to fix. I plan to prepare a reproduction and file a bug report.

Ad
source: stackoverflow.com
Ad