mirror of
https://github.com/Iconica-Development/flutter_start.git
synced 2025-05-19 10:33:45 +02:00
Compare commits
12 commits
Author | SHA1 | Date | |
---|---|---|---|
|
87bf58e6e7 | ||
|
ada23abbc5 | ||
|
2c61f8d7db | ||
|
2a66e11611 | ||
0976083a9f | |||
6f24e0521d | |||
328a75b5a2 | |||
|
ed8b5b401a | ||
|
7635b8a4cc | ||
|
d0b0f88ad3 | ||
|
62161aa60b | ||
|
bf018a3ce6 |
9 changed files with 110 additions and 42 deletions
14
.github/workflows/release.yml
vendored
Normal file
14
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
name: Iconica Standard Component Release Workflow
|
||||||
|
# Workflow Caller version: 1.0.0
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
call-global-iconica-workflow:
|
||||||
|
uses: Iconica-Development/.github/.github/workflows/component-release.yml@master
|
||||||
|
secrets: inherit
|
||||||
|
permissions: write-all
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -44,3 +44,7 @@ app.*.map.json
|
||||||
ios
|
ios
|
||||||
.metadata
|
.metadata
|
||||||
pubspec.lock
|
pubspec.lock
|
||||||
|
|
||||||
|
# FVM Version Cache
|
||||||
|
.fvm/
|
||||||
|
.fvmrc
|
||||||
|
|
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -1,3 +1,15 @@
|
||||||
|
## 4.2.4
|
||||||
|
- Fixed the userstory to always call the splashScreenFuture and killswitchservice logic when a custom splashScreenBuilder is provided
|
||||||
|
|
||||||
|
## 4.2.3
|
||||||
|
- Added check if introduction should be shown according to the service before showing the introduction at all
|
||||||
|
|
||||||
|
## 4.2.2
|
||||||
|
- Added custom navigator in the root of the navigator user-story
|
||||||
|
|
||||||
|
## 4.2.1
|
||||||
|
- Updated flutter_introduction to 5.0.0
|
||||||
|
|
||||||
## 4.1.0
|
## 4.1.0
|
||||||
- Updated README
|
- Updated README
|
||||||
- Removed check if the introductions should be shown.
|
- Removed check if the introductions should be shown.
|
||||||
|
|
3
example/.gitignore
vendored
3
example/.gitignore
vendored
|
@ -31,6 +31,9 @@ migrate_working_dir/
|
||||||
.pub/
|
.pub/
|
||||||
/build/
|
/build/
|
||||||
|
|
||||||
|
# platforms
|
||||||
|
/web
|
||||||
|
|
||||||
# Symbolication related
|
# Symbolication related
|
||||||
app.*.symbols
|
app.*.symbols
|
||||||
|
|
||||||
|
|
16
example/README.md
Normal file
16
example/README.md
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# example
|
||||||
|
|
||||||
|
A new Flutter project.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
This project is a starting point for a Flutter application.
|
||||||
|
|
||||||
|
A few resources to get you started if this is your first Flutter project:
|
||||||
|
|
||||||
|
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||||
|
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
|
||||||
|
|
||||||
|
For help getting started with Flutter development, view the
|
||||||
|
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||||
|
samples, guidance on mobile development, and a full API reference.
|
|
@ -12,10 +12,8 @@ dependencies:
|
||||||
flutter_start:
|
flutter_start:
|
||||||
path: ../
|
path: ../
|
||||||
flutter_introduction_shared_preferences:
|
flutter_introduction_shared_preferences:
|
||||||
git:
|
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub/
|
||||||
url: https://github.com/Iconica-Development/flutter_introduction
|
version: ^5.0.0
|
||||||
ref: 4.0.0
|
|
||||||
path: packages/flutter_introduction_shared_preferences
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
|
@ -19,13 +19,11 @@ class NavigatorStartUserStory extends StatelessWidget {
|
||||||
final void Function(BuildContext context) onComplete;
|
final void Function(BuildContext context) onComplete;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) => Navigator(
|
||||||
if (!configuration.showSplashScreen) {
|
onGenerateInitialRoutes: (_, __) => [
|
||||||
return _introduction(configuration, context, onComplete);
|
_getInitialRoute(configuration, onComplete),
|
||||||
}
|
],
|
||||||
|
);
|
||||||
return _splashScreen(configuration, context, onComplete);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Enter the start user story with the Navigator 1.0 API.
|
/// Enter the start user story with the Navigator 1.0 API.
|
||||||
|
@ -42,6 +40,15 @@ Future<void> startNavigatorUserStory(
|
||||||
StartUserStoryConfiguration configuration, {
|
StartUserStoryConfiguration configuration, {
|
||||||
required void Function(BuildContext context) onComplete,
|
required void Function(BuildContext context) onComplete,
|
||||||
}) async {
|
}) async {
|
||||||
|
var initialRoute = _getInitialRoute(configuration, onComplete);
|
||||||
|
|
||||||
|
await Navigator.of(context).push(initialRoute);
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialPageRoute<dynamic> _getInitialRoute(
|
||||||
|
StartUserStoryConfiguration configuration,
|
||||||
|
void Function(BuildContext context) onComplete,
|
||||||
|
) {
|
||||||
var initialRoute = MaterialPageRoute(
|
var initialRoute = MaterialPageRoute(
|
||||||
builder: (context) => _splashScreen(
|
builder: (context) => _splashScreen(
|
||||||
configuration,
|
configuration,
|
||||||
|
@ -59,8 +66,7 @@ Future<void> startNavigatorUserStory(
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
return initialRoute;
|
||||||
await Navigator.of(context).push(initialRoute);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _splashScreen(
|
Widget _splashScreen(
|
||||||
|
@ -98,28 +104,32 @@ 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,
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unawaited(splashHandler());
|
||||||
|
|
||||||
var builder = configuration.splashScreenBuilder;
|
var builder = configuration.splashScreenBuilder;
|
||||||
|
|
||||||
if (builder == null) {
|
if (builder == null) {
|
||||||
unawaited(splashHandler());
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: configuration.splashScreenBackgroundColor,
|
backgroundColor: configuration.splashScreenBackgroundColor,
|
||||||
body: Center(
|
body: Center(
|
||||||
|
|
25
pubspec.yaml
25
pubspec.yaml
|
@ -1,7 +1,8 @@
|
||||||
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"
|
version: 4.2.4
|
||||||
version: 4.2.0
|
|
||||||
|
publish_to: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.2.5 <4.0.0"
|
sdk: ">=3.2.5 <4.0.0"
|
||||||
|
@ -9,20 +10,16 @@ environment:
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ">=1.0.2 <2.0.0"
|
||||||
go_router: any
|
go_router: ">=14.2.0 <15.0.0"
|
||||||
http: any
|
http: ">=1.2.1 <2.0.0"
|
||||||
package_info_plus: any
|
package_info_plus: ">=8.0.0 <9.0.0"
|
||||||
flutter_introduction:
|
flutter_introduction:
|
||||||
git:
|
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub
|
||||||
url: https://github.com/Iconica-Development/flutter_introduction
|
version: ^5.0.0
|
||||||
ref: 4.0.0
|
|
||||||
path: packages/flutter_introduction
|
|
||||||
flutter_introduction_shared_preferences:
|
flutter_introduction_shared_preferences:
|
||||||
git:
|
hosted: https://forgejo.internal.iconica.nl/api/packages/internal/pub/
|
||||||
url: https://github.com/Iconica-Development/flutter_introduction
|
version: ^5.0.0
|
||||||
ref: 4.0.0
|
|
||||||
path: packages/flutter_introduction_shared_preferences
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
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