steps_indicator 0.3.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 90

steps_indicator #

pub package

A simple steps indicator widget

Installation #

Add steps_indicator: ^0.3.1 in your pubspec.yaml dependencies. And import it:

import 'package:steps_indicator/steps_indicator.dart';

How to use #

Simply create a StepsIndicator widget and pass the required params:

StepsIndicator(
  selectedStep: 1,
  nbSteps: 4
)

Do not forget to check that the selectedStep is not lower than 0 and is not higher than the total number of steps (nbSteps).

Params #

StepsIndicator(
  selectedStep: 1,
  nbSteps: 4,
  selectedStepColorOut: Colors.blue,
  selectedStepColorIn: Colors.white,
  doneStepColor: Colors.blue,
  unselectedStepColor: Colors.red,
  doneLineColor: Colors.blue,
  undoneLineColor: Colors.red,
  isHorizontal: true,
  lineLength: 40,
  lineThickness: 1,
  doneStepSize: 10,
  unselectedStepSize: 10,
  selectedStepSize: 14,
  selectedStepBorderSize: 1,
  doneStepWidget: Container(), // Custom Widget 
  unselectedStepWidget: Container(), // Custom Widget 
  selectedStepWidget: Container(), // Custom Widget 
)

For a more detail example please take a look at the example folder.

Example #

Steps indicator:

- #

If something is missing, feel free to open a ticket or contribute!

[0.3.1] - 2020-01-21 #

Fix issue

[0.3.0] - 2020-01-21 #

Use your own widget to design the step (done, selected, unselected) widget. Fix issue with custom step size. Set your own selected step border size.

[0.2.2] - 2020-01-21 #

Line thickness param is now available

[0.2.1] - 2020-01-21 #

New params available

[0.2.0] - 2020-01-20 #

Vertical steps indicator now available

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Steps Indicator Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Steps Indicator Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int selectedStep = 0;
  int nbSteps = 5;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            StepsIndicator(
              selectedStep: selectedStep,
              nbSteps: nbSteps,
              doneLineColor: Colors.green,
              doneStepColor: Colors.green,
              undoneLineColor: Colors.red,
              unselectedStepColor: Colors.red,
            ),
            Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                MaterialButton(
                  color: Colors.red,
                  onPressed: () {
                    if(selectedStep > 0) {
                      setState(() {
                        selectedStep--;
                      });
                    }
                  },
                  child: Text('Prev'),
                ),
                MaterialButton(
                  color: Colors.green,
                  onPressed: () {
                    if(selectedStep < nbSteps) {
                      setState(() {
                        selectedStep++;
                      });
                    }
                  },
                  child: Text('Next'),
                )
              ],
            )
          ],
        )
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  steps_indicator: ^0.3.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:steps_indicator/steps_indicator.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
80
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]
90
Learn more about scoring.

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

  • Dart: 2.8.2
  • pana: 0.13.8-dev
  • Flutter: 1.17.1

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.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