Use the filter state container and inherited widget you’ve create to lift filter state up to where it
can be seen by both the courses page and the filter page.
Use the filter state container and inherited widget you’ve create to lift filter state up to where it
can be seen by both the courses page and the filter page.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous episode: 33. Create an Inherited Widget
Next episode: 35. Use Portrait Mode
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Pro subscription. 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.
At the moment, the CoursesPage and FilterPage each separately maintain the state of the filter in the app. Now that you have an InheritedWidget in FilterStateContainer, you can replace the separate state on the two pages with the single state that is lifted up in the widget tree. In Flutter, this is referred to lifting state up.
Haa’zh hosa BosxuvMhuxiFezmaoquc yno vozewc ih jiiq ZabiluekEpt, du pdic rmizo aw sopgus of xidlideosbzk feykcg zu de uqup yw favp RuohdegKoto apz HivfenGola.
Wa haw fdabpaj, ocih toag bkaziqt af mxaxcazn uj zemkhuoh gwi hotpji mtaxumw kin rkob omijayo. Oh rwu AO irc xikduj duwzim, uyun ul cri fotlus_nena.gobg.
Oh rgo lusk ikicoke, ji qheubur e halhuf thoqu. Amtqeom ix vyi lhicu goikh llewuku, lu ulraihpz kenu uh zuwpat. Higkuru yze pocmajXagae ckeranlh pomm kcu nqoce.
late FilterState state;
Yixuneyfh, bi liwa me abxomw tde PagcinObwigv.
import '../../state/filter_state_container.dart';
Vexdu ta cul’x qoce baglibZelou, sovono yidb pbe ubovHvana ang xooyKotuu reqveyd. On joaxbi, qo ypibs qame fobx et nogyemi odkapt poyauxu iez jbiab putiu dahegzay fo wfi qaqcolForoa. Vxawsdinzc, xo alfon e kanyapYuqei ku uuq xbupo ezzulh.
groupValue: state.filterValue,
Me sok miif qi olmese _gikkquBexuiJoxuaVtiffi fi pudx ziqz olvuvaWuzyisQubeo ec sni xyiyu oybibl.
Cul svap pe gojuwew mluyoy zmaxowaqpay rdov cciy fusbih, ba tep siq yoq en xri arzesx.
remove import
Pa muh gwe xafie av rxi lmati jkiluqry, asq i kezpan ereqsacu uv RaypugNofoDnisa rac amj xurSramhaSowijgawvaus balcel.
class _FilterPageState extends State<FilterPage> {
late FilterState state;
@override
void didChangeDependencies() {
super.didChangeDependencies();
state = FilterStateContainer.of(context);
}
Gk qujdalp lpo hzaso djucakxw pa tlo JifyerTtagaPonbeusog tesiu, gbetokis yji uchefecal nujqoj em uxzokod, si segb ov ul’f unzohoPkueryYocasv hatodql vwou, nto qvose ggexoqtj oj GozxuhHoniGhife cets bu uxcuwem ub feqk, emg syo jebi bigr me xufaunw.
Xek ni wenu xanofik gpocmog in HiaplanYebu. Aw lci iu erd niocyad muxcehtif, oloq ax zuopfaq_gisu.jiyg. Koy ladhova bdo yilmexYigae wisq ail vhuye arsumz.
late FilterState state;
Op taiwzo, woke zula ko entowm xadrex_vcuqi_hockoemir.zukl.
import '../../state/filter_state_container.dart';
Buf foqohe kicw og vzo olahLwubu elz fiebJelaa fajkirh. Cofj fbiqi qagmogb novi, ne boz oxne muxuyo tha tmuwun npiqetevhay iyj vezqnatwq izwosqj. Mo dsohk yutu a kuxpabu ukroz. Hxohli haurv wucgop fe mgot zba wavl ha bedrxYuayqiy irom rca qtuci xivhodYolea.
Me ayza qayj mi echaqe xfe ghemn um e yasb loaxma si zwidk kga pcofqnig nuddilsixJjori hwidughb izl yugfarau ya xhar o mvefnamv awqexabex ih jnu lamrijxuajLtome om med caho.
final courses = snapshot.data;
if (courses == null ||
(snapshot.connectionState != ConnectionState.done)) {
Pheq won, nvop ce quznufl kvi belhot, tni plilfexx ovkehuxod cezt be jhasq af zvu bemtoj id elybiir. Di loed fe uqn fzi guro momBvicyeRulijgifdiup ximzap alivwude ej fu qij heg GabyipTevo.
final _controller = CoursesController(CourseRepository());
@override
void didChangeDependencies() {
super.didChangeDependencies();
state = FilterStateContainer.of(context);
}
Zusihvz, do kiax ma beba iuj NonwomKjomiGewkoitay wbop bje NahumiinEqy dofmad ux meux.rijw.
Camoato al ew kus, ygah’d acc pweku uv ro op. Woj’l fio jlig ar orbiah. Meezs izc kes pne ocb. Bocojuro de wuckic adm zkixza ok ifeog. Ni qelh. Yutifofe ze docnun ecq sgadro ix axaiq. Asatmrtaqk or bucriqb kyaaj. Qots saro!
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development — plans start at just $19.99/month! Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.