Merge pull request #5 from Iconica-Development/2.1.0

This commit is contained in:
Gorter-dev 2024-01-30 17:31:52 +01:00 committed by GitHub
commit 1a342403f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 147 additions and 62 deletions

View file

@ -1,3 +1,8 @@
## 2.1.0
* Upgrade dependencies
* Add introductionButtonTextstyles option to IntroductionOptions for styling the introduction button text
## 2.0.0
* Initial release of working flutter_introduction mono project.

View file

@ -20,6 +20,9 @@ scripts:
upgrade:
run: melos exec -c 1 -- "flutter pub upgrade"
upgrade-major:
run: melos exec -c 1 -- "flutter pub upgrade --major-versions"
create:
# run create in the example folder of flutter_introduction, flutter_introduction_firebase
run: melos exec --scope="*example*" -c 1 -- "flutter create ."

View file

@ -17,15 +17,11 @@ dependencies:
flutter_introduction:
path: ../
flutter_introduction_shared_preferences:
git:
url: https://github.com/Iconica-Development/flutter_introduction
ref: 2.0.0
path: packages/flutter_introduction_shared_preferences
path: ../../flutter_introduction_shared_preferences
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter_iconica_analysis:
git:
url: https://github.com/Iconica-Development/flutter_iconica_analysis

View file

@ -1,6 +1,6 @@
name: flutter_introduction
description: Combined Package of Flutter Introduction Widget and Flutter Introduction Service
version: 2.0.0
version: 2.1.0
publish_to: none
environment:
@ -13,18 +13,17 @@ dependencies:
flutter_introduction_widget:
git:
url: https://github.com/Iconica-Development/flutter_introduction
ref: 2.0.0
ref: 2.1.0
path: packages/flutter_introduction_widget
flutter_introduction_service:
git:
url: https://github.com/Iconica-Development/flutter_introduction
ref: 2.0.0
ref: 2.1.0
path: packages/flutter_introduction_service
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter_iconica_analysis:
git:
url: https://github.com/Iconica-Development/flutter_iconica_analysis

View file

@ -1,6 +1,6 @@
name: flutter_introduction_firebase
description: Flutter Introduction Page that uses firebase for the pages and some settings
version: 2.0.0
version: 2.1.0
publish_to: none
environment:
@ -15,12 +15,12 @@ dependencies:
flutter_introduction_widget:
git:
url: https://github.com/Iconica-Development/flutter_introduction
ref: 2.0.0
ref: 2.1.0
path: packages/flutter_introduction_widget
flutter_introduction_service:
git:
url: https://github.com/Iconica-Development/flutter_introduction
ref: 2.0.0
ref: 2.1.0
path: packages/flutter_introduction_service
dev_dependencies:

View file

@ -1,6 +1,6 @@
name: flutter_introduction_interface
description: A new Flutter package project.
version: 2.0.0
version: 2.1.0
publish_to: none
environment:
@ -18,7 +18,6 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter_iconica_analysis:
git:
url: https://github.com/Iconica-Development/flutter_iconica_analysis

View file

@ -1,6 +1,6 @@
name: flutter_introduction_service
description: A new Flutter package project.
version: 2.0.0
version: 2.1.0
publish_to: none
environment:
@ -13,13 +13,12 @@ dependencies:
flutter_introduction_interface:
git:
url: https://github.com/Iconica-Development/flutter_introduction
ref: 2.0.0
ref: 2.1.0
path: packages/flutter_introduction_interface
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter_iconica_analysis:
git:
url: https://github.com/Iconica-Development/flutter_iconica_analysis

View file

@ -1,6 +1,6 @@
name: flutter_introduction_shared_preferences
description: A new Flutter package project.
version: 2.0.0
version: 2.1.0
publish_to: none
environment:
@ -13,14 +13,13 @@ dependencies:
flutter_introduction_interface:
git:
url: https://github.com/Iconica-Development/flutter_introduction
ref: 2.0.0
ref: 2.1.0
path: packages/flutter_introduction_interface
shared_preferences: any
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter_iconica_analysis:
git:
url: https://github.com/Iconica-Development/flutter_iconica_analysis

View file

@ -18,7 +18,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter_lints: ^3.0.1
flutter:

View file

