getFirstRoute function
- AuthUserStoryConfiguration configuration,
- BuildContext context
Implementation
Future<String> getFirstRoute(
AuthUserStoryConfiguration configuration,
BuildContext context,
) async {
var user = await configuration.onGetLoggedInUser?.call(context);
if (user == null) {
return AuthUserStoryRoutes.loginScreen;
}
if (configuration.useOnboarding && !user.onboarded) {
return AuthUserStoryRoutes.onboarding;
} else {
return configuration.afterLoginRoute ?? '';
}
}