Imperative routing with Navigator 1.0
Now that we have familiarized ourselves with how to do multi-page navigation in Flutter, let’s put what we’ve learned into action by building our Hacker News Application using these APIs. Flutter has a collection of APIs for handling multi-page navigation. The legacy APIs are referred to as Navigator 1.0
. Let’s start by using those to build our page navigation.
We will start by adding a new view with tabs. Create a new home_view.dart
class in the lib/src/ui/home
folder. In it create a new StatefulWidget
called HomeView
and add the following logic to the _HomeViewState
class’ build
method:
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Hacker News'), bottom: TabBar( ...