bottomNavigationTutorials function
void
bottomNavigationTutorials({ - required dynamic context,
})
Implementation
void bottomNavigationTutorials({required BuildContext context}) async {
final prefs = await sharedPrefs();
final isShow = prefs.getBool(bottomNavigationPrefKey) ?? true;
if (context.mounted && isShow) {
showTutorials(
context: context,
onFinish: () {
setBottomNavigationTutorialsAsViewed();
showCreateOrJoinSpaceTutorials(context);
},
onClickTarget: (targetFocus) => setBottomNavigationTutorialsAsViewed(),
onSkip: () {
setBottomNavigationTutorialsAsViewed();
showCreateOrJoinSpaceTutorials(context);
return true;
},
targets: [
targetFocus(
identify: 'dashboardKey',
keyTarget: dashboardKey,
contentAlign: isDesktop ? ContentAlign.right : ContentAlign.top,
contentImageUrl: 'assets/images/empty_home.svg',
contentTitle: L10n.of(context).homeTabTutorialTitle,
contentDescription: L10n.of(context).homeTabTutorialDescription,
isFirst: true,
),
if (!isDesktop)
targetFocus(
identify: 'updateKey',
keyTarget: updateKey,
contentAlign: ContentAlign.top,
contentImageUrl: 'assets/images/empty_updates.svg',
contentTitle: L10n.of(context).updatesTabTutorialTitle,
contentDescription: L10n.of(context).updatesTabTutorialDescription,
),
targetFocus(
identify: 'chatsKey',
keyTarget: chatsKey,
contentAlign: isDesktop ? ContentAlign.right : ContentAlign.top,
contentImageUrl: 'assets/images/empty_chat.svg',
contentTitle: L10n.of(context).chatsTabTutorialTitle,
contentDescription: L10n.of(context).chatsTabTutorialDescription,
),
targetFocus(
identify: 'activityKey',
keyTarget: activityKey,
contentAlign: isDesktop ? ContentAlign.right : ContentAlign.top,
contentImageUrl: 'assets/images/empty_activity.svg',
contentTitle: L10n.of(context).activityTabTutorialTitle,
contentDescription: L10n.of(context).activityTabTutorialDescription,
),
targetFocus(
identify: 'jumpToKey',
keyTarget: jumpToKey,
contentAlign: isDesktop ? ContentAlign.right : ContentAlign.top,
iconData: Icons.search,
contentTitle: L10n.of(context).jumpToTabTutorialTitle,
contentDescription: L10n.of(context).jumpToTabTutorialDescription,
isLast: true,
),
],
);
}
}