onPlayClick method
dynamic
onPlayClick({})
Implementation
onPlayClick(
{required BuildContext context,
required PlayState playState,
required Datum content,
required Function onLoadCallback,
required String loginPageUrl,
required String plansPageUrl,
bool isContinueWatchingItemClicked = false,
String? pageName}) async {
if (playState.buttonState == PlayButtonState.login) {
// redirect to login page url here
// ScaffoldMessenger.of(context)
// .showSnackBar(const SnackBar(content: Text("Todo : LOGIN")));
RouteGenerator().navigate(context, loginPageUrl);
} else if (playState.buttonState == PlayButtonState.play ||
playState.buttonState == PlayButtonState.clearLead) {
if (isContinueWatchingItemClicked) {
} else {
//Sho
// ScaffoldMessenger.of(context).showSnackBar(
// const SnackBar(content: Text("Sending callback : Play")));
onLoadCallback(
PlayState(buttonState: playState.buttonState, isLoading: true));
}
await _playVideo(content, playState,
onLoadCallback: onLoadCallback, context: context);
} else if (playState.buttonState == PlayButtonState.subscribe) {
onLoadCallback(PlayState(
buttonState: playState.buttonState,
buttonText: PlayButtonState.subscribe,
isLoading: false));
// gotoPlansPage(context);
// ScaffoldMessenger.of(context)
// .showSnackBar(const SnackBar(content: Text("Todo : Plans Page")));
RouteGenerator().navigate(context, plansPageUrl);
// Redirect to plans page here
} else if (playState.buttonState == PlayButtonState.buy) {
initBuyNow(
context: context,
playState: playState,
content: content,
onLoadCallback: onLoadCallback);
}
}