|
|
|
|
@ -22,200 +22,362 @@ class MarathonBanner extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
const MarathonBanner({Key? key, required this.isMarathonUpcoming}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
MarathonProvider provider = context.read<MarathonProvider>();
|
|
|
|
|
return provider.marathonDetailModel.startTime != null
|
|
|
|
|
? Container(
|
|
|
|
|
decoration: MyDecorations.shadowDecoration,
|
|
|
|
|
height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11,
|
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
child: Stack(
|
|
|
|
|
Widget getUnPrivilegedMarathon(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: MyDecorations.shadowDecoration,
|
|
|
|
|
height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11,
|
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Transform(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
transform: Matrix4.rotationY(
|
|
|
|
|
AppState().isArabic(context) ? math.pi : 0,
|
|
|
|
|
),
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
"assets/images/marathon_banner_bg.svg",
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
AppState().isArabic(context)
|
|
|
|
|
? Positioned(
|
|
|
|
|
right: -15,
|
|
|
|
|
top: -10,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: 10,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: isTablet ? 70 : 65,
|
|
|
|
|
height: isTablet ? 40 : 32,
|
|
|
|
|
color: MyColors.darkDigitColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Positioned(
|
|
|
|
|
left: -20,
|
|
|
|
|
top: -10,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: 15,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: isTablet ? 70 : 65,
|
|
|
|
|
height: isTablet ? 40 : 32,
|
|
|
|
|
color: MyColors.darkDigitColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Transform(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
transform: Matrix4.rotationY(
|
|
|
|
|
AppState().isArabic(context) ? math.pi : 0,
|
|
|
|
|
const Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
),
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
"assets/images/marathon_banner_bg.svg",
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: AppState().isArabic(context) ? 4 : 5,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppState().isArabic(context) ? 0.height : 5.height,
|
|
|
|
|
Text(
|
|
|
|
|
LocaleKeys.getReadyForContest.tr(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: isTablet ? 20 : 11,
|
|
|
|
|
fontStyle: FontStyle.italic,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: MyColors.white.withOpacity(0.83),
|
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
LocaleKeys.brainMarathon.tr(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontStyle: FontStyle.italic,
|
|
|
|
|
fontSize: isTablet ? 30 : 19,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: MyColors.white.withOpacity(0.83),
|
|
|
|
|
height: 32 / 22,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(
|
|
|
|
|
left: AppState().isArabic(context) ? 12 : 3,
|
|
|
|
|
right: AppState().isArabic(context) ? 3 : 12,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
AppState().isArabic(context)
|
|
|
|
|
? Positioned(
|
|
|
|
|
right: -15,
|
|
|
|
|
top: -10,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: 10,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: isTablet ? 70 : 65,
|
|
|
|
|
height: isTablet ? 40 : 32,
|
|
|
|
|
color: MyColors.darkDigitColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Positioned(
|
|
|
|
|
left: -20,
|
|
|
|
|
top: -10,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: 15,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: isTablet ? 70 : 65,
|
|
|
|
|
height: isTablet ? 40 : 32,
|
|
|
|
|
color: MyColors.darkDigitColor,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
AppState().isArabic(context)
|
|
|
|
|
? Align(
|
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: isTablet ? 30 : 20,
|
|
|
|
|
width: isTablet ? 45 : 35,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: math.pi / 4.5,
|
|
|
|
|
child: Text(
|
|
|
|
|
LocaleKeys.brainMarathon.tr(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: isTablet ? 8 : 6,
|
|
|
|
|
height: 1.2,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
const Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(top: 5)
|
|
|
|
|
: Align(
|
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: isTablet ? 30 : 20,
|
|
|
|
|
width: isTablet ? 45 : 35,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: -math.pi / 4.5,
|
|
|
|
|
child: Text(
|
|
|
|
|
LocaleKeys.brainMarathon.tr(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: MyColors.kWhiteColor,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: isTablet ? 8 : 6,
|
|
|
|
|
height: 1.2,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: AppState().isArabic(context) ? 4 : 5,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(top: 5),
|
|
|
|
|
Container(
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
color: Colors.black.withOpacity(0.6),
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.lock_rounded,
|
|
|
|
|
color: MyColors.lightGreyIconColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
MarathonProvider provider = context.read<MarathonProvider>();
|
|
|
|
|
|
|
|
|
|
return !provider.isPrivilegedWithMarathon
|
|
|
|
|
? getUnPrivilegedMarathon(context)
|
|
|
|
|
: provider.marathonDetailModel.startTime != null
|
|
|
|
|
? Container(
|
|
|
|
|
decoration: MyDecorations.shadowDecoration,
|
|
|
|
|
height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11,
|
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Transform(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
transform: Matrix4.rotationY(
|
|
|
|
|
AppState().isArabic(context) ? math.pi : 0,
|
|
|
|
|
),
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
"assets/images/marathon_banner_bg.svg",
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
AppState().isArabic(context)
|
|
|
|
|
? Positioned(
|
|
|
|
|
right: -15,
|
|
|
|
|
top: -10,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: 10,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: isTablet ? 70 : 65,
|
|
|
|
|
height: isTablet ? 40 : 32,
|
|
|
|
|
color: MyColors.darkDigitColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Positioned(
|
|
|
|
|
left: -20,
|
|
|
|
|
top: -10,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: 15,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: isTablet ? 70 : 65,
|
|
|
|
|
height: isTablet ? 40 : 32,
|
|
|
|
|
color: MyColors.darkDigitColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
const Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: AppState().isArabic(context) ? 4 : 5,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppState().isArabic(context) ? 0.height : 5.height,
|
|
|
|
|
Text(
|
|
|
|
|
LocaleKeys.getReadyForContest.tr(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: isTablet ? 20 : 11,
|
|
|
|
|
fontStyle: FontStyle.italic,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: MyColors.white.withOpacity(0.83),
|
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
AppState().isArabic(context) ? provider.marathonDetailModel.titleAr ?? "" : provider.marathonDetailModel.titleEn ?? "",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontStyle: FontStyle.italic,
|
|
|
|
|
fontSize: isTablet ? 30 : 19,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: MyColors.white.withOpacity(0.83),
|
|
|
|
|
height: 32 / 22,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
isTablet ? 10.height : 3.height,
|
|
|
|
|
BuildCountdownTimer(
|
|
|
|
|
timeToMarathon: DateTime.parse(provider.marathonDetailModel.startTime!).millisecondsSinceEpoch,
|
|
|
|
|
provider: provider,
|
|
|
|
|
screenFlag: 0,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppState().isArabic(context) ? 0.height : 5.height,
|
|
|
|
|
Text(
|
|
|
|
|
LocaleKeys.getReadyForContest.tr(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: isTablet ? 20 : 11,
|
|
|
|
|
fontStyle: FontStyle.italic,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: MyColors.white.withOpacity(0.83),
|
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
AppState().isArabic(context) ? provider.marathonDetailModel.titleAr ?? "" : provider.marathonDetailModel.titleEn ?? "",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontStyle: FontStyle.italic,
|
|
|
|
|
fontSize: isTablet ? 30 : 19,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: MyColors.white.withOpacity(0.83),
|
|
|
|
|
height: 32 / 22,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
isTablet ? 10.height : 3.height,
|
|
|
|
|
BuildCountdownTimer(
|
|
|
|
|
timeToMarathon: DateTime.parse(provider.marathonDetailModel.startTime!).millisecondsSinceEpoch,
|
|
|
|
|
provider: provider,
|
|
|
|
|
screenFlag: 0,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(
|
|
|
|
|
left: AppState().isArabic(context) ? 12 : 3,
|
|
|
|
|
right: AppState().isArabic(context) ? 3 : 12,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(
|
|
|
|
|
left: AppState().isArabic(context) ? 12 : 3,
|
|
|
|
|
right: AppState().isArabic(context) ? 3 : 12,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
AppState().isArabic(context)
|
|
|
|
|
? Align(
|
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: isTablet ? 30 : 20,
|
|
|
|
|
width: isTablet ? 45 : 35,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: math.pi / 4.5,
|
|
|
|
|
child: Text(
|
|
|
|
|
LocaleKeys.brainMarathon.tr(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: isTablet ? 8 : 6,
|
|
|
|
|
height: 1.2,
|
|
|
|
|
),
|
|
|
|
|
AppState().isArabic(context)
|
|
|
|
|
? Align(
|
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: isTablet ? 30 : 20,
|
|
|
|
|
width: isTablet ? 45 : 35,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: math.pi / 4.5,
|
|
|
|
|
child: Text(
|
|
|
|
|
LocaleKeys.brainMarathon.tr(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: isTablet ? 8 : 6,
|
|
|
|
|
height: 1.2,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(top: 5)
|
|
|
|
|
: Align(
|
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: isTablet ? 30 : 20,
|
|
|
|
|
width: isTablet ? 45 : 35,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: -math.pi / 4.5,
|
|
|
|
|
child: Text(
|
|
|
|
|
LocaleKeys.brainMarathon.tr(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: MyColors.kWhiteColor,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: isTablet ? 8 : 6,
|
|
|
|
|
height: 1.2,
|
|
|
|
|
).paddingOnly(top: 5)
|
|
|
|
|
: Align(
|
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: isTablet ? 30 : 20,
|
|
|
|
|
width: isTablet ? 45 : 35,
|
|
|
|
|
child: Transform.rotate(
|
|
|
|
|
angle: -math.pi / 4.5,
|
|
|
|
|
child: Text(
|
|
|
|
|
LocaleKeys.brainMarathon.tr(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: MyColors.kWhiteColor,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: isTablet ? 8 : 6,
|
|
|
|
|
height: 1.2,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(top: 5),
|
|
|
|
|
!AppState().isArabic(context)
|
|
|
|
|
? Positioned(
|
|
|
|
|
right: 0,
|
|
|
|
|
bottom: 0,
|
|
|
|
|
child: RotatedBox(
|
|
|
|
|
quarterTurns: 4,
|
|
|
|
|
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor),
|
|
|
|
|
).paddingAll(isTablet ? 20 : 15),
|
|
|
|
|
)
|
|
|
|
|
: Positioned(
|
|
|
|
|
bottom: 0,
|
|
|
|
|
left: 0,
|
|
|
|
|
child: RotatedBox(
|
|
|
|
|
quarterTurns: 2,
|
|
|
|
|
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor),
|
|
|
|
|
).paddingAll(isTablet ? 20 : 15),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(top: 5),
|
|
|
|
|
!AppState().isArabic(context)
|
|
|
|
|
? Positioned(
|
|
|
|
|
right: 0,
|
|
|
|
|
bottom: 0,
|
|
|
|
|
child: RotatedBox(
|
|
|
|
|
quarterTurns: 4,
|
|
|
|
|
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor),
|
|
|
|
|
).paddingAll(isTablet ? 20 : 15),
|
|
|
|
|
)
|
|
|
|
|
: Positioned(
|
|
|
|
|
bottom: 0,
|
|
|
|
|
left: 0,
|
|
|
|
|
child: RotatedBox(
|
|
|
|
|
quarterTurns: 2,
|
|
|
|
|
child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor),
|
|
|
|
|
).paddingAll(isTablet ? 20 : 15),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).onPress(() async {
|
|
|
|
|
int remainingTimeInMinutes = DateTime.parse(provider.marathonDetailModel.startTime!).difference(DateTime.now()).inMinutes;
|
|
|
|
|
|
|
|
|
|
if (remainingTimeInMinutes > 2) {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
try {
|
|
|
|
|
await provider.initializeVideoPlayer().then((_) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
provider.startTimerForSponsorVideo();
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.marathonSponsorVideoScreen);
|
|
|
|
|
});
|
|
|
|
|
} catch (e, s) {
|
|
|
|
|
if (kDebugMode) {
|
|
|
|
|
print("Error in VideoPlayer: ${e.toString()}");
|
|
|
|
|
}
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.marathonIntroScreen);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.marathonIntroScreen);
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox();
|
|
|
|
|
],
|
|
|
|
|
).onPress(() async {
|
|
|
|
|
int remainingTimeInMinutes = DateTime.parse(provider.marathonDetailModel.startTime!).difference(DateTime.now()).inMinutes;
|
|
|
|
|
|
|
|
|
|
if (remainingTimeInMinutes > 2) {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
try {
|
|
|
|
|
await provider.initializeVideoPlayer().then((_) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
provider.startTimerForSponsorVideo();
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.marathonSponsorVideoScreen);
|
|
|
|
|
});
|
|
|
|
|
} catch (e) {
|
|
|
|
|
if (kDebugMode) {
|
|
|
|
|
print("Error in VideoPlayer: ${e.toString()}");
|
|
|
|
|
}
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.marathonIntroScreen);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.marathonIntroScreen);
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|