Previous episode: 03. What are we Going to Build
Next episode: 05. Create App State Notifier Functions
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
Before we move on, adding the Navigator 2.0 to our app, we need to add some files. Let us get started. Create a new directory in our lib folder named router. This directory will hold all the classes and files that we will create in our project. Create a new file as book_pages.dart This will have a list of unique keys for each page. This will help us when we will call the unique key while navigating from one page to another. (silence) (silence) To add few of the plugins that we will be needing throughout our project, navigate to your pubspec.yaml file and add the latest version of the following plugins. We will be using provider to manage the state of our application and url_strategy to compile our app with the web URL. Once adding the plugins make sure you run flutter pub get in your terminal. This command helps us to get the plugins in our project. Divergence may be different, but as far as they're above the current version, you should be fine to go ahead. In our routes folder, create a new dart file named app_state_manager.dart In this file we will create a manager that will manage the state of our application throughout the app. Create an AppStateManager class that extends change notifier so that our AppStateManager notifies the router for the change. Let us define few of the Boolean variables with false value that will hold the app states which we feel our app will be having. We can always add extra app states on later. (silence) (silence) Creating the get (indistinct) methods of the private variables that we have defined so that this can be accessible from the outside of our classes. (silence) (silence) (silence) These are few of the app states which we feel will be used by our application.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.