fix: bug with showing introduction

This commit is contained in:
mike doornenbal 2024-02-09 10:49:12 +01:00
parent 66ef9af8bb
commit 223a343a56
4 changed files with 3 additions and 16 deletions

View file

@ -24,13 +24,6 @@ class Home extends StatelessWidget {
startNavigatorUserStory(config, context);
}
final _router = GoRouter(
initialLocation: '/splashScreen',
routes: [
...getStartRoutes(),
],
);
List<GoRoute> getStartRoutes() => getStartStoryRoutes(
config,
);
@ -40,7 +33,7 @@ StartUserStoryConfiguration config = StartUserStoryConfiguration(
ExampleIntroductionDataProvider(),
),
useKillswitch: true,
// showIntroduction: false,
showIntroduction: true,
splashScreenBuilder: (context, onFinish) => SplashScreen(
onFinish: onFinish,
),

View file

@ -13,7 +13,6 @@ class StartUserStoryConfiguration {
this.introductionFallbackScreen,
this.introductionScrollPhysics,
this.showIntroduction = true,
this.alwaysShowIntroduction = false,
this.useKillswitch = false,
this.minimumSplashScreenDuration = 3,
this.splashScreenFuture,
@ -47,9 +46,6 @@ class StartUserStoryConfiguration {
/// If the introduction should be shown.
final bool showIntroduction;
/// If this is true the introduction will always be shown.
final bool alwaysShowIntroduction;
/// If the killswitch is enabled this app can be remotely disabled.
final bool useKillswitch;

View file

@ -53,8 +53,7 @@ List<GoRoute> getStartStoryRoutes(
if (configuration.useKillswitch && !isAllowedToPassThrough) return;
if (!configuration.showIntroduction ||
(introductionSeen && !configuration.alwaysShowIntroduction)) {
if (!configuration.showIntroduction || introductionSeen) {
return go(
configuration.homeScreenRoute ?? StartUserStoryRoutes.home,
);

View file

@ -49,8 +49,7 @@ Widget _splashScreen(
if (configuration.useKillswitch && !isAllowedToPassThrough) return;
if (!configuration.showIntroduction ||
(introductionSeen && !configuration.alwaysShowIntroduction)) {
if (!configuration.showIntroduction || introductionSeen) {
await navigator.pushReplacement(
MaterialPageRoute(
builder: (context) => _home(configuration, context),