|
|
|
|
@ -17,14 +17,14 @@ class SponsorVideoScreen extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
MarathonProvider provider = context.watch<MarathonProvider>();
|
|
|
|
|
MarathonProvider provider = context.read<MarathonProvider>();
|
|
|
|
|
return WillPopScope(
|
|
|
|
|
onWillPop: () {
|
|
|
|
|
provider.timerForSponsorVideo.cancel();
|
|
|
|
|
provider.videoController.pause();
|
|
|
|
|
provider.disposeVideoPlayer();
|
|
|
|
|
provider.sponsorsSecondsCounter = 0;
|
|
|
|
|
provider.totalSponsorVideoSeconds = 0;
|
|
|
|
|
provider.timerForSponsorVideo.cancel();
|
|
|
|
|
return Future<bool>.value(true);
|
|
|
|
|
},
|
|
|
|
|
child: Scaffold(
|
|
|
|
|
@ -49,7 +49,9 @@ class SponsorVideoScreen extends StatelessWidget {
|
|
|
|
|
borderRadius: provider.totalSponsorVideoSeconds == 0 ? null : BorderRadius.circular(15),
|
|
|
|
|
),
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 8),
|
|
|
|
|
child: provider.totalSponsorVideoSeconds == 0
|
|
|
|
|
child: Consumer<MarathonProvider>(
|
|
|
|
|
builder: (BuildContext context, MarathonProvider provider, Widget? child) {
|
|
|
|
|
return provider.totalSponsorVideoSeconds == 0
|
|
|
|
|
? InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pushReplacementNamed(context, AppRoutes.marathonIntroScreen);
|
|
|
|
|
@ -64,12 +66,15 @@ class SponsorVideoScreen extends StatelessWidget {
|
|
|
|
|
: Directionality(
|
|
|
|
|
textDirection: ui.TextDirection.ltr,
|
|
|
|
|
child: ("${LocaleKeys.ourSponsor.tr()} ${provider.totalSponsorVideoSeconds < 10 ? "0" : ""}${provider.totalSponsorVideoSeconds}").toText12(color: MyColors.darkTextColor),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(top: 20, right: 18),
|
|
|
|
|
|
|
|
|
|
Consumer<MarathonProvider>(
|
|
|
|
|
builder: (BuildContext context, MarathonProvider provider, Widget? child) {
|
|
|
|
|
//TODO: WE WILL INCREASE THIS 2 BEFORE GOING LIVE
|
|
|
|
|
provider.sponsorsSecondsCounter >= 2
|
|
|
|
|
return provider.sponsorsSecondsCounter >= 2
|
|
|
|
|
? Align(
|
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
@ -91,7 +96,9 @@ class SponsorVideoScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(top: 20, left: 18)
|
|
|
|
|
: const SizedBox(),
|
|
|
|
|
: const SizedBox();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|