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
|
## 2.0.4
|
||||||
|
|
||||||
- Removed `AlwaysShowIntroduction` option, changed naming of `isKillSwitchActive` to `isAllowedToPassThrough`.
|
- Removed `AlwaysShowIntroduction` option, changed naming of `isKillSwitchActive` to `isAllowedToPassThrough`.
|
||||||
|
|
|
@ -18,6 +18,7 @@ class StartUserStoryConfiguration {
|
||||||
this.splashScreenFuture,
|
this.splashScreenFuture,
|
||||||
this.splashScreenCenterWidget,
|
this.splashScreenCenterWidget,
|
||||||
this.splashScreenBackgroundColor,
|
this.splashScreenBackgroundColor,
|
||||||
|
this.canPopFromIntroduction = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// You can use this to build your own splash screen.
|
/// 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.
|
/// The future that is awaited before the splash screen is closed.
|
||||||
final Future<String?> Function(BuildContext context)? splashScreenFuture;
|
final Future<String?> Function(BuildContext context)? splashScreenFuture;
|
||||||
|
|
||||||
|
/// Allow popping from introduction, defaults to true
|
||||||
|
final bool canPopFromIntroduction;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,16 +103,20 @@ List<GoRoute> getStartStoryRoutes(
|
||||||
physics: configuration.introductionScrollPhysics,
|
physics: configuration.introductionScrollPhysics,
|
||||||
child: configuration.introductionFallbackScreen,
|
child: configuration.introductionFallbackScreen,
|
||||||
);
|
);
|
||||||
|
|
||||||
return buildScreenWithoutTransition(
|
return buildScreenWithoutTransition(
|
||||||
context: context,
|
context: context,
|
||||||
state: state,
|
state: state,
|
||||||
child: configuration.introductionBuilder?.call(
|
child: PopScope(
|
||||||
context,
|
canPop: configuration.canPopFromIntroduction,
|
||||||
introduction,
|
child: configuration.introductionBuilder?.call(
|
||||||
) ??
|
context,
|
||||||
Scaffold(
|
introduction,
|
||||||
body: introduction,
|
) ??
|
||||||
),
|
Scaffold(
|
||||||
|
body: introduction,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
@ -93,8 +93,11 @@ Widget _introduction(
|
||||||
physics: configuration.introductionScrollPhysics,
|
physics: configuration.introductionScrollPhysics,
|
||||||
child: configuration.introductionFallbackScreen,
|
child: configuration.introductionFallbackScreen,
|
||||||
);
|
);
|
||||||
return Scaffold(
|
return PopScope(
|
||||||
body: introduction,
|
canPop: configuration.canPopFromIntroduction,
|
||||||
|
child: Scaffold(
|
||||||
|
body: introduction,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
name: flutter_start
|
name: flutter_start
|
||||||
description: "Flutter_start is a package that allows you to jumpstart your application with a splashScreen, introduction and a home."
|
description: "Flutter_start is a package that allows you to jumpstart your application with a splashScreen, introduction and a home."
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
version: 2.0.4
|
version: 2.0.5
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.2.5 <4.0.0"
|
sdk: ">=3.2.5 <4.0.0"
|
||||||
|
|
Loading…
Reference in a new issue