initialise method
void initialise (BuildContext ctx, {required bool fromSignUp, required int mainScreenIndex})
Initalizing function.
params:
ctx
: BuildContext, contain parent infofromSignUp
: Bool to find user entrymainScreenIndex
: Index to find tab on mainScreen
returns: None
Implementation
void initialise(
BuildContext ctx, {
required bool fromSignUp,
required int mainScreenIndex,
}) {
currentPageIndex = mainScreenIndex;
showAppTour = fromSignUp;
pluginPrototypeData = {
"Donation": {
"icon": Icons.attach_money_outlined,
"page": const ChangeThemeTile(),
}
};
notifyListeners();
if (!showAppTour) {
tourComplete = true;
tourSkipped = false;
} else {
Future.delayed(
const Duration(seconds: 1),
() => navigationService.pushDialog(
CustomAlertDialog(
dialogTitle: 'App Tour',
dialogSubTitle: 'Start app tour to know talawa functioning',
successText: 'Start',
secondaryButtonText: 'Skip',
success: () {
context = ctx;
navigationService.pop();
tourHomeTargets();
},
secondaryButtonTap: () {
tourComplete = false;
tourSkipped = true;
notifyListeners();
},
),
),
);
}
}