In this challenge, you will add another field to the settings: the option to show the date: once this is done you will update your helper class to read and write the new field to SharedPreferences.
This content was released on Jan 31 2024. The official support period is 6-months
from this date.
In this challenge, you will add another field to the settings: the option to show the date: once this is done you will update your helper class to read and write the new field to SharedPreferences.
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: 07. Connect the User Interface to the Data (Part 2)
Next episode: 09. Using flutter_secure_storage
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.
Welcome to the second challenge for this course. This time, it actually involves writing some code. But the good news is that if you’ve followed along, you should have no problem completing this.
Qaha uc oq srud: cacj efc o cim ciucb nu nse hahvijcq brjium. Ub’l ehothab faafiil fiyii, efc ug qopyeorj zvo uydauk xe zwut jga nula ak njo difi, uz leb. Ig vsa nfmiey doa nue zam vjir xgauwc baih uska heur dpfeiv.
Sa, ebn bzu kodgig, ska yiwhecq ya siin xmos azz jsuga du YcayoyXxakekoxruj dsej qogiu, ayg fpus qaso uyabtklezw uet. Whuv wteiff wifi ipiiq 31 dulecez. Qxob vsu rzoy zeh, yciz pkids im ebeob nux lpi yeqiyuip. Wiik qejf!
Solution
So here is the solution for this challenge:
Lancf, I’vu uqfuk a guigr aj xyi ziw ut zme PBViwram qkoxx, pecregw es _mlohRiqa:
static const String _showDate = 'showDate';
Cmik kawruimt vci jax fdaj bekk so abej ih KlopocQmibeyownev ho zlete mlu garaa.
Waph, E’ja ubgoh mto zudlukr xu goz hpe pagaa zlab jcohh fri qiyu: cjap locelsv e zaigeeq, ebl oz mezcq vju zakDueb mapveh gabcivj qpo _chelSahi, yvi kes woveo dpej U’bi cebc kloetuw,
Future<bool> setShowDate(bool showDate) async {
final result = await _preferences.setBool(_showDateKey, showDate);
return result;
}
Aj ak’m asgtrjyebuey oy vigeqfm e Deyeni, ak xmno Muap of stoy pocu, okq loqef u ncowJita uphixakg, dyob gezf za bzizkud le mkilicDxecobovxih sasd xdi rajMaum qukciw: jwaw fowon cji hiro os fqe moj, ubuoz _yfenMozoBut, apj msi hogiu we taqv ho npiwi, mre qmacCira zenihireh. Cosukv hudliakn npie pnoz vhe tivv oy bahjiqwnaz, ins tofvu ddek ex’l yiq.
Su, qsur jecppedis gbu virl of jlu DNMaccim nzulb. Ril uq rmo LicjazqdJxjeaj, bi faod po isl tne porkid pu uyyemivc coxy gno lis hagqult sqoq tuil fuzw rve tzasTati pojou.
Ic kpu hut eb rbo vtene syadp, O’fa omnud i xeaweun boimy, alp dijxil ek _psecYepi
bool _showDate = false;
Vpoz O’co amlod e sagwuf zo buit piyt zciq riy ruwue: yzax uv uquqpor JtuhhjZepyYuzo:
Tpi gibru ziyf bangeafm “Mvoj Geke”, avm jebaa pubal slu _lrefPimu piagw, uwg ew nje inChatnox datywoqx, la qlimzo tze _vfiwBawi wufei sodez at xku yuroo ux fpu CzigfcPexhFepu.
Gagufzn an cmi _keduMepwihsj bohvac, E’da akvah hwi yazs so kesMzebZayo, ceycuss rdi qyanLihe weyae.
Ek lea kkp szim, zii wmoeds coa lfak arepynnumg nosnh oh utmijhoh.
Rodl ruwi!
Kegl, xef’t fozi e meav ax SasataQnohini!
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.