FlutterCountdownTimer
FlutterCountdownTimer copied to clipboard
Undefined class 'CurrentRemainingTime'.
Undefined class 'CurrentRemainingTime'. Try changing the name to the name of an existing class, or creating a class with the name 'CurrentRemainingTime'.
how to set the class? sorry for dumb question 😂
Do you mean this?You can post your code if you can.
sample code
CountdownTimer(
controller: controller,
widgetBuilder: (_, CurrentRemainingTime? time) {
if (time == null) {
return Text('Game over');
}
return Text(
'days: [ ${time.days} ], hours: [ ${time.hours} ], min: [ ${time.min} ], sec: [ ${time.sec} ]');
},
),
my code
Expanded(
flex: 3,
child: CountdownTimer(
endTime: DateTime.parse(
todaylist[
"date"])
.toLocal()
.millisecondsSinceEpoch,
))
i want to replace : with custom text i want to show text like 00 hours 10 minutes 42 seconds more
CountdownTimer( controller: controller, widgetBuilder: (_, CurrentRemainingTime? time) { if (time == null) { return Text('Game over'); } var text = ''; if(time.days != null) { text = '${time.days} days'; } text += '${time.hours ?? '00'} hours ${time.min} minutes ${time.sec} seconds'; ///00 hours 10 minutes 42 seconds return Text(text); }, ),