navigateToProfileItemPage function
navigateToProfileItemPage function is used to validate routes in user profile page, If route is provided, it navigates to the specified page and if route is null it displays A coming soon snack bar
Implementation
Future<void> navigateToProfileItemPage({
required BuildContext context,
required ProfileItem profileItem,
}) async {
if (profileItem.onTapRoute == pinVerificationRoute) {
await triggerNavigationEvent(
context: context,
route: profileItem.onTapRoute,
args: PinVerificationType.pinChange);
}
if (profileItem.onTapRoute == termsAndConditionsRoute) {
final List<AppContext> appContext = AppWrapperBase.of(context)!.appContexts;
String? termsUrl;
if (appContext.contains(AppContext.AfyaMoja)) {
termsUrl = afyaMojaTermsUrl;
}
await triggerNavigationEvent(
context: context, route: profileItem.onTapRoute, args: termsUrl);
} else {
await triggerNavigationEvent(
context: context, route: profileItem.onTapRoute);
}
}