onFirstTimeLaunched function
bool
onFirstTimeLaunched({
- required String key,
- void onFirstTimeLaunched()?,
- void onNormalLaunch()?,
Description
- Execute some code if this is the first time the user has launched your app.
Parameters
-
key
- The key used for retrieving the information if the user has or has not launched this app yet. -
onFirstTimeLaunched - Execute some code when the
user launches this app for the first time.
-
onNormalLaunch
- Execute some code if theuser has already
launched your app in the past.
Implementation
bool onFirstTimeLaunched({
required String key,
void Function()? onFirstTimeLaunched,
void Function()? onNormalLaunch,
}) {
if (getBool(key) ?? false) {
onFirstTimeLaunched?.call();
return true;
} else {
onNormalLaunch?.call();
}
return false;
}