Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Cross-Platform UIs with Flutter

You're reading from   Cross-Platform UIs with Flutter Unlock the ability to create native multiplatform UIs using a single code base with Flutter 3

Arrow left icon
Product type Paperback
Published in Aug 2022
Publisher Packt
ISBN-13 9781801810494
Length 260 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Ryan Edge Ryan Edge
Author Profile Icon Ryan Edge
Ryan Edge
Alberto Miola Alberto Miola
Author Profile Icon Alberto Miola
Alberto Miola
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Building a Counter App with History Tracking to Establish Fundamentals 2. Building a Race Standings App FREE CHAPTER 3. Building a Todo Application Using Inherited Widgets and Provider 4. Building a Native Settings Application Using Material and Cupertino Widgets 5. Exploring Navigation and Routing with a Hacker News Clone 6. Building a Simple Contact Application with Forms and Gesturess 7. Building an Animated Excuses Application 8. Build an Adaptive, Responsive Note-Taking Application with Flutter and Dart Frog 9. Writing Tests and Setting Up GitHub Actions 10. Index 11. Other Books You May Enjoy

Creating the Todo application

In this section, we’ll build a Todo application that relies on an InheritedWidget – specifically, InheritedNotifier – to share and modify a list of todos using a ChangeNotifier. You will be able to create a Todo, mark it as completed, or delete it.

The starting point of this section is an application that already contains TodoController, which we will be sharing with our InheritedNotifier. Once we have dealt with InheritedWidget and have a clear understanding of how everything works, we will move on to the Provider exercise.

Using InheritedWidget for state management

Before we begin refactoring our starting application to use InheritedWidget to share data, let’s get familiar with the process of sharing information by forwarding properties down the widget tree.

Starting with property passing

Open the main.dart file; you will discover that we are creating our TodosController and passing it into our TodosApp:

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime