mirror of
https://github.com/Iconica-Development/flutter_start.git
synced 2025-05-18 18:13:45 +02:00
fix: Check with the service if the introduction should be shown before actually showing
When removing this, the introduction is briefly shown before calling the onComplete
This commit is contained in:
parent
2a66e11611
commit
2c61f8d7db
4 changed files with 35 additions and 15 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
## 4.2.3
|
||||||
|
- Added check if introduction should be shown according to the service before showing the introduction at all
|
||||||
|
|
||||||
## 4.2.2
|
## 4.2.2
|
||||||
- Added custom navigator in the root of the navigator user-story
|
- Added custom navigator in the root of the navigator user-story
|
||||||
|
|
||||||
|
|
|
@ -104,22 +104,25 @@ Widget _splashScreen(
|
||||||
|
|
||||||
if (configuration.useKillswitch && isAllowedToPassThrough) return;
|
if (configuration.useKillswitch && isAllowedToPassThrough) return;
|
||||||
|
|
||||||
if ((!configuration.showIntroduction) && context.mounted) {
|
var introService = configuration.introductionService ??
|
||||||
onComplete(context);
|
IntroductionService(SharedPreferencesIntroductionDataProvider());
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (context.mounted) {
|
var shouldShowIntroduction =
|
||||||
await navigator.pushReplacement(
|
configuration.showIntroduction && await introService.shouldShow();
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) => _introduction(
|
if (!context.mounted) return;
|
||||||
configuration,
|
|
||||||
context,
|
if (!shouldShowIntroduction) return onComplete(context);
|
||||||
onComplete,
|
|
||||||
),
|
await navigator.pushReplacement(
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => _introduction(
|
||||||
|
configuration,
|
||||||
|
context,
|
||||||
|
onComplete,
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
var builder = configuration.splashScreenBuilder;
|
var builder = configuration.splashScreenBuilder;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
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."
|
||||||
version: 4.2.2
|
version: 4.2.3
|
||||||
|
|
||||||
publish_to: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
publish_to: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||||
|
|
||||||
|
|
14
test/_test.dart
Normal file
14
test/_test.dart
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
// This is an example unit test.
|
||||||
|
//
|
||||||
|
// A unit test tests a single function, method, or class. To learn more about
|
||||||
|
// writing unit tests, visit
|
||||||
|
// https://flutter.dev/docs/cookbook/testing/unit/introduction
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
group('Plus Operator', () {
|
||||||
|
test('should add two numbers together', () {
|
||||||
|
expect(1 + 1, 2);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in a new issue