diff --git a/README.md b/README.md
index 7dd3563..b163788 100644
--- a/README.md
+++ b/README.md
@@ -3,28 +3,138 @@

Monorepo for the Flutter introduction package. Including the following packages:
-- Flutter Introduction
- Main package for Flutter Introduction including an example.
-- Flutter Introduction Firebase
- Package to provide content from firebase.
+- flutter_introduction:
+ Main package for Flutter Introduction including an example.
-- Flutter Introduction Interface
- Interface regarding data for the Introduction widget, like whether to show the introduction or not.
+- firebase_introduction_repository:
+ Package to provide content from firebase.
-- Flutter Introduction Service
- Service to handle actions done in the Introduction widget.
+- introduction_repository_interface:
+ Interface regarding data for the Introduction widget, like whether to show the introduction or not.
-- Flutter Introduction Shared Preferences
- Implementation of the interface with the use of shared preferences.
-
-- Flutter Introduction Widget
- The actual widget showing the Introduction widget.
+- shared_preferences_introduction_repository:
+ Package to provide content from shared preferences.
## How to use
-The simple way to use this package is by using the flutter_introduction package. An example is included if needed.
-If needed a custom implementation can be made on the interface if the shared preferences doesn't suffice.
+To use this package, add `flutter_introduction` as a dependency in your pubspec.yaml file. You can get the latest version from [here](https://github.com/Iconica-Development/flutter_introduction).
+
+```yaml
+flutter_introduction:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/flutter_introduction
+ version: latest
+```
+
+After adding the dependency to your `pubspec.yaml` you can use the widget like this:
+
+```dart
+import 'package:flutter_introduction/flutter_introduction.dart';
+
+class Introduction extends StatelessWidget {
+ const Introduction({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return IntroductionScreen(
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+ }
+}
+```
+
+The package will work with no additional configuration.
+This includes mocked data for the introduction.
+
+To style the introduction, you can use the following parameters:
+
+```dart
+IntroductionScreen(
+ translations: const IntroductionTranslations(),
+ introductionTheme: const IntroductionTheme(),
+ options: const IntroductionOptions(),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+```
+
+If you want to get the data from Firebase or Shared Preferences, you can use the following code:
+
+```yaml
+shared_preferences_introduction_repository:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/shared_preferences_introduction_repository
+ version: latest
+
+firebase_introduction_repository:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/firebase_introduction_repository
+ version: latest
+```
+
+```dart
+import 'package:firebase_introduction_repository/firebase_introduction_repository.dart';
+import 'package:shared_preferences_introduction_repository/shared_preferences_introduction_repository.dart';
+
+IntroductionScreen(
+ introductionService: IntroductionService(
+ introductionRepositoryInterface:
+ SharedPreferencesIntroductionRepository(),
+ ),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+
+// Or
+
+IntroductionScreen(
+ introductionService: IntroductionService(
+ introductionRepositoryInterface:
+ FirebaseIntroductionRepository(),
+ ),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+```
+
+Or you can create your own repository by implementing the `IntroductionRepositoryInterface`.
+
+```dart
+class IntroductionRepository implements IntroductionRepositoryInterface {
+ @override
+ Future> fetchIntroductionPages() async {
+ // Get introduction data from source
+ throw UnimplementedError();
+ }
+
+ @override
+ Future setCompleted({bool value = true}) async {
+ // Set introduction completed to true or false for the current user
+ throw UnimplementedError();
+ }
+
+ @override
+ Future shouldShow() async {
+ // Check if introduction should be shown for the current user
+ throw UnimplementedError();
+ }
+
+ @override
+ Future prefetchIntroduction() async {
+ // Prefetch introduction data. This is optional, this function doesn't get called by the introduction widget. But can be used to prefetch data to show the introduction faster or to skip the introduction faster.
+ throw UnimplementedError();
+ }
+}
+```
## Issues
@@ -36,4 +146,4 @@ If you would like to contribute to the plugin (e.g. by improving the documentati
## Author
-This `flutter_introduction` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at
\ No newline at end of file
+This `flutter_introduction` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at
diff --git a/packages/firebase_introduction_repository/README.md b/packages/firebase_introduction_repository/README.md
index 7dd3563..b163788 100644
--- a/packages/firebase_introduction_repository/README.md
+++ b/packages/firebase_introduction_repository/README.md
@@ -3,28 +3,138 @@

Monorepo for the Flutter introduction package. Including the following packages:
-- Flutter Introduction
- Main package for Flutter Introduction including an example.
-- Flutter Introduction Firebase
- Package to provide content from firebase.
+- flutter_introduction:
+ Main package for Flutter Introduction including an example.
-- Flutter Introduction Interface
- Interface regarding data for the Introduction widget, like whether to show the introduction or not.
+- firebase_introduction_repository:
+ Package to provide content from firebase.
-- Flutter Introduction Service
- Service to handle actions done in the Introduction widget.
+- introduction_repository_interface:
+ Interface regarding data for the Introduction widget, like whether to show the introduction or not.
-- Flutter Introduction Shared Preferences
- Implementation of the interface with the use of shared preferences.
-
-- Flutter Introduction Widget
- The actual widget showing the Introduction widget.
+- shared_preferences_introduction_repository:
+ Package to provide content from shared preferences.
## How to use
-The simple way to use this package is by using the flutter_introduction package. An example is included if needed.
-If needed a custom implementation can be made on the interface if the shared preferences doesn't suffice.
+To use this package, add `flutter_introduction` as a dependency in your pubspec.yaml file. You can get the latest version from [here](https://github.com/Iconica-Development/flutter_introduction).
+
+```yaml
+flutter_introduction:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/flutter_introduction
+ version: latest
+```
+
+After adding the dependency to your `pubspec.yaml` you can use the widget like this:
+
+```dart
+import 'package:flutter_introduction/flutter_introduction.dart';
+
+class Introduction extends StatelessWidget {
+ const Introduction({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return IntroductionScreen(
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+ }
+}
+```
+
+The package will work with no additional configuration.
+This includes mocked data for the introduction.
+
+To style the introduction, you can use the following parameters:
+
+```dart
+IntroductionScreen(
+ translations: const IntroductionTranslations(),
+ introductionTheme: const IntroductionTheme(),
+ options: const IntroductionOptions(),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+```
+
+If you want to get the data from Firebase or Shared Preferences, you can use the following code:
+
+```yaml
+shared_preferences_introduction_repository:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/shared_preferences_introduction_repository
+ version: latest
+
+firebase_introduction_repository:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/firebase_introduction_repository
+ version: latest
+```
+
+```dart
+import 'package:firebase_introduction_repository/firebase_introduction_repository.dart';
+import 'package:shared_preferences_introduction_repository/shared_preferences_introduction_repository.dart';
+
+IntroductionScreen(
+ introductionService: IntroductionService(
+ introductionRepositoryInterface:
+ SharedPreferencesIntroductionRepository(),
+ ),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+
+// Or
+
+IntroductionScreen(
+ introductionService: IntroductionService(
+ introductionRepositoryInterface:
+ FirebaseIntroductionRepository(),
+ ),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+```
+
+Or you can create your own repository by implementing the `IntroductionRepositoryInterface`.
+
+```dart
+class IntroductionRepository implements IntroductionRepositoryInterface {
+ @override
+ Future> fetchIntroductionPages() async {
+ // Get introduction data from source
+ throw UnimplementedError();
+ }
+
+ @override
+ Future setCompleted({bool value = true}) async {
+ // Set introduction completed to true or false for the current user
+ throw UnimplementedError();
+ }
+
+ @override
+ Future shouldShow() async {
+ // Check if introduction should be shown for the current user
+ throw UnimplementedError();
+ }
+
+ @override
+ Future prefetchIntroduction() async {
+ // Prefetch introduction data. This is optional, this function doesn't get called by the introduction widget. But can be used to prefetch data to show the introduction faster or to skip the introduction faster.
+ throw UnimplementedError();
+ }
+}
+```
## Issues
@@ -36,4 +146,4 @@ If you would like to contribute to the plugin (e.g. by improving the documentati
## Author
-This `flutter_introduction` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at
\ No newline at end of file
+This `flutter_introduction` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at
diff --git a/packages/firebase_introduction_repository/pubspec.yaml b/packages/firebase_introduction_repository/pubspec.yaml
index 7b8d801..a72f7fd 100644
--- a/packages/firebase_introduction_repository/pubspec.yaml
+++ b/packages/firebase_introduction_repository/pubspec.yaml
@@ -1,6 +1,6 @@
name: firebase_introduction_repository
-description: "A new Flutter package project."
-version: 0.0.1
+description: "Firebase implementation of the introduction repository interface"
+version: 6.0.0
publish_to: none
environment:
diff --git a/packages/flutter_introduction/README.md b/packages/flutter_introduction/README.md
index 7dd3563..b163788 100644
--- a/packages/flutter_introduction/README.md
+++ b/packages/flutter_introduction/README.md
@@ -3,28 +3,138 @@

Monorepo for the Flutter introduction package. Including the following packages:
-- Flutter Introduction
- Main package for Flutter Introduction including an example.
-- Flutter Introduction Firebase
- Package to provide content from firebase.
+- flutter_introduction:
+ Main package for Flutter Introduction including an example.
-- Flutter Introduction Interface
- Interface regarding data for the Introduction widget, like whether to show the introduction or not.
+- firebase_introduction_repository:
+ Package to provide content from firebase.
-- Flutter Introduction Service
- Service to handle actions done in the Introduction widget.
+- introduction_repository_interface:
+ Interface regarding data for the Introduction widget, like whether to show the introduction or not.
-- Flutter Introduction Shared Preferences
- Implementation of the interface with the use of shared preferences.
-
-- Flutter Introduction Widget
- The actual widget showing the Introduction widget.
+- shared_preferences_introduction_repository:
+ Package to provide content from shared preferences.
## How to use
-The simple way to use this package is by using the flutter_introduction package. An example is included if needed.
-If needed a custom implementation can be made on the interface if the shared preferences doesn't suffice.
+To use this package, add `flutter_introduction` as a dependency in your pubspec.yaml file. You can get the latest version from [here](https://github.com/Iconica-Development/flutter_introduction).
+
+```yaml
+flutter_introduction:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/flutter_introduction
+ version: latest
+```
+
+After adding the dependency to your `pubspec.yaml` you can use the widget like this:
+
+```dart
+import 'package:flutter_introduction/flutter_introduction.dart';
+
+class Introduction extends StatelessWidget {
+ const Introduction({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return IntroductionScreen(
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+ }
+}
+```
+
+The package will work with no additional configuration.
+This includes mocked data for the introduction.
+
+To style the introduction, you can use the following parameters:
+
+```dart
+IntroductionScreen(
+ translations: const IntroductionTranslations(),
+ introductionTheme: const IntroductionTheme(),
+ options: const IntroductionOptions(),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+```
+
+If you want to get the data from Firebase or Shared Preferences, you can use the following code:
+
+```yaml
+shared_preferences_introduction_repository:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/shared_preferences_introduction_repository
+ version: latest
+
+firebase_introduction_repository:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/firebase_introduction_repository
+ version: latest
+```
+
+```dart
+import 'package:firebase_introduction_repository/firebase_introduction_repository.dart';
+import 'package:shared_preferences_introduction_repository/shared_preferences_introduction_repository.dart';
+
+IntroductionScreen(
+ introductionService: IntroductionService(
+ introductionRepositoryInterface:
+ SharedPreferencesIntroductionRepository(),
+ ),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+
+// Or
+
+IntroductionScreen(
+ introductionService: IntroductionService(
+ introductionRepositoryInterface:
+ FirebaseIntroductionRepository(),
+ ),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+```
+
+Or you can create your own repository by implementing the `IntroductionRepositoryInterface`.
+
+```dart
+class IntroductionRepository implements IntroductionRepositoryInterface {
+ @override
+ Future> fetchIntroductionPages() async {
+ // Get introduction data from source
+ throw UnimplementedError();
+ }
+
+ @override
+ Future setCompleted({bool value = true}) async {
+ // Set introduction completed to true or false for the current user
+ throw UnimplementedError();
+ }
+
+ @override
+ Future shouldShow() async {
+ // Check if introduction should be shown for the current user
+ throw UnimplementedError();
+ }
+
+ @override
+ Future prefetchIntroduction() async {
+ // Prefetch introduction data. This is optional, this function doesn't get called by the introduction widget. But can be used to prefetch data to show the introduction faster or to skip the introduction faster.
+ throw UnimplementedError();
+ }
+}
+```
## Issues
@@ -36,4 +146,4 @@ If you would like to contribute to the plugin (e.g. by improving the documentati
## Author
-This `flutter_introduction` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at
\ No newline at end of file
+This `flutter_introduction` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at
diff --git a/packages/flutter_introduction/example/README.md b/packages/flutter_introduction/example/README.md
deleted file mode 100644
index 2b3fce4..0000000
--- a/packages/flutter_introduction/example/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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.
diff --git a/packages/flutter_introduction/example/ios/Podfile.lock b/packages/flutter_introduction/example/ios/Podfile.lock
index 9ff64a9..a16608d 100644
--- a/packages/flutter_introduction/example/ios/Podfile.lock
+++ b/packages/flutter_introduction/example/ios/Podfile.lock
@@ -1,22 +1,15 @@
PODS:
- Flutter (1.0.0)
- - shared_preferences_foundation (0.0.1):
- - Flutter
- - FlutterMacOS
DEPENDENCIES:
- Flutter (from `Flutter`)
- - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
EXTERNAL SOURCES:
Flutter:
:path: Flutter
- shared_preferences_foundation:
- :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
- shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796
diff --git a/packages/flutter_introduction/example/ios/Runner.xcodeproj/project.pbxproj b/packages/flutter_introduction/example/ios/Runner.xcodeproj/project.pbxproj
index d92869a..c72d1f0 100644
--- a/packages/flutter_introduction/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/packages/flutter_introduction/example/ios/Runner.xcodeproj/project.pbxproj
@@ -198,7 +198,6 @@
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
- AAD28D6AADDD0350DB09B76E /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -301,23 +300,6 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
- AAD28D6AADDD0350DB09B76E /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
- );
- name = "[CP] Embed Pods Frameworks";
- outputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
B46DFC93FEEE82B438CEFD5D /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
diff --git a/packages/flutter_introduction/example/lib/main.dart b/packages/flutter_introduction/example/lib/main.dart
index b51e124..d29f1ac 100644
--- a/packages/flutter_introduction/example/lib/main.dart
+++ b/packages/flutter_introduction/example/lib/main.dart
@@ -24,8 +24,8 @@ class Introduction extends StatelessWidget {
@override
Widget build(BuildContext context) {
return IntroductionScreen(
- onDone: () {
- debugPrint("done");
+ onDone: (context) {
+ // Do what you want
},
);
}
diff --git a/packages/flutter_introduction/example/pubspec.yaml b/packages/flutter_introduction/example/pubspec.yaml
index ab19276..db59be4 100644
--- a/packages/flutter_introduction/example/pubspec.yaml
+++ b/packages/flutter_introduction/example/pubspec.yaml
@@ -13,8 +13,6 @@ dependencies:
sdk: flutter
flutter_introduction:
path: ../
- shared_preferences_introduction_repository:
- path: ../../shared_preferences_introduction_repository
dev_dependencies:
flutter_lints: ^4.0.0
diff --git a/packages/flutter_introduction/lib/src/screens/introduction_screen.dart b/packages/flutter_introduction/lib/src/screens/introduction_screen.dart
index b3ff1c3..6233ead 100644
--- a/packages/flutter_introduction/lib/src/screens/introduction_screen.dart
+++ b/packages/flutter_introduction/lib/src/screens/introduction_screen.dart
@@ -26,7 +26,7 @@ class IntroductionScreen extends StatefulWidget {
final IntroductionOptions options;
final IntroductionTranslations translations;
final IntroductionTheme introductionTheme;
- final Function() onDone;
+ final Function(BuildContext context) onDone;
@override
State createState() => _IntroductionScreenState();
@@ -54,8 +54,8 @@ class _IntroductionScreenState extends State {
IntroductionScreenMode.showNever) {
shouldShow = false;
}
- if (!shouldShow!) {
- await widget.onDone();
+ if (!shouldShow! && mounted) {
+ await widget.onDone.call(context);
}
}
@@ -105,9 +105,12 @@ class _IntroductionScreenState extends State {
options: widget.options,
translations: widget.translations,
introductionTheme: widget.introductionTheme,
- onDone: () async {
+ onDone: (context) async {
await introductionService?.setCompleted();
- await widget.onDone();
+ if (mounted) {
+ // ignore: use_build_context_synchronously
+ await widget.onDone.call(context);
+ }
},
);
},
@@ -128,7 +131,7 @@ class _IntroductionScreen extends StatefulWidget {
final IntroductionOptions options;
final IntroductionTranslations translations;
final List pages;
- final Function() onDone;
+ final Function(BuildContext context) onDone;
final IntroductionTheme introductionTheme;
@override
@@ -265,7 +268,7 @@ class __IntroductionScreenState extends State<_IntroductionScreen> {
showButton: true,
text: widget.translations.doneButton,
onPressed: () async {
- widget.onDone();
+ await widget.onDone(context);
},
),
],
diff --git a/packages/introduction_repository_interface/README.md b/packages/introduction_repository_interface/README.md
index 7dd3563..b163788 100644
--- a/packages/introduction_repository_interface/README.md
+++ b/packages/introduction_repository_interface/README.md
@@ -3,28 +3,138 @@

Monorepo for the Flutter introduction package. Including the following packages:
-- Flutter Introduction
- Main package for Flutter Introduction including an example.
-- Flutter Introduction Firebase
- Package to provide content from firebase.
+- flutter_introduction:
+ Main package for Flutter Introduction including an example.
-- Flutter Introduction Interface
- Interface regarding data for the Introduction widget, like whether to show the introduction or not.
+- firebase_introduction_repository:
+ Package to provide content from firebase.
-- Flutter Introduction Service
- Service to handle actions done in the Introduction widget.
+- introduction_repository_interface:
+ Interface regarding data for the Introduction widget, like whether to show the introduction or not.
-- Flutter Introduction Shared Preferences
- Implementation of the interface with the use of shared preferences.
-
-- Flutter Introduction Widget
- The actual widget showing the Introduction widget.
+- shared_preferences_introduction_repository:
+ Package to provide content from shared preferences.
## How to use
-The simple way to use this package is by using the flutter_introduction package. An example is included if needed.
-If needed a custom implementation can be made on the interface if the shared preferences doesn't suffice.
+To use this package, add `flutter_introduction` as a dependency in your pubspec.yaml file. You can get the latest version from [here](https://github.com/Iconica-Development/flutter_introduction).
+
+```yaml
+flutter_introduction:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/flutter_introduction
+ version: latest
+```
+
+After adding the dependency to your `pubspec.yaml` you can use the widget like this:
+
+```dart
+import 'package:flutter_introduction/flutter_introduction.dart';
+
+class Introduction extends StatelessWidget {
+ const Introduction({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return IntroductionScreen(
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+ }
+}
+```
+
+The package will work with no additional configuration.
+This includes mocked data for the introduction.
+
+To style the introduction, you can use the following parameters:
+
+```dart
+IntroductionScreen(
+ translations: const IntroductionTranslations(),
+ introductionTheme: const IntroductionTheme(),
+ options: const IntroductionOptions(),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+```
+
+If you want to get the data from Firebase or Shared Preferences, you can use the following code:
+
+```yaml
+shared_preferences_introduction_repository:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/shared_preferences_introduction_repository
+ version: latest
+
+firebase_introduction_repository:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/firebase_introduction_repository
+ version: latest
+```
+
+```dart
+import 'package:firebase_introduction_repository/firebase_introduction_repository.dart';
+import 'package:shared_preferences_introduction_repository/shared_preferences_introduction_repository.dart';
+
+IntroductionScreen(
+ introductionService: IntroductionService(
+ introductionRepositoryInterface:
+ SharedPreferencesIntroductionRepository(),
+ ),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+
+// Or
+
+IntroductionScreen(
+ introductionService: IntroductionService(
+ introductionRepositoryInterface:
+ FirebaseIntroductionRepository(),
+ ),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+```
+
+Or you can create your own repository by implementing the `IntroductionRepositoryInterface`.
+
+```dart
+class IntroductionRepository implements IntroductionRepositoryInterface {
+ @override
+ Future> fetchIntroductionPages() async {
+ // Get introduction data from source
+ throw UnimplementedError();
+ }
+
+ @override
+ Future setCompleted({bool value = true}) async {
+ // Set introduction completed to true or false for the current user
+ throw UnimplementedError();
+ }
+
+ @override
+ Future shouldShow() async {
+ // Check if introduction should be shown for the current user
+ throw UnimplementedError();
+ }
+
+ @override
+ Future prefetchIntroduction() async {
+ // Prefetch introduction data. This is optional, this function doesn't get called by the introduction widget. But can be used to prefetch data to show the introduction faster or to skip the introduction faster.
+ throw UnimplementedError();
+ }
+}
+```
## Issues
@@ -36,4 +146,4 @@ If you would like to contribute to the plugin (e.g. by improving the documentati
## Author
-This `flutter_introduction` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at
\ No newline at end of file
+This `flutter_introduction` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at
diff --git a/packages/introduction_repository_interface/lib/src/services/introduction_service.dart b/packages/introduction_repository_interface/lib/src/services/introduction_service.dart
index b8a87d2..2f827c3 100644
--- a/packages/introduction_repository_interface/lib/src/services/introduction_service.dart
+++ b/packages/introduction_repository_interface/lib/src/services/introduction_service.dart
@@ -1,7 +1,7 @@
import "package:introduction_repository_interface/introduction_repository_interface.dart";
class IntroductionService {
- IntroductionService({
+ const IntroductionService({
IntroductionRepositoryInterface? introductionRepositoryInterface,
}) : introductionRepositoryInterface =
introductionRepositoryInterface ?? LocalIntroductionRepository();
diff --git a/packages/shared_preferences_introduction_repository/.flutter-plugins-dependencies b/packages/shared_preferences_introduction_repository/.flutter-plugins-dependencies
index ffde978..91bb986 100644
--- a/packages/shared_preferences_introduction_repository/.flutter-plugins-dependencies
+++ b/packages/shared_preferences_introduction_repository/.flutter-plugins-dependencies
@@ -1 +1 @@
-{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_foundation","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences_android","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.5/","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_foundation","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2025-02-18 10:39:03.115183","version":"3.24.3","swift_package_manager_enabled":false}
\ No newline at end of file
+{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_foundation","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences_android","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.5/","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_foundation","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"/Users/mikedoornenbal/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2025-02-19 13:37:27.288826","version":"3.24.3","swift_package_manager_enabled":false}
\ No newline at end of file
diff --git a/packages/shared_preferences_introduction_repository/README.md b/packages/shared_preferences_introduction_repository/README.md
index 7dd3563..b163788 100644
--- a/packages/shared_preferences_introduction_repository/README.md
+++ b/packages/shared_preferences_introduction_repository/README.md
@@ -3,28 +3,138 @@

Monorepo for the Flutter introduction package. Including the following packages:
-- Flutter Introduction
- Main package for Flutter Introduction including an example.
-- Flutter Introduction Firebase
- Package to provide content from firebase.
+- flutter_introduction:
+ Main package for Flutter Introduction including an example.
-- Flutter Introduction Interface
- Interface regarding data for the Introduction widget, like whether to show the introduction or not.
+- firebase_introduction_repository:
+ Package to provide content from firebase.
-- Flutter Introduction Service
- Service to handle actions done in the Introduction widget.
+- introduction_repository_interface:
+ Interface regarding data for the Introduction widget, like whether to show the introduction or not.
-- Flutter Introduction Shared Preferences
- Implementation of the interface with the use of shared preferences.
-
-- Flutter Introduction Widget
- The actual widget showing the Introduction widget.
+- shared_preferences_introduction_repository:
+ Package to provide content from shared preferences.
## How to use
-The simple way to use this package is by using the flutter_introduction package. An example is included if needed.
-If needed a custom implementation can be made on the interface if the shared preferences doesn't suffice.
+To use this package, add `flutter_introduction` as a dependency in your pubspec.yaml file. You can get the latest version from [here](https://github.com/Iconica-Development/flutter_introduction).
+
+```yaml
+flutter_introduction:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/flutter_introduction
+ version: latest
+```
+
+After adding the dependency to your `pubspec.yaml` you can use the widget like this:
+
+```dart
+import 'package:flutter_introduction/flutter_introduction.dart';
+
+class Introduction extends StatelessWidget {
+ const Introduction({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return IntroductionScreen(
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+ }
+}
+```
+
+The package will work with no additional configuration.
+This includes mocked data for the introduction.
+
+To style the introduction, you can use the following parameters:
+
+```dart
+IntroductionScreen(
+ translations: const IntroductionTranslations(),
+ introductionTheme: const IntroductionTheme(),
+ options: const IntroductionOptions(),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+```
+
+If you want to get the data from Firebase or Shared Preferences, you can use the following code:
+
+```yaml
+shared_preferences_introduction_repository:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/shared_preferences_introduction_repository
+ version: latest
+
+firebase_introduction_repository:
+ git:
+ url: https://github.com/Iconica-Development/flutter_introduction
+ path: packages/firebase_introduction_repository
+ version: latest
+```
+
+```dart
+import 'package:firebase_introduction_repository/firebase_introduction_repository.dart';
+import 'package:shared_preferences_introduction_repository/shared_preferences_introduction_repository.dart';
+
+IntroductionScreen(
+ introductionService: IntroductionService(
+ introductionRepositoryInterface:
+ SharedPreferencesIntroductionRepository(),
+ ),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+
+// Or
+
+IntroductionScreen(
+ introductionService: IntroductionService(
+ introductionRepositoryInterface:
+ FirebaseIntroductionRepository(),
+ ),
+ onDone: (context) {
+ // Do what you want
+ },
+ );
+```
+
+Or you can create your own repository by implementing the `IntroductionRepositoryInterface`.
+
+```dart
+class IntroductionRepository implements IntroductionRepositoryInterface {
+ @override
+ Future> fetchIntroductionPages() async {
+ // Get introduction data from source
+ throw UnimplementedError();
+ }
+
+ @override
+ Future setCompleted({bool value = true}) async {
+ // Set introduction completed to true or false for the current user
+ throw UnimplementedError();
+ }
+
+ @override
+ Future shouldShow() async {
+ // Check if introduction should be shown for the current user
+ throw UnimplementedError();
+ }
+
+ @override
+ Future prefetchIntroduction() async {
+ // Prefetch introduction data. This is optional, this function doesn't get called by the introduction widget. But can be used to prefetch data to show the introduction faster or to skip the introduction faster.
+ throw UnimplementedError();
+ }
+}
+```
## Issues
@@ -36,4 +146,4 @@ If you would like to contribute to the plugin (e.g. by improving the documentati
## Author
-This `flutter_introduction` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at
\ No newline at end of file
+This `flutter_introduction` for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at
diff --git a/packages/shared_preferences_introduction_repository/pubspec.yaml b/packages/shared_preferences_introduction_repository/pubspec.yaml
index 6a17673..c4d6db5 100644
--- a/packages/shared_preferences_introduction_repository/pubspec.yaml
+++ b/packages/shared_preferences_introduction_repository/pubspec.yaml
@@ -1,6 +1,6 @@
name: shared_preferences_introduction_repository
-description: "A new Flutter package project."
-version: 0.0.1
+description: "Shared_preference implementation of the introduction repository interface"
+version: 6.0.0
publish_to: none
environment:
diff --git a/pubspec.yaml b/pubspec.yaml
index b6eba81..4f87274 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: flutter_introduction_workspace
description: The use case level package using both the flutter_introduction_widget and the flutter_introduction_service combined
-version: 5.0.0
+version: 6.0.0
publish_to: None