diff --git a/CHANGELOG.md b/CHANGELOG.md index 97f796f..1edcec8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 3.0.0 + +* Update default styling +* Add default introduction + ## 2.1.0 * Upgrade dependencies diff --git a/packages/flutter_introduction/example/lib/main.dart b/packages/flutter_introduction/example/lib/main.dart index 8eef932..2edeb60 100644 --- a/packages/flutter_introduction/example/lib/main.dart +++ b/packages/flutter_introduction/example/lib/main.dart @@ -39,20 +39,20 @@ class _MyHomePageState extends State { body: Introduction( options: IntroductionOptions( pages: [ - IntroductionPage( - title: const Text('First page'), - text: const Text('Wow a page'), - graphic: const FlutterLogo(), + const IntroductionPage( + title: Text('First page'), + text: Text('Wow a page'), + graphic: FlutterLogo(), ), - IntroductionPage( - title: const Text('Second page'), - text: const Text('Another page'), - graphic: const FlutterLogo(), + const IntroductionPage( + title: Text('Second page'), + text: Text('Another page'), + graphic: FlutterLogo(), ), - IntroductionPage( - title: const Text('Third page'), - text: const Text('The final page of this app'), - graphic: const FlutterLogo(), + const IntroductionPage( + title: Text('Third page'), + text: Text('The final page of this app'), + graphic: FlutterLogo(), ), ], introductionTranslations: const IntroductionTranslations( diff --git a/packages/flutter_introduction/pubspec.yaml b/packages/flutter_introduction/pubspec.yaml index 7237226..b2a5053 100644 --- a/packages/flutter_introduction/pubspec.yaml +++ b/packages/flutter_introduction/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_introduction description: Combined Package of Flutter Introduction Widget and Flutter Introduction Service -version: 2.1.0 +version: 3.0.0 publish_to: none environment: @@ -13,12 +13,12 @@ dependencies: flutter_introduction_widget: git: url: https://github.com/Iconica-Development/flutter_introduction - ref: 2.1.0 + ref: 3.0.0 path: packages/flutter_introduction_widget flutter_introduction_service: git: url: https://github.com/Iconica-Development/flutter_introduction - ref: 2.1.0 + ref: 3.0.0 path: packages/flutter_introduction_service dev_dependencies: diff --git a/packages/flutter_introduction_firebase/pubspec.yaml b/packages/flutter_introduction_firebase/pubspec.yaml index cd4b126..e55dd08 100644 --- a/packages/flutter_introduction_firebase/pubspec.yaml +++ b/packages/flutter_introduction_firebase/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_introduction_firebase description: Flutter Introduction Page that uses firebase for the pages and some settings -version: 2.1.0 +version: 3.0.0 publish_to: none environment: @@ -15,12 +15,12 @@ dependencies: flutter_introduction_widget: git: url: https://github.com/Iconica-Development/flutter_introduction - ref: 2.1.0 + ref: 3.0.0 path: packages/flutter_introduction_widget flutter_introduction_service: git: url: https://github.com/Iconica-Development/flutter_introduction - ref: 2.1.0 + ref: 3.0.0 path: packages/flutter_introduction_service dev_dependencies: diff --git a/packages/flutter_introduction_interface/pubspec.yaml b/packages/flutter_introduction_interface/pubspec.yaml index 645fd0c..b331169 100644 --- a/packages/flutter_introduction_interface/pubspec.yaml +++ b/packages/flutter_introduction_interface/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_introduction_interface description: A new Flutter package project. -version: 2.1.0 +version: 3.0.0 publish_to: none environment: diff --git a/packages/flutter_introduction_service/pubspec.yaml b/packages/flutter_introduction_service/pubspec.yaml index 8376320..cfb2e99 100644 --- a/packages/flutter_introduction_service/pubspec.yaml +++ b/packages/flutter_introduction_service/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_introduction_service description: A new Flutter package project. -version: 2.1.0 +version: 3.0.0 publish_to: none environment: @@ -13,7 +13,7 @@ dependencies: flutter_introduction_interface: git: url: https://github.com/Iconica-Development/flutter_introduction - ref: 2.1.0 + ref: 3.0.0 path: packages/flutter_introduction_interface dev_dependencies: diff --git a/packages/flutter_introduction_shared_preferences/pubspec.yaml b/packages/flutter_introduction_shared_preferences/pubspec.yaml index 04741d2..229c931 100644 --- a/packages/flutter_introduction_shared_preferences/pubspec.yaml +++ b/packages/flutter_introduction_shared_preferences/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_introduction_shared_preferences description: A new Flutter package project. -version: 2.1.0 +version: 3.0.0 publish_to: none environment: @@ -13,7 +13,7 @@ dependencies: flutter_introduction_interface: git: url: https://github.com/Iconica-Development/flutter_introduction - ref: 2.1.0 + ref: 3.0.0 path: packages/flutter_introduction_interface shared_preferences: any diff --git a/packages/flutter_introduction_widget/assets/first.png b/packages/flutter_introduction_widget/assets/first.png new file mode 100644 index 0000000..e2283e4 Binary files /dev/null and b/packages/flutter_introduction_widget/assets/first.png differ diff --git a/packages/flutter_introduction_widget/assets/second.png b/packages/flutter_introduction_widget/assets/second.png new file mode 100644 index 0000000..a3dc5f4 Binary files /dev/null and b/packages/flutter_introduction_widget/assets/second.png differ diff --git a/packages/flutter_introduction_widget/assets/third.png b/packages/flutter_introduction_widget/assets/third.png new file mode 100644 index 0000000..f67e47c Binary files /dev/null and b/packages/flutter_introduction_widget/assets/third.png differ diff --git a/packages/flutter_introduction_widget/example/lib/main.dart b/packages/flutter_introduction_widget/example/lib/main.dart index 035ce15..cc9cbb2 100644 --- a/packages/flutter_introduction_widget/example/lib/main.dart +++ b/packages/flutter_introduction_widget/example/lib/main.dart @@ -32,29 +32,29 @@ class MyApp extends StatelessWidget { home: IntroductionScreen( options: IntroductionOptions( pages: [ - IntroductionPage( - title: const Text('Basic Page'), - text: const Text( + const IntroductionPage( + title: Text('Basic Page'), + text: Text( 'A page with some text and a widget in the middle.', ), - graphic: const FlutterLogo(size: 100), + graphic: FlutterLogo(size: 100), ), - IntroductionPage( - title: const Text('Layout Shift'), - text: const Text( + const IntroductionPage( + title: Text('Layout Shift'), + text: Text( 'You can change the layout of a page to mix things up.', ), - graphic: const FlutterLogo(size: 100), + graphic: FlutterLogo(size: 100), layoutStyle: IntroductionLayoutStyle.imageTop, ), - IntroductionPage( - title: const Text( + const IntroductionPage( + title: Text( 'Decoration', style: TextStyle( color: Colors.white, ), ), - decoration: const BoxDecoration( + decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topRight, end: Alignment.bottomLeft, @@ -66,24 +66,24 @@ class MyApp extends StatelessWidget { ], ), ), - text: const Text( + text: Text( 'Add a Decoration to make a custom background, like a LinearGradient', style: TextStyle( color: Colors.white, ), ), - graphic: const FlutterLogo( + graphic: FlutterLogo( size: 100, ), ), - IntroductionPage( - title: const Text( + const IntroductionPage( + title: Text( 'Background Image', ), - text: const Text( + text: Text( 'Add a Decoration with a DecorationImage, to add an background image', ), - decoration: const BoxDecoration( + decoration: BoxDecoration( image: DecorationImage( fit: BoxFit.cover, image: AssetImage( diff --git a/packages/flutter_introduction_widget/lib/src/config/default_introduction_pages.dart b/packages/flutter_introduction_widget/lib/src/config/default_introduction_pages.dart new file mode 100644 index 0000000..e5c38aa --- /dev/null +++ b/packages/flutter_introduction_widget/lib/src/config/default_introduction_pages.dart @@ -0,0 +1,115 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_introduction_widget/flutter_introduction_widget.dart'; + +const List defaultIntroductionPages = [ + IntroductionPage( + decoration: BoxDecoration( + color: Color(0xffFAF9F6), + ), + title: Column( + children: [ + SizedBox(height: 100), + Text( + 'welcome to iconinstagram', + style: TextStyle( + color: Color(0xff71C6D1), + fontSize: 24, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(height: 6), + Text( + 'Welcome to the world of Instagram, where creativity' + ' knows no bounds and connections are made' + ' through captivating visuals.', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w400, + ), + textAlign: TextAlign.center, + ), + ], + ), + graphic: Image( + image: AssetImage( + 'assets/first.png', + package: 'flutter_introduction_widget', + ), + ), + text: Text(''), + ), + IntroductionPage( + decoration: BoxDecoration( + color: Color(0xffFAF9F6), + ), + title: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(height: 100), + Text( + 'discover iconinstagram', + style: TextStyle( + color: Color(0xff71C6D1), + fontSize: 24, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(height: 6), + Text( + 'Dive into the vibrant world of' + ' Instagram and discover endless possibilities.' + ' From stunning photography to engaging videos,' + ' Instagram offers a diverse range of content to explore and enjoy.', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w400, + ), + textAlign: TextAlign.center, + ), + ], + ), + graphic: Image( + image: AssetImage( + 'assets/second.png', + package: 'flutter_introduction_widget', + ), + ), + text: Text(''), + ), + IntroductionPage( + decoration: BoxDecoration( + color: Color(0xffFAF9F6), + ), + title: Column( + children: [ + SizedBox(height: 100), + Text( + 'elevate your experience', + style: TextStyle( + color: Color(0xff71C6D1), + fontSize: 24, + fontWeight: FontWeight.w700, + ), + ), + SizedBox(height: 6), + Text( + 'Whether promoting your business, or connecting' + ' with friends and family, Instagram provides the' + ' tools and platform to make your voice heard.', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w400, + ), + textAlign: TextAlign.center, + ), + ], + ), + graphic: Image( + image: AssetImage( + 'assets/third.png', + package: 'flutter_introduction_widget', + ), + ), + text: Text(''), + ), +]; diff --git a/packages/flutter_introduction_widget/lib/src/config/introduction.dart b/packages/flutter_introduction_widget/lib/src/config/introduction.dart index e46bbb8..37f19f4 100644 --- a/packages/flutter_introduction_widget/lib/src/config/introduction.dart +++ b/packages/flutter_introduction_widget/lib/src/config/introduction.dart @@ -3,6 +3,7 @@ // SPDX-License-Identifier: BSD-3-Clause import 'package:flutter/material.dart'; +import 'package:flutter_introduction_widget/src/config/default_introduction_pages.dart'; enum IntroductionScreenMode { showNever, showAlways, showOnce } @@ -42,7 +43,7 @@ class IntroductionPage { /// /// The [background] is fully optional and if not provided will show the /// [ThemeData.colorScheme.background] as default. - IntroductionPage({ + const IntroductionPage({ this.title, this.text, this.graphic, @@ -60,11 +61,11 @@ class IntroductionOptions { const IntroductionOptions({ this.introductionTranslations = const IntroductionTranslations(), this.introductionButtonTextstyles = const IntroductionButtonTextstyles(), - this.indicatorMode = IndicatorMode.dash, + this.indicatorMode = IndicatorMode.dot, this.indicatorBuilder, this.layoutStyle = IntroductionLayoutStyle.imageCenter, - this.pages = const [], - this.buttonMode = IntroductionScreenButtonMode.disabled, + this.pages = defaultIntroductionPages, + this.buttonMode = IntroductionScreenButtonMode.text, this.tapEnabled = false, this.mode = IntroductionScreenMode.showNever, this.textAlign = TextAlign.center, @@ -248,9 +249,9 @@ class IntroductionOptions { class IntroductionTranslations { const IntroductionTranslations({ this.skipButton = 'skip', - this.nextButton = 'next', - this.previousButton = 'previous', - this.finishButton = 'finish', + this.nextButton = 'Next', + this.previousButton = 'Previous', + this.finishButton = 'Get Started', }); final String skipButton; final String nextButton; @@ -260,10 +261,22 @@ class IntroductionTranslations { class IntroductionButtonTextstyles { const IntroductionButtonTextstyles({ - this.skipButtonStyle, - this.nextButtonStyle, - this.previousButtonStyle, - this.finishButtonStyle, + this.skipButtonStyle = const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + ), + this.nextButtonStyle = const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + ), + this.previousButtonStyle = const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + ), + this.finishButtonStyle = const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + ), }); final TextStyle? skipButtonStyle; final TextStyle? nextButtonStyle; diff --git a/packages/flutter_introduction_widget/lib/src/types/page_introduction.dart b/packages/flutter_introduction_widget/lib/src/types/page_introduction.dart index e7d89d0..18cf936 100644 --- a/packages/flutter_introduction_widget/lib/src/types/page_introduction.dart +++ b/packages/flutter_introduction_widget/lib/src/types/page_introduction.dart @@ -351,12 +351,28 @@ class IntroductionTwoButtons extends StatelessWidget { ), IntroductionButtonType.previous, ) ?? - TextButton( - onPressed: _previous, - child: Text( - translations.previousButton, - style: options - .introductionButtonTextstyles.previousButtonStyle, + InkWell( + onTap: _previous, + child: Container( + width: 180, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + border: Border.all( + color: const Color( + 0xff979797, + ), + ), + ), + child: Center( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 2.0), + child: Text( + translations.previousButton, + style: options + .introductionButtonTextstyles.previousButtonStyle, + ), + ), + ), ), ), ] else @@ -371,11 +387,28 @@ class IntroductionTwoButtons extends StatelessWidget { ), IntroductionButtonType.next, ) ?? - TextButton( - onPressed: _next, - child: Text( - translations.nextButton, - style: options.introductionButtonTextstyles.nextButtonStyle, + InkWell( + onTap: _next, + child: Container( + width: 180, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + border: Border.all( + color: const Color( + 0xff979797, + ), + ), + ), + child: Center( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 2.0), + child: Text( + translations.nextButton, + style: options + .introductionButtonTextstyles.nextButtonStyle, + ), + ), + ), ), ), ] else if (last) ...[ @@ -391,14 +424,30 @@ class IntroductionTwoButtons extends StatelessWidget { ), IntroductionButtonType.finish, ) ?? - TextButton( - onPressed: () { + InkWell( + onTap: () { onFinish?.call(); }, - child: Text( - translations.finishButton, - style: - options.introductionButtonTextstyles.finishButtonStyle, + child: Container( + width: 180, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + border: Border.all( + color: const Color( + 0xff979797, + ), + ), + ), + child: Center( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 2.0), + child: Text( + translations.finishButton, + style: options + .introductionButtonTextstyles.finishButtonStyle, + ), + ), + ), ), ), ] else ...[ @@ -426,14 +475,30 @@ class IntroductionTwoButtons extends StatelessWidget { ), IntroductionButtonType.finish, ) ?? - ElevatedButton( - onPressed: () { + InkWell( + onTap: () { onFinish?.call(); }, - child: Text( - translations.finishButton, - style: options - .introductionButtonTextstyles.finishButtonStyle, + child: Container( + width: 180, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + border: Border.all( + color: const Color( + 0xff979797, + ), + ), + ), + child: Center( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 2.0), + child: Text( + translations.finishButton, + style: options.introductionButtonTextstyles + .finishButtonStyle, + ), + ), + ), ), ), ), diff --git a/packages/flutter_introduction_widget/lib/src/widgets/indicator.dart b/packages/flutter_introduction_widget/lib/src/widgets/indicator.dart index 53bcf08..e967315 100644 --- a/packages/flutter_introduction_widget/lib/src/widgets/indicator.dart +++ b/packages/flutter_introduction_widget/lib/src/widgets/indicator.dart @@ -63,6 +63,7 @@ class Indicator extends StatelessWidget { ); case IndicatorMode.dash: return DashIndicator( + color: theme.colorScheme.primary, controller: controller, selectedColor: theme.colorScheme.primary, itemCount: count, diff --git a/packages/flutter_introduction_widget/pubspec.yaml b/packages/flutter_introduction_widget/pubspec.yaml index a1e18e3..41315ca 100644 --- a/packages/flutter_introduction_widget/pubspec.yaml +++ b/packages/flutter_introduction_widget/pubspec.yaml @@ -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.1.0 +version: 3.0.0 homepage: https://github.com/Iconica-Development/flutter_introduction_widget environment: @@ -20,3 +20,5 @@ dev_dependencies: ref: 6.0.0 flutter: + assets: + - assets/ diff --git a/pubspec.yaml b/pubspec.yaml index 85a26ab..b691982 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: flutter_introduction_workspace -version: 2.1.0 +version: 3.0.0 environment: sdk: '>=3.1.0 <4.0.0'