@ -59,6 +59,7 @@ class IntroductionPage {
class IntroductionOptions {
const IntroductionOptions({
this.introductionTranslations = const IntroductionTranslations(),
this.introductionButtonTextstyles = const IntroductionButtonTextstyles(),
this.indicatorMode = IndicatorMode.dash,
this.indicatorBuilder,
this.layoutStyle = IntroductionLayoutStyle.imageCenter,
@ -192,6 +193,16 @@ class IntroductionOptions {
/// - Finish
final IntroductionTranslations introductionTranslations;
/// The textstyles for all buttons on the introductionpages
///
/// See [IntroductionButtonTextstyles] for more information
/// The following buttons have a textstyle:
/// - Skip
/// - Next
/// - Previous
/// - Finish
final IntroductionButtonTextstyles introductionButtonTextstyles;
IntroductionOptions copyWith({
IntroductionScreenMode? mode,
List<IntroductionPage>? pages,
@ -212,6 +223,7 @@ class IntroductionOptions {
Widget Function(BuildContext, VoidCallback, Widget, IntroductionButtonType)?
buttonBuilder,
IntroductionTranslations? introductionTranslations,
IntroductionButtonTextstyles? introductionButtonTextstyles,
}) =>
IntroductionOptions(
mode: mode ?? this.mode,
@ -228,10 +240,11 @@ class IntroductionOptions {
buttonBuilder: buttonBuilder ?? this.buttonBuilder,
introductionTranslations:
introductionTranslations ?? this.introductionTranslations,
introductionButtonTextstyles:
introductionButtonTextstyles ?? this.introductionButtonTextstyles,
);
}
///
class IntroductionTranslations {
const IntroductionTranslations({
this.skipButton = 'skip',
@ -244,3 +257,16 @@ class IntroductionTranslations {
final String previousButton;
final String finishButton;
}
class IntroductionButtonTextstyles {
const IntroductionButtonTextstyles({
this.skipButtonStyle,
this.nextButtonStyle,
this.previousButtonStyle,
this.finishButtonStyle,
});
final TextStyle? skipButtonStyle;
final TextStyle? nextButtonStyle;
final TextStyle? previousButtonStyle;
final TextStyle? finishButtonStyle;
}

View file

@ -326,12 +326,20 @@ class IntroductionTwoButtons extends StatelessWidget {
options.buttonBuilder?.call(
context,
_previous,
Text(translations.previousButton),
Text(
translations.previousButton,
style: options
.introductionButtonTextstyles.previousButtonStyle,
),
IntroductionButtonType.previous,
) ??
TextButton(
onPressed: _previous,
child: Text(translations.previousButton),
child: Text(
translations.previousButton,
style: options
.introductionButtonTextstyles.previousButtonStyle,
),
),
] else
const SizedBox.shrink(),
@ -339,12 +347,18 @@ class IntroductionTwoButtons extends StatelessWidget {
options.buttonBuilder?.call(
context,
_next,
Text(translations.nextButton),
Text(
translations.nextButton,
style: options.introductionButtonTextstyles.nextButtonStyle,
),
IntroductionButtonType.next,
) ??
TextButton(
onPressed: _next,
child: Text(translations.nextButton),
child: Text(
translations.nextButton,
style: options.introductionButtonTextstyles.nextButtonStyle,
),
),
] else if (last) ...[
options.buttonBuilder?.call(
@ -352,14 +366,22 @@ class IntroductionTwoButtons extends StatelessWidget {
() {
onFinish?.call();
},
Text(translations.finishButton),
Text(
translations.finishButton,
style:
options.introductionButtonTextstyles.finishButtonStyle,
),
IntroductionButtonType.finish,
) ??
TextButton(
onPressed: () {
onFinish?.call();
},
child: Text(translations.finishButton),
child: Text(
translations.finishButton,
style:
options.introductionButtonTextstyles.finishButtonStyle,
),
),
] else ...[
const SizedBox.shrink(),
@ -379,14 +401,22 @@ class IntroductionTwoButtons extends StatelessWidget {
() {
onFinish?.call();
},
Text(translations.finishButton),
Text(
translations.finishButton,
style: options
.introductionButtonTextstyles.finishButtonStyle,
),
IntroductionButtonType.finish,
) ??
ElevatedButton(
onPressed: () {
onFinish?.call();
},
child: Text(translations.finishButton),
child: Text(
translations.finishButton,
style: options
.introductionButtonTextstyles.finishButtonStyle,
),
),
),
),
@ -450,37 +480,59 @@ class IntroductionOneButton extends StatelessWidget {
() {
onFinish?.call();
},
Text(translations.finishButton),
Text(
translations.finishButton,
style:
options.introductionButtonTextstyles.finishButtonStyle,
),
IntroductionButtonType.finish,
) ??
TextButton(
onPressed: () {
onFinish?.call();
},
child: Text(translations.finishButton),
child: Text(
translations.finishButton,
style:
options.introductionButtonTextstyles.finishButtonStyle,
),
),
] else ...[
options.buttonBuilder?.call(
context,
_next,
Text(translations.nextButton),
Text(
translations.nextButton,
style: options.introductionButtonTextstyles.nextButtonStyle,
),
IntroductionButtonType.next,
) ??
TextButton(
onPressed: _next,
child: Text(translations.nextButton),
child: Text(
translations.nextButton,
style: options.introductionButtonTextstyles.nextButtonStyle,
),
),
],
if (previous) ...[
options.buttonBuilder?.call(
context,
_previous,
Text(translations.previousButton),
Text(
translations.previousButton,
style: options
.introductionButtonTextstyles.previousButtonStyle,
),
IntroductionButtonType.previous,
) ??
TextButton(
onPressed: _previous,
child: Text(translations.previousButton),
child: Text(
translations.previousButton,
style: options
.introductionButtonTextstyles.previousButtonStyle,
),
),
] else ...[
options.buttonBuilder?.call(
@ -488,14 +540,22 @@ class IntroductionOneButton extends StatelessWidget {
() {
onFinish?.call();
},
Text(translations.finishButton),
Text(
translations.finishButton,
style:
options.introductionButtonTextstyles.finishButtonStyle,
),
IntroductionButtonType.skip,
) ??
TextButton(
onPressed: () {
onFinish?.call();
},
child: Text(translations.finishButton),
child: Text(
translations.finishButton,
style:
options.introductionButtonTextstyles.finishButtonStyle,
),
),
],
],

View file

@ -1,6 +1,6 @@
name: flutter_introduction_widget
description: Flutter Introduction Widget for showing a list of introduction pages on a single scrollable page or horizontal pageview
version: 2.0.0
version: 2.1.0
homepage: https://github.com/Iconica-Development/flutter_introduction_widget
environment:
@ -14,7 +14,6 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter_iconica_analysis:
git:
url: https://github.com/Iconica-Development/flutter_iconica_analysis

View file

@ -1,5 +1,5 @@
name: flutter_introduction_workspace
version: 2.0.0
version: 2.1.0
environment:
sdk: '>=3.1.0 <4.0.0'