Premium Only Content
Flutter State Management using InheritedWidget for Journal App
In this Flutter video, you are going to take a look at how to use the InheritedWidget for State Management - No Packages.
• How to use InheritedWidget to pass data from a parent (ancestor) widget to child (descendant) widgets in the widget tree
The Problem:
- Journal app has a mood selector value to be available to all pages.
- All pages need to read selected mood from the parent page.
The Solution:
- Use the InheritedWidget to allow child pages (widgets) to access the parent page selected mood by going up the widget tree.
The InheritedWidget is immutable and allows child widgets to access data (state) above in the widget tree
1. Create a class that extends InheritedWidget
2. Add fields to contain data
3. Add the of() method to access the InheritedWidget from child widgets
4. Add the updateShouldNotify() method to notify (via Flutter framework) widgets to rebuild if the data changed
How it Works:
- InheritedWidget – The InheritedWidget is great to pass data from an ancestor widget to descendent widget. The InheritedWidget is immutable and the data (attributes) are final (cannot change) and the Flutter framework rebuilds the InheritedWidget to refresh with new data.
GitHub: https://github.com/JediPixels/journal_inheritedwidget
Twitter: https://twitter.com/JediPixels
Looking for Updates: https://JediPixels.dev
Blog Article:https://jedipixels.dev/flutter-state-management-using-inheritedwidget-for-journal-app
#flutter #fluttertutorial #dart
-
51:45
Talk Nerdy 2 Us
9 hours ago🔥 Talk Nerdy 2 Us – Feb 7th: HACKED, TRACKED & UNDER ATTACK! 🔥
55.8K4 -
58:33
Man in America
16 hours agoFluoride & the Sinister Plot to Poison Us From Birth w/ Larry Oberheu
53.3K21 -
3:41:30
I_Came_With_Fire_Podcast
16 hours ago🔥USAID SCANDAL | MA-GAZA | Cartel VIOLENCE Ramps Up🔥
56.4K9 -
7:57:34
SpartakusLIVE
10 hours agoShadow BANNED, but we PARTY ON || Friday Night HYPE
62.9K2 -
2:00:53
Omar Elattar
8 hours agoGRANT CARDONE: “Will I Run for Governor?” | Trump EXPOSED | Bitcoin | $500 Billion Crisis!
43.5K7 -
46:48
Glenn Greenwald
11 hours agoGlenn Takes Your Questions On Gaza, USAID, and More | SYSTEM UPDATE #403
81.7K49 -
56:42
Candace Show Podcast
15 hours agoBecoming Brigitte: One Coincidence Too Many | Ep 3
166K174 -
3:14:38
Nerdrotic
15 hours ago $18.38 earnedDisney Plus's Complete FAILURE! Fantastic Four Trailer, MCU Phase 5 Reveal | Friday Night Tights 340
148K46 -
1:00:58
The StoneZONE with Roger Stone
11 hours agoWill RINOs Sink Robert F. Kennedy Jr.'s Confirmation? | The StoneZONE w/ Roger Stone
40.2K7 -
1:15:19
Edge of Wonder
12 hours agoReal Biochip Implants & Havana Syndrome Exposed: Interview With Jesse Beltran
33.6K11