mirror of
https://github.com/Iconica-Development/flutter_start.git
synced 2025-05-18 18:13:45 +02:00
fix: bug with showing introduction
This commit is contained in:
parent
66ef9af8bb
commit
223a343a56
4 changed files with 3 additions and 16 deletions
|
@ -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,
|
||||
),
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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,
|
||||
);
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue