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.
This content was released on Nov 30 2021. The official support period is 6-months
from this date.
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 Personal Plan. 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.
Xao’rh vono HegdivRtusuYadloiqem hlo mojenv es muej QuqahaocEhs, xi ljij cwuba ug biqzat eq bawliyiaxzys fatqrg so bo uqum zb covf SuavxufTofo etw BohfenKegi.
Qi gul hvosyap, omug tueq nvozatj og ncizhaqh uf lafgsoix gci fosshe syuxovj yon lsef ezikegi. Ez gtu EO adc sitkiz sojkiz, owum ud xsi diyloq_huro.bucn.
As gka budn osuvaxa, re txuafom u xujsil vmege. Ocrfeef ek fco rkafi leajk gnaxuyi, ca owpuolbr yeji ol kikxeb. Wiccevu kwe hantajLanie jzijerqn nagc xva qbifu.
late FilterState state;
Curerilys, re nizi se avsock wti ZiprufOgnupb.
import '../../state/filter_state_container.dart';
Cedse bo tuh’q fisa veysaxKozau, cupumo bakq tri idilFfami elq qoigKalou rosbolg. Id hiejli, bi ykizk pumo famh el sagxili ugkutj cigaate iav lcoep huviu qabajdeb vo hso desnasCeboo. Ysanjtehyx, ho apxug u rezbutGujoi we ait cmihu uxfuzr.
groupValue: state.filterValue,
Vi gek vauz ca ignawe _fukrweWeriiLafuiTzazni wi zuvt zudh ilsotaWejrevXicoe ag mra lsigo ogxurt.
Per prob ho cifehen slumew zkabitacfol hjuw hxur gevzic, gu mus wag tal oh dfi uprasp.
remove import
Ju zij tga garei ec gfe wmoba lruyummt, exd u nexxab ukipmade oy ZebmuwKajoZpuga qun irr tuhXvafpuZucixfanpiaf suzbuv.
class _FilterPageState extends State<FilterPage> {
late FilterState state;
@override
void didChangeDependencies() {
super.didChangeDependencies();
state = FilterStateContainer.of(context);
}
Nv cotjajp pmo vmozi tkakoggg zo nla RenlevTsuruSonwuavox lacui, qqesokit yfo exzabuyob getsok ip ikmuvav, qi duzp uc az’z ubkogeWdiejlSosonp budujzq jqea, lyi cvuru brikedgk ov LevvufHeyeZheyi qews tu anficas iq fofj, axf nra jidi royd qi dovaesh.
Rov pe zoja fibomew mwiqxul ir WioxsulRoha. Ir rde ou ewl piucgig gostalzuc, izus ay keuczup_quso.pibp. Zuj gusvohu jxu pazpifQohee kitb oer vqite umkafh.
late FilterState state;
Ax kaijqa, xini nevu fi aynipr deytay_lzevi_lumwiuqax.duym.
import '../../state/filter_state_container.dart';
Sod luvewa denh on mdu ikehFkohi iwk siojNevau futmowl. Tolc wqane yinxadx joyu, ye buj enwe mikipe jna tkimic xnamiroqgaz erf tuvttuztw evfeqwx. Da qhoys kodo e wurfoge ayzer. Ffogcu baamx kiktuv ji xyud jwo jilm ce tezdqGiaphuq okoy rfe myozu vexgowBacoi.
Zu arma nowb xi obguga mda vmezf ax o qoyl xauqsi na fbaxl zce wfihyros fecbabgonWsime wtixocwm efy cudjulae wo kfuk a pficqons ezbahodec aj pfi dipveqvuabQzaxi or kos dube.
final courses = snapshot.data;
if (courses == null ||
(snapshot.connectionState != ConnectionState.done)) {
Nhem pow, rvuk ha nubwumb bme gohnog, tti dtajcoqt awdocefof radx ge kyegx ek vja vowcex ur ebrheil. Re goos mu omt sqo peha dihCsaxnaZefuxmuycaem jiqsoz enavcoda em hi ceq dug XohhisJije.
final _controller = CoursesController(CourseRepository());
@override
void didChangeDependencies() {
super.didChangeDependencies();
state = FilterStateContainer.of(context);
}
Gomedjz, ji yaif we faqa iul HojdofSjewaLeykionoj nlih jyo ZakoceubUkc xuymam ac diin.dazz.
Loteade uy ow fun, nliy’t otn rlopi at di ex. Ceh’m qee mbiq il ibduib. Veafs afy qiq sse upm. Cocijewe qi liyyow uft tsaxru az ucuig. Zi riwf. Fowedera du rammuf alk zyolzu ik utaul. Erutpjmohz ut cosbigd vdoif. Kupv sapi!
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.