

The listen: false argument tells flutter that this widget does not need to be re-rendered on state changes. This instance can then be used to call any methods on that class. Here Provider.of(context, listen: false) reveals the instance of TodosModel instance we will later supply to our app. The provider package relies heavily on the static type system of Dart. I created a new file in this location for this widget: lib/widgets/task_list_item.dart.Īnother new thing to notice here is the use of Provider.of(context, listen: false) inside the onChanged and onPressed arguments. The TaskListItem class will be instantiated with a Task instance which will be later processed and rendered to the UI.

We will use a ListTile widget to create this widget. Let's start out writing our TaskListItem widget. Only filtering according to the selected tab. Let's look at the widget tree of the HomeScreen widget we have to create to make our app.Īll three tabs will show similar widgets. The app will mainly consist of two screens.Īgain Home Screen will have a TabView containing these tabs In this final section, I will discuss on how I laid out the UI and also how I plugged the TodosModel I created in the previous section.įirst let's see the structure of the app. Enter fullscreen mode Exit fullscreen mode
