mirror of
https://github.com/Iconica-Development/flutter_start.git
synced 2025-05-18 18:13:45 +02:00
Merge pull request #13 from Iconica-Development/feat/can-pop-introduction
feat(introduction): add popscope for introduction screen
This commit is contained in:
commit
ff0df4e1b6
5 changed files with 25 additions and 10 deletions
|
@ -1,3 +1,7 @@
|
|||
## 2.0.5
|
||||
|
||||
- Added canPopFromIntroduction to enable/disable popping from introduction screens
|
||||
|
||||
## 2.0.4
|
||||
|
||||
- Removed `AlwaysShowIntroduction` option, changed naming of `isKillSwitchActive` to `isAllowedToPassThrough`.
|
||||
|
|
|
@ -18,6 +18,7 @@ class StartUserStoryConfiguration {
|
|||
this.splashScreenFuture,
|
||||
this.splashScreenCenterWidget,
|
||||
this.splashScreenBackgroundColor,
|
||||
this.canPopFromIntroduction = true,
|
||||
});
|
||||
|
||||
/// You can use this to build your own splash screen.
|
||||
|
@ -60,4 +61,7 @@ class StartUserStoryConfiguration {
|
|||
|
||||
/// The future that is awaited before the splash screen is closed.
|
||||
final Future<String?> Function(BuildContext context)? splashScreenFuture;
|
||||
|
||||
/// Allow popping from introduction, defaults to true
|
||||
final bool canPopFromIntroduction;
|
||||
}
|
||||
|
|
|
@ -103,9 +103,12 @@ List<GoRoute> getStartStoryRoutes(
|
|||
physics: configuration.introductionScrollPhysics,
|
||||
child: configuration.introductionFallbackScreen,
|
||||
);
|
||||
|
||||
return buildScreenWithoutTransition(
|
||||
context: context,
|
||||
state: state,
|
||||
child: PopScope(
|
||||
canPop: configuration.canPopFromIntroduction,
|
||||
child: configuration.introductionBuilder?.call(
|
||||
context,
|
||||
introduction,
|
||||
|
@ -113,6 +116,7 @@ List<GoRoute> getStartStoryRoutes(
|
|||
Scaffold(
|
||||
body: introduction,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
|
|
@ -93,8 +93,11 @@ Widget _introduction(
|
|||
physics: configuration.introductionScrollPhysics,
|
||||
child: configuration.introductionFallbackScreen,
|
||||
);
|
||||
return Scaffold(
|
||||
return PopScope(
|
||||
canPop: configuration.canPopFromIntroduction,
|
||||
child: Scaffold(
|
||||
body: introduction,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
name: flutter_start
|
||||
description: "Flutter_start is a package that allows you to jumpstart your application with a splashScreen, introduction and a home."
|
||||
publish_to: "none"
|
||||
version: 2.0.4
|
||||
version: 2.0.5
|
||||
|
||||
environment:
|
||||
sdk: ">=3.2.5 <4.0.0"
|
||||
|
|
Loading…
Reference in a new issue