introduction_screen 1.0.5+2

IntroductionScreen pub package

Introduction screen allow you to have a screen at launcher for example, where you can explain your app. This Widget is customizable (more in the future) with a great design.

Introduction_screen use another package, dots_indicator, that I also created.

Installation #

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

dependencies:
  introduction_screen: ^1.0.5+2

Example #

In these example, listPagesViewModel is the list of pages. A page is base on PageViewModel. See example of a PageViewModel below.

PageViewModel #

Simple page #

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

new PageViewModel(
  "Title of first page",
  "Here you can write the description of the page, to explain someting...",
  image: Center(
    child: Image.network("https://domaine.com/image.png", height: 175.0),
  ),
)

Page with custom colors #

This example show you how to define the color of the page (background but also the dot indicator color)

new PageViewModel(
  "Title of first page",
  "Here you can write the description of the page, to explain someting...",
  image: Center(child: Image.asset("res/images/logo.png", height: 175.0)),
  decoration: const PageDecoration(
    pageColor: Colors.blue,
    dotsDecorator: DotsDecorator(
      activeColor: Colors.red,
    )
  ),
)

Page with custom text style #

This example show you how to define another TextStyle for the title and the body

new PageViewModel(
  "Title of first page",
  "Here you can write the description of the page, to explain someting...",
  image: const Center(child: Icon(Icons.android)),
  decoration: const PageDecoration(
    titleTextStyle: TextStyle(color: Colors.orange),
    bodyTextStyle: TextStyle(fontWeight: FontWeight.w700, fontSize: 20.0),
  ),
)

This example show you how to define a page with a footer, like a Button

new PageViewModel(
  "Title of first page",
  "Here you can write the description of the page, to explain someting...",
  image: const Center(child: Icon(Icons.android)),
  footer: RaisedButton(
    onPressed: () {
      // On button presed
    },
    child: const Text("Let's Go !"),
  ),
);

IntroductionScreen #

Note :

If you not provide next parameter, the Next button will be not displayed. If you want to display a skip button, you must add skip parameter and showSkipButton: true The done parameter is required.

Simple intro screen #

Simple intro screen

Base intro

new IntroductionScreen(
  pages: listPagesViewModel,
  done: const Text("Done", style: TextStyle(fontWeight: FontWeight.w600))
  onDone: () {
    // When done button is press
  },
); //Material App

Intro screen with skip button #

With skip button

new IntroductionScreen(
  pages: listPagesViewModel,
  onDone: () {
    // When done button is press
  },
  showSkipButton: true,
  skip: const Text("Skip"),
  done: const Text("Done", style: TextStyle(fontWeight: FontWeight.w600)),
);

Intro screen with custom button text #

Custom button text

new IntroductionScreen(
  pages: listPagesViewModel,
  onDone: () {
    // When done button is press
  },
  onSkip: () {
    // You can also override onSkip callback
  },
  showSkipButton: true,
  skip: const Icon(Icons.skip_next),
  next: const Icon(Icons.next),
  done: const Text("Done", style: TextStyle(fontWeight: FontWeight.w600))
);

Others parameters #

There is other possibles parameters that you can add :

  • Freeze the scroll, by adding freeze: true parameter.
  • Duration of scrolling animation, by adding animationDuration: 400 parameter.
  • Global background color, by adding globalBackgroundColor: Colors.blue parameter.
  • Initial page, by adding initialPage: 1 parameter.
  • Hide next button, by adding showNextButton: false parameter.
  • Skip button flex, by adding skipFlex: 1 parameter. (Set 0 to disable Expanded behaviour)
  • Dots indicator flex, by adding dotsFlex: 1 parameter. (Set 0 to disable Expanded behaviour)
  • Next/Done button flex, by adding nextFlex: 1 parameter. (Set 0 to disable Expanded behaviour)

Changelog #

1.0.5+2 #

  • Fix next button disable

1.0.5+1 #

  • Improve example code
  • Fix README mistake

1.0.5 #

  • Add globalBackgroundColor property to define background color for all transparent pages
  • Add showNextButton property to set Next button visible or not

1.0.4 #

  • Add possibility to define flex ratio for skip, dots and next/done button.

1.0.3+1 #

  • Update dots_indicator library to 0.0.5+1

1.0.3 #

  • Breaking changes : Update dots_indicator library, now you must/can provide dots customizations with DotsDecorator model with dotsDecorator property of PageDecoration.

1.0.2 #

  • Breaking changes : All page customization has been moved to PageDecoration model
  • Improve layout of the page
  • Add imageFlex and bodyFlex parameter on PageDecoration, to custom flex ratio
  • Improve example app

1.0.1 #

  • Add scrollview on page content to handle small screen

1.0.0 #

  • Breaking changes : image (Widget) parameter is now optional
  • Add possibility to provide BoxDecoration (Thanks to https://github.com/MohiuddinM)
  • Add possibility to override default onSkip method

0.0.5 #

  • Breaking changes : done (Widget) parameter is now required
  • Breaking changes : skip (Widget) parameter is now required if you set showSkipButton: true
  • Fix bug
  • Add onChange listener
  • Add possibility to add a footer (like a button)
  • Add animation duration
  • Add possibility to define the initial page
  • Add possibility to freeze the scroll

0.0.4 #

  • Improve customization
  • Change String type to Widget for buttons, to set an Icon for example
  • Remove nextText parameter, use next instead
  • Remove doneText parameter, use done instead
  • Remove skipText parameter, use skip instead

0.0.3 #

  • Fix design padding layout on small device
  • Improve layout Expanded flex

0.0.2 #

  • Published on Pub
  • Fix bugs

0.0.1 #

  • First version

example/README.md

introduction_example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  introduction_screen: ^1.0.5+2

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:introduction_screen/introduction_screen.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
86
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]
93
Learn more about scoring.

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
dots_indicator ^0.0.5+1 0.0.5+1
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8

Admin