👏 FancyOnBoarding
A Fancy OnBoarding Screen Library for Easy and Quick Usage.
The source code is 100% Dart, and everything resides in the /lib folder.
Show some ❤️ and star the repo to support the project
GIF
💻 Installation
In the dependencies:
section of your pubspec.yaml
, add the following line:
fancy_on_boarding: <latest_version>
❔ Usage
Import this class
import 'package:fancy_on_boarding/fancy_on_boarding.dart';
Create a List of PageModel
final pageList = [
PageModel(
color: const Color(0xFF678FB4),
heroAssetPath: 'assets/hotels.png',
title: Text('Hotels',
style: TextStyle(
fontWeight: FontWeight.w800,
color: Colors.white,
fontSize: 34.0,
)),
body: Text('All hotels and hostels are sorted by hospitality rating',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 18.0,
)),
iconAssetPath: 'assets/key.png'),
PageModel(
color: const Color(0xFF65B0B4),
heroAssetPath: 'assets/banks.png',
title: Text('Banks',
style: TextStyle(
fontWeight: FontWeight.w800,
color: Colors.white,
fontSize: 34.0,
)),
body: Text(
'We carefully verify all banks before adding them into the app',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 18.0,
)),
iconAssetPath: 'assets/wallet.png'),
PageModel(
color: const Color(0xFF9B90BC),
heroAssetPath: 'assets/stores.png',
title: Text('Store',
style: TextStyle(
fontWeight: FontWeight.w800,
color: Colors.white,
fontSize: 34.0,
)),
body: Text('All local stores are categorized for your convenience',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 18.0,
)),
iconAssetPath: 'assets/shopping_cart.png',
),
];
Pass it into the FancyOnBoarding widget
@override
Widget build(BuildContext context) {
return Scaffold(
body: FancyOnBoarding(
doneButtonText: "Done",
skipButtonText: "Skip",
pageList: pageList,
onDoneButtonPressed: () =>
Navigator.of(context).pushReplacementNamed('/mainPage'),
onSkipButtonPressed: () =>
Navigator.of(context).pushReplacementNamed('/mainPage'),
),
);
}
🎨 Customization and Attributes
FancyOnBoarding attributes
Attribute Name | Example Value | Description |
---|---|---|
pageList | List<PageModel> | The list of pages to be displayed |
onDoneButtonPressed | (){} | Function to be called on pressing done button |
onSkipButtonPressed | (){} | Function to be called on pressing skip button |
doneButtonText | "Let's Go" | Done button text content defaults to "Done" |
skipButtonText | "Skip" | Skip button text content defaults to "Skip" |
showSkipButton | true | Skip button should be visible or not. Defaults to true |
PageModel attributes
Attribute Name | Example Value | Description |
---|---|---|
color | Color(0xFF65B0B4) | The background color of the page |
heroAssetPath | 'assets/banks.png' | The main onboarding image |
heroAssetColor | Color(0xFF65B0B4) | Main onboarding image color |
title | Text('Banks') | Title of the page |
body | Text('We carefully verify all banks before adding them into the app') | Body of the page |
iconAssetPath | 'assets/wallet.png' | Icon for the floating bubble |
👍 How to Contribute
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
📃 License
Copyright (c) 2018 Sahil Kumar
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Getting Started
For help getting started with Flutter, view our online documentation.
For help on editing package code, view the documentation.