onboarding_anim 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 74

onboarding_anim pub package #

A library to create an onboarding in a simple way, and with a beautiful animation.

Installation #

You just need to add onboarding_anim as a dependency in your pubspec.yaml file.

dependencies:
  onboarding_anim: ^0.0.2

Example #

Demo OnboardingAnim alpha

In order to create onboarding we need a list of pages in this case we use a model PageModel

PageModel #

Simple page #

This example only define title, body and an image (you can define any widget)

PageModel(
  title: "Relax",
  body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna    aliqua. Ut enim ad minim veniam.",
  image: Image(image: NetworkImage("https://i-love-png.com/images/kraken_body03_final_01.png")),
)

Page with custom colors #

PageModel(
  title: "Relax",
  body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna    aliqua. Ut enim ad minim veniam.",
  image: Image(image: NetworkImage("https://i-love-png.com/images/kraken_body03_final_01.png")),
  decoration: PageDecoration(
    pageColor: Colors.blue,
  )
)

Page with custom text style #

PageModel(
  title: "Relax",
  body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna    aliqua. Ut enim ad minim veniam.",
  image: Image(image: NetworkImage("https://i-love-png.com/images/kraken_body03_final_01.png")),
  decoration: const PageDecoration(
    titleTextStyle: TextStyle(color: Colors.orange),
    bodyTextStyle: TextStyle(fontWeight: FontWeight.w700, fontSize: 20.0),
  )
)

Page with widget body #

This example show you how to define a page with a body as Widget and not a simple String You can to the same this for title, with titleWidget parameter.

PageModel(
  title: "Relax",
  bodyWidget: Row(
    mainAxisAlignment: MainAxisAlignment.center,
    children: const [
      Text("Click on "),
      Icon(Icons.edit),
      Text(" to edit a post"),
    ],
  ),
  image: Center(child: Icon(Icons.android)),
);

OnboardingScreen Default #

Scaffold(
  body: OnBoardingScreen (
    pages: pages,
    onDone: () => print("Done"),
    onSkip: () => print("Skip")
    )
)

OnboardingScreen with Decoration #

Scaffold(
body: OnBoardingScreen (
  onboardingDecoration: OnboardingDecoration(
    aling: Alignment.topCenter,
    child: Image(
      image: NetworkImage("https://www.themexpert.com/images/easyblog_articles/531/b2ap3_large_Mountains.PNG"),
      width: MediaQuery.of(context).size.width,
     )
   ),
   pages: pages,
   onDone: () => print("Done"),
   onSkip: () => print("Skip")
   ),
)

Custom Colors Indicators #

Scaffold(
  body: OnBoardingScreen (
    onboardingDecoration: OnboardingDecoration(
      aling: Alignment.topCenter,
      child: Image(
        image: NetworkImage("https://www.themexpert.com/images/easyblog_articles/531/b2ap3_large_Mountains.PNG"),
        width: MediaQuery.of(context).size.width,
       )
     ),
     pages: pages,
     onDone: () => print("Done"),
     onSkip: () => print("Skip"),
     indicatorDecoration: IndicatorDecoration(
      active: Colors.red,
      inactive: Colors.blueGrey,
      shadow: Colors.blue
    )
  )
)

Changelog #

0.0.1 #

  • First version

0.0.2 #

  • Secound version

1.0.0 #

  • Production version

1.0.1 #

  • Resolve conficts

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:onboarding_anim/onboarding_anim.dart';

void main() {
  runApp(MaterialApp(
      theme: ThemeData(
          primaryColor: Colors.deepOrange, accentColor: Colors.deepOrange[200]),
      home: MyApp()));
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  List<PageModel> pages = <PageModel>[
    PageModel(
      title: "Relax",
      body:
          "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.",
      image: Image(
          image: NetworkImage(
              "https://i-love-png.com/images/kraken_body03_final_01.png")),
    ),
    PageModel(
        title: "Flutter",
        body:
            "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.",
        image: Image(
            image: NetworkImage(
                "https://i-love-png.com/images/kraken_body01_final_01_1766.png"))),
    PageModel(
        title: "Is Awesome",
        body:
            "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.",
        image: Image(
            image: NetworkImage(
                "https://i-love-png.com/images/kraken_body03_final_01.png"))),
    PageModel(
        title: "And Beautiful",
        body:
            "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.",
        image: Image(
            image: NetworkImage(
                "https://i-love-png.com/images/kraken_body01_final_01_1766.png")))
  ];

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: OnBoardingScreen(
            onboardingDecoration: OnboardingDecoration(
                aling: Alignment.topCenter,
                child: Image(
                  image: NetworkImage(
                      "https://www.themexpert.com/images/easyblog_articles/531/b2ap3_large_Mountains.PNG"),
                  width: MediaQuery.of(context).size.width,
                )),
            pages: pages,
            onDone: () => print("Done"),
            onSkip: () => print("Skip"),
            dotsType: OnBoardingScreen.dotsLinearProgress,
            indicatorDecoration: IndicatorDecoration(
                active: Colors.deepOrange, inactive: Colors.deepOrange[200])));
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  onboarding_anim: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:onboarding_anim/onboarding_anim.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
48
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
74
Learn more about scoring.

We analyzed this package on May 26, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.1
  • pana: 0.13.8-dev
  • Flutter: 1.17.0

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test