onClickHowToUse method
void
onClickHowToUse(})
Implementation
void onClickHowToUse(
BuildContext context, {
required String ctaUrl,
required String gifUrl,
required String productId,
required bool howItWorksStepsAvailable,
required String brandLogoUrl,
required String tncFilePath,
}) {
if (howItWorksStepsAvailable) {
if (hubbleConfig().howToUseModalVersion == 2) {
HowItWorksModalBuilderV2.reveal(
context,
productId: productId,
brandLogoUrl: brandLogoUrl,
tncFilePath: tncFilePath,
onTncClick: (
{required String brandLogoUrl,
required String tncFilePath}) async {
deeplinkHandler(
Screens.productTncScreen.name,
queryParams: {
'tncFilePath': tncFilePath,
'brandLogo': brandLogoUrl
},
named: true,
push: true,
eventProps: {},
);
},
);
} else {
HowItWorksModalBuilder.reveal(
context,
productId: productId,
brandLogoUrl: brandLogoUrl,
tncFilePath: tncFilePath,
onTncClick: (
{required String brandLogoUrl,
required String tncFilePath}) async {
deeplinkHandler(
Screens.productTncScreen.name,
queryParams: {
'tncFilePath': tncFilePath,
'brandLogo': brandLogoUrl
},
named: true,
push: true,
eventProps: {},
);
},
);
}
} else {
deeplinkHandler(
Screens.voucherHowToUseScreen.name,
queryParams: {
'ctaUrl': ctaUrl,
'gifUrl': gifUrl,
'brandLogo': brandLogoUrl,
'tncFilePath': tncFilePath,
},
named: true,
push: true,
eventProps: <String, dynamic>{
'sourceScreen': Screens.productPurchaseSuccessScreen.name,
'orderId': state.params['orderId']
},
);
}
}