|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
|
|
import 'package:auto_size_text/auto_size_text.dart';
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_countdown_timer/current_remaining_time.dart';
|
|
|
|
|
@ -21,7 +22,7 @@ class BuildCountdownTimer extends StatelessWidget {
|
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
final TextStyle styleTextHome = const TextStyle(
|
|
|
|
|
fontSize: 7,
|
|
|
|
|
// fontSize: 7,
|
|
|
|
|
color: MyColors.greyACColor,
|
|
|
|
|
fontStyle: FontStyle.italic,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
@ -31,9 +32,8 @@ class BuildCountdownTimer extends StatelessWidget {
|
|
|
|
|
final TextStyle styleDigitHome = const TextStyle(
|
|
|
|
|
height: 23 / 27,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
fontSize: 24,
|
|
|
|
|
// fontSize: 24,
|
|
|
|
|
fontStyle: FontStyle.italic,
|
|
|
|
|
fontFamily: "Poppins",
|
|
|
|
|
letterSpacing: -1.44,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
);
|
|
|
|
|
@ -62,12 +62,16 @@ class BuildCountdownTimer extends StatelessWidget {
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
"00",
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
LocaleKeys.days.tr(),
|
|
|
|
|
minFontSize: 7,
|
|
|
|
|
maxFontSize: 8,
|
|
|
|
|
style: screenFlag == 0 ? styleTextHome : styleTextMarathon,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -75,12 +79,16 @@ class BuildCountdownTimer extends StatelessWidget {
|
|
|
|
|
buildSeparator(),
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
"00",
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
LocaleKeys.hours.tr(),
|
|
|
|
|
minFontSize: 7,
|
|
|
|
|
maxFontSize: 8,
|
|
|
|
|
style: screenFlag == 0 ? styleTextHome : styleTextMarathon,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -88,12 +96,16 @@ class BuildCountdownTimer extends StatelessWidget {
|
|
|
|
|
buildSeparator(),
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
"00",
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
LocaleKeys.minutes.tr(),
|
|
|
|
|
minFontSize: 7,
|
|
|
|
|
maxFontSize: 8,
|
|
|
|
|
style: screenFlag == 0 ? styleTextHome : styleTextMarathon,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -101,12 +113,16 @@ class BuildCountdownTimer extends StatelessWidget {
|
|
|
|
|
buildSeparator(),
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
"00",
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
LocaleKeys.seconds.tr(),
|
|
|
|
|
minFontSize: 7,
|
|
|
|
|
maxFontSize: 8,
|
|
|
|
|
style: screenFlag == 0 ? styleTextHome : styleTextMarathon,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -116,8 +132,10 @@ class BuildCountdownTimer extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget buildSeparator() {
|
|
|
|
|
return Text(
|
|
|
|
|
return AutoSizeText(
|
|
|
|
|
" : ",
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -140,16 +158,22 @@ class BuildCountdownTimer extends StatelessWidget {
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
time.days == null
|
|
|
|
|
? Text(
|
|
|
|
|
? AutoSizeText(
|
|
|
|
|
"00",
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
)
|
|
|
|
|
: Text(
|
|
|
|
|
: AutoSizeText(
|
|
|
|
|
time.days! < 10 ? "0${time.days.toString()}" : time.days.toString(),
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
LocaleKeys.days.tr(),
|
|
|
|
|
minFontSize: 7,
|
|
|
|
|
maxFontSize: 8,
|
|
|
|
|
style: screenFlag == 0 ? styleTextHome : styleTextMarathon,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -158,16 +182,22 @@ class BuildCountdownTimer extends StatelessWidget {
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
time.hours == null
|
|
|
|
|
? Text(
|
|
|
|
|
? AutoSizeText(
|
|
|
|
|
"00",
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
)
|
|
|
|
|
: Text(
|
|
|
|
|
: AutoSizeText(
|
|
|
|
|
time.hours! < 10 ? "0${time.hours.toString()}" : time.hours.toString(),
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
LocaleKeys.hours.tr(),
|
|
|
|
|
minFontSize: 7,
|
|
|
|
|
maxFontSize: 8,
|
|
|
|
|
style: screenFlag == 0 ? styleTextHome : styleTextMarathon,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -176,16 +206,22 @@ class BuildCountdownTimer extends StatelessWidget {
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
time.min == null
|
|
|
|
|
? Text(
|
|
|
|
|
? AutoSizeText(
|
|
|
|
|
"00",
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
)
|
|
|
|
|
: Text(
|
|
|
|
|
: AutoSizeText(
|
|
|
|
|
time.min! < 10 ? "0${time.min.toString()}" : time.min.toString(),
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
LocaleKeys.minutes.tr(),
|
|
|
|
|
minFontSize: 7,
|
|
|
|
|
maxFontSize: 8,
|
|
|
|
|
style: screenFlag == 0 ? styleTextHome : styleTextMarathon,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -194,16 +230,22 @@ class BuildCountdownTimer extends StatelessWidget {
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
time.sec == null
|
|
|
|
|
? Text(
|
|
|
|
|
? AutoSizeText(
|
|
|
|
|
"00",
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
)
|
|
|
|
|
: Text(
|
|
|
|
|
: AutoSizeText(
|
|
|
|
|
time.sec! < 10 ? "0${time.sec.toString()}" : time.sec.toString(),
|
|
|
|
|
maxFontSize: 24,
|
|
|
|
|
minFontSize: 20,
|
|
|
|
|
style: screenFlag == 0 ? styleDigitHome : styleDigitMarathon,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
LocaleKeys.seconds.tr(),
|
|
|
|
|
minFontSize: 7,
|
|
|
|
|
maxFontSize: 8,
|
|
|
|
|
style: screenFlag == 0 ? styleTextHome : styleTextMarathon,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|