GithubHelp home page GithubHelp logo

xsahil03x / fancy_on_boarding Goto Github PK

View Code? Open in Web Editor NEW
361.0 12.0 82.0 4.3 MB

Fancy OnBoarding Screen Library

Home Page: https://pub.dartlang.org/packages/fancy_on_boarding

License: MIT License

Dart 91.47% Objective-C 0.11% Kotlin 1.05% Swift 1.21% Shell 1.67% HTML 4.50%
flutter flutter-package dart on-boarding library navigation flutter-ui google-flutter hacktoberfest

fancy_on_boarding's Introduction

πŸ‘ FancyOnBoarding

Say Thanks! Twitter

A Fancy OnBoarding Screen Library for Easy and Quick Usage.

  • Checkout the Original Author : GitHub followers
  • Checkout the Original Designer : GitHub followers

The source code is 100% Dart, and everything resides in the /lib folder.

Show some ❀️ and star the repo to support the project

GitHub stars GitHub forks GitHub watchers GitHub followers
Twitter Follow

Open Source Love License Build Status CodeCov

GIF

GIF

πŸ’» Installation

In the dependencies: section of your pubspec.yaml, add the following line:

Version

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),
        heroImagePath: 'assets/png/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,
            )),
        iconImagePath: 'assets/png/key.png'),
    PageModel(
        color: const Color(0xFF65B0B4),
        heroImagePath: 'assets/png/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,
            )),
        iconImagePath: 'assets/png/wallet.png'),
    PageModel(
      color: const Color(0xFF9B90BC),
      heroImagePath: 'assets/png/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,
          )),
      icon: Icon(
        Icons.shopping_cart,
        color: const Color(0xFF9B90BC),
      ),
    ),
    // SVG Pages Example
    PageModel(
        color: const Color(0xFF678FB4),
        heroImagePath: 'assets/svg/hotel.svg',
        title: Text('Hotels SVG',
            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,
            )),
        iconImagePath: 'assets/svg/key.svg',
        heroImageColor: Colors.white),
    PageModel(
        color: const Color(0xFF65B0B4),
        heroImagePath: 'assets/svg/bank.svg',
        title: Text('Banks SVG',
            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,
            )),
        iconImagePath: 'assets/svg/cards.svg',
        heroImageColor: Colors.white),
    PageModel(
      color: const Color(0xFF9B90BC),
      heroImagePath: 'assets/svg/store.svg',
      title: Text('Store SVG',
          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,
          )),
      iconImagePath: 'assets/svg/cart.svg',
    ),
  ];

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
bottomMargin 8.0 Indicator bottom margin. Defaults to 8.0
doneButton Button(onPressed:(){},child:Text('Done')) Custom DoneButton. Will replace default doneButton if provided
skipButton Button(onPressed:(){},child:Text('Skip')) Custom SkipButton. Will replace default doneButton if provided

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
icon Icon(Icons.shopping_cart) Icon for the floating bubble, Will replace 'iconAssetPath' if provided

πŸ‘ How to Contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. 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.

fancy_on_boarding's People

Contributors

ahsanz024 avatar boulama avatar gopalvirat avatar korbacsk avatar medyas avatar norbert515 avatar xsahil03x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fancy_on_boarding's Issues

Other options to put widgets in Title and Body

I just want to know that your parameters in PageModel of Title and Body have Text widget only, why not make it as "Widget"? so that we can have wide range of widgets to choose in each pagemodel

Make the pages scrollable?

Anybody turn their devices to landscape? These widgets aren't scrollable. Anybody know how to make them scrollable?

fluter_svg needs to be upgraded to 0.18.0

flutter_svg (0.18.0) is adapted to flutter lastest stable channel (v1.20.2), if it is lower than 0.18.0, it fails to run. This library depends on the lower version of flutter_svg, so an error is reported when running on the lastest stable channel.

How to build a widget instead of the final pageList?

I am using the plugins for an app but it has two languages ​​and I use the context property to be able to translate the string of the title and the body of the pageModel however I have an error because I don't have a context for that ... how could I create a widget that allow to use buildcontext and in this way use languages?

my code:
final pageList = [
PageModel(
color: dBlueSkyColor,
heroAssetPath: 'assets/images/delivery1.png',
title: Text('SAVE MONEY',
style: GoogleFonts.montserrat(
fontWeight: FontWeight.w800,
color: dOrangeColor,
fontSize: 30.0,
)),
body: Text(
'Weekly best deals picked by our price comparison team',
textAlign: TextAlign.center,
style: GoogleFonts.montserrat(
color: dOrangeColor,
fontSize: 15.0,
),
),
iconAssetPath: 'assets/icons/postal.png',
),
PageModel(
color: const Color(0xFF65B0B4),
heroAssetPath: 'assets/images/delivery2.png',
title: Text('SAVE TIME',
style: GoogleFonts.montserrat(
fontWeight: FontWeight.w800,
color: Colors.white,
fontSize: 30.0,
)),
body: Text(
'Shop from over 1200 local stores at your fingertips',
textAlign: TextAlign.center,
style: GoogleFonts.montserrat(
color: Colors.white,
fontSize: 15.0,
),
),
iconAssetPath: 'assets/icons/business.png',
),
PageModel(
color: const Color(0xFF9B90BC),
heroAssetPath: 'assets/images/delivery3.png',
title: Text('HOME DELIVERY',
style: GoogleFonts.montserrat(
fontWeight: FontWeight.w800,
color: Colors.white,
fontSize: 30.0,
)),
body:
Text("You get everything you'd want from your local store to your door",
textAlign: TextAlign.center,
style: GoogleFonts.montserrat(
color: Colors.white,
fontSize: 15.0,
)),
iconAssetPath: 'assets/icons/over.png',
),
];

instead of using plain text use
S.of(context).simpleText
with error in context

Error: 'Page' is imported from both pages.dart and navigator.dart

Compiler message:
../../flutter/.pub-cache/hosted/pub.dartlang.org/fancy_on_boarding-1.5.0/lib/src/fancy_on_boarding.dart:67:9: Error: 'Page' is imported from both 'package:fancy_on_boarding/src/pages.dart' and 'package:flutter/src/widgets/navigator.dart'.
        Page(
        ^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/fancy_on_boarding-1.5.0/lib/src/fancy_on_boarding.dart:73:18: Error: 'Page' is imported from both 'package:fancy_on_boarding/src/pages.dart' and 'package:flutter/src/widgets/navigator.dart'.
          child: Page(
                 ^^^^

Steps to reproduce:

import "package:flutter/material.dart";
import 'package:fancy_on_boarding/fancy_on_boarding.dart' as boarder;

final pageList = [
    boarder.PageModel(
        color: const Color(0xFF678FB4),
        heroAssetPath: 'assets/heart.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/heart.png'),
    boarder.PageModel(
        color: const Color(0xFF65B0B4),
        heroAssetPath: 'assets/heart.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/heart.png'),
    boarder.PageModel(
      color: const Color(0xFF9B90BC),
      heroAssetPath: 'assets/heart.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/heart.png',
    ),
];


class Onboarding extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: boarder.FancyOnBoarding(
        doneButtonText: "Done",
        skipButtonText: "Skip",
        pageList: pageList,
        onDoneButtonPressed: () =>
            Navigator.of(context).pushReplacementNamed('/mainPage'),
        onSkipButtonPressed: () =>
            Navigator.of(context).pushReplacementNamed('/mainPage'),
      ),
    );
  }
}

Running Flutter (Channel beta, v1.17.0, on Mac OS X 10.15.4 19E287, locale en-NO)

Landscape View : RenderFlex Overflowed

How Can I show Landscape view of my fancy-on-boarding? Whenever I turn my app in landscape mode, it appears to me that RenderFlex overflowed! So How can I solve it?

Tests are failing in master branch

I'm not sure if I'm testing it right, but I can't manage to make the tests pass in the master branch.

To be precise this one: Done Pressed smoke test

Support for web

The on-boarding package doesn't work for web. Is there a plan to support it?

How to add more than 3 screens

I have added two more pages in the pages list in pages.dart but still only 3 screens comes up. How to add more onboarding screens?

Please upgrade versions

Because image >=3.0.0-nullsafety.0 <3.0.1 depends on xml ^5.0.0-nullsafety.1 and image >=3.0.1 depends on xml ^5.0.0, image >=3.0.0-nullsafety.0 requires xml ^5.0.0-nullsafety.1.
And because flutter_launcher_icons >=0.9.0 depends on image ^3.0.0-nullsafety.0, flutter_launcher_icons >=0.9.0 requires xml ^5.0.0-nullsafety.1.
And because fancy_on_boarding >=1.7.0 depends on flutter_svg ^0.19.1 which depends on xml ^4.2.0, flutter_launcher_icons >=0.9.0 is incompatible with fancy_on_boarding >=1.7.0.
So, because senio_assist depends on both fancy_on_boarding ^1.7.0 and flutter_launcher_icons ^0.9.0, version solving failed.

Is this package dead?

I see it i snot maitained? Because not so many commits + packages are outdated and instaling packages like dotted_border are failing

build errors with flutter_svg when upgrading to 1.20

I upgraded to Flutter 1.20 and could no longer build my project. I believe that it's because of the dependency on flutter_svg: ^0.17.4

For anyone running into this problem, you can fix it by adding the following to your pubspec.yaml:

dependency_overrides:
  flutter_svg: ^0.18.0

Image is flickering

Image is flickering when the next page reveals complete, the previous image showing for a fraction of a second.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.