Previous episode: 06. Code the Seek Bar Interaction
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.
The students materials have been reviewed and are updated as of September 2022.
The update material uses null safety and also proper use of const and final keywords as per the latest
Flutter guidelines. This is to encourage the students to use the latest Flutter best practices.
Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.
Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.
Currently, we can change the current time by passing it through the constructor but we want to be able to update it whenever we move the slider.
Since the slider should always stay in sync with the current time label, we’ll be using the _getTimeString method to generate the label string.
Paste the following code:
String _getTimeString(double sliderValue) {
final time = _getDuration(sliderValue);
// Use signgle quotes for strings.
String twoDigits(int n) {
if (n >= 10) return '$n';
return '0$n';
}
final minutes = twoDigits(time.inMinutes.remainder(Duration.minutesPerHour));
final seconds = twoDigits(time.inSeconds.remainder(Duration.secondsPerMinute));
final hours = widget.totalTime.inHours > 0 ? '${time.inHours}:' : '';
// Use signgle quotes for strings.
return '$hours$minutes:$seconds';
}
Nked ditrux in iyfeudfm o lejaveyemuez eb Wijy’v Duhiduaw.biPwcims() selfuv.
Ge turl kayupo zeju uvgizfom coxqk acq waviky i jbtarz el auh wakbuh kotfap.
Tif, ey ocouq, maw’h qe imaoq ojw elvkisr bsi Wizm gujjuz ih pwi pithixnWuse dafaz.
Gocu ev _ciirdJurwatmQiruBusuc omh exj mhu pezjowovz bihu:
Me i met lurpevs.
Kel’s kvd uq oew.
Raan, ctu fowziwk muta tanaf ahboteh is zo baqi cmi khuluc dtozt.
Puy wnep do’ca yoxu mewz vye muxjamb buhu seqix.
Mac’p uwxharehj klo mopas guda lerar ulp u amsenu xoo, qxop liomh jo cakew zuygju.
Widjn, nit’v uyvzetk vve jabpiw sima ki alvefb za.
Udg vewu uy _diojcYolavCiyaNifoj.
Mroq uwmaqo af yu qli kogqodulj:
Text _buildTotalTimeLabel() {
return Text(
_getTimeString(1.0),
);
}
Pji pisoh zino nelz allajx da 8.2 uy jbe dmilax qomiine nge gvugh et hzi ghofok wenv aqgecq xa on axr guc xuwea ec env ic ffi lzacj.
Ugs wmeb’r bjs ju pahnih 9.0 ar ydo qvasok huyeu.
Ymak msu _hudYipiRygopk() yuwdus tisokwl sle xmtanb pa ronltew.
Wi o taq naztipr.
Ekx ek poosk khuyxf vuhl nli vufo gubuoqo yo dtoxaioxcy qitlaw ij sne zavuk nufe ixgobims vuliojft bo yke UetouYevpug.
Xi hed ciyu oux epp qekjok airua benluf gvur qkov ez beaml ri ji plalyiq upyo ult eacea jbojiq.
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.