3. Make your Phase 3 App

Task

Now that you have a little experience with Riverpod, let’s push forward and start using it in your own application.

There are three parts to this process:

  1. Convert your current mockup to use Riverpod Providers to control access to your data model.
  2. Implement a couple of interactive features so that application state can change will running the app. You can decide for yourself what aspects of state you want to manage. Here are some suggestions:
    • Define some users, and “login” to the appropriate user when their email address is supplied in the login page. The application state thus includes the currently logged in user.
    • Create a page that allows you to add a new entity to your data model.
    • Create a page that allows you to edit an existing entity in your data model.
  3. Convert Settings to use Riverpod. (See below for details.)

If you are adding or updating data model entities, you’ll need to learn how to create Forms. See the readings for Form documentation links. You might also find the AGC Mockup Phase 3 app to be useful.

Note that if you encounter a CircularDependencyError, it’s because you have inadvertently created a dependency loop in your data model. For example, data model X accesses the provider for data model Y that accesses the provider for data model Z that accesses the provider for data model X. If this happens, you need to reorganize the structure of your data models so that this loop is no longer present.

An Example: The AGC Phase 3 mockup app

To get a sense for what you’re aiming for, please check out Phase 3 Flutter Mockup of the Agile Garden Club app. The major new features of this app include:

Feel free to clone the Phase 3 mockup and run it locally to see how it works.

Test your understanding: convert Settings to Riverpod

In addition to implementing some interactive features, your Phase 3 mockup must convert the Settings implementation from “Controller-based” to Riverpod. Recall that the Settings page allows the user to switch between Light and Dark mode. This implementation was originally part of the “Scaffold” starter template, which didn’t include any state management system. Now that we know about Riverpod, we can simplify the implementation of Settings.

This should only take you a few minutes to accomplish, and will help reinforce your understanding of Riverpod and state management. Here are some hints:

The AGC Phase 3 mockup example does not include this revision so that you cannot simply copy-and-paste the solution!

Getting started with your Phase 3 mockup

You do not need to create a new repo for Phase 3. Just continue with your original repo.

Submission Instructions

By the date and time listed in the Schedule page, please upload the URL to your mockup to Laulima. Also, please indicate what you personally added to the mockup since the last submission.