createOrJoinSpaceTutorials function
Future<void>
createOrJoinSpaceTutorials({ - required dynamic context,
})
Implementation
Future<void> createOrJoinSpaceTutorials({required BuildContext context}) async {
final lang = L10n.of(context);
final prefs = await sharedPrefs();
final isShow = prefs.getBool(createOrJoinSpacePrefKey) ?? true;
if (context.mounted && isShow) {
showTutorials(
context: context,
onFinish: setCreateOrJoinSpaceTutorialAsViewed,
onClickTarget: (targetFocus) => setCreateOrJoinSpaceTutorialAsViewed(),
onSkip: () {
setCreateOrJoinSpaceTutorialAsViewed();
return true;
},
targets: [
targetFocus(
identify: 'createNewSpaceKey',
keyTarget: createNewSpaceKey,
contentAlign: ContentAlign.top,
shape: ShapeLightFocus.RRect,
contentTitle: lang.createSpaceTutorialTitle,
contentDescription: lang.createSpaceTutorialDescription,
isFirst: true,
),
targetFocus(
identify: 'joinExistingSpaceKey',
keyTarget: joinExistingSpaceKey,
contentAlign: ContentAlign.top,
shape: ShapeLightFocus.RRect,
contentTitle: lang.joinSpaceTutorialTitle,
contentDescription: lang.joinSpaceTutorialDescription,
isLast: true,
),
],
);
}
}