step_progress_indicator 0.2.1+4

  • Readme
  • Changelog
  • Example
  • Installing
  • 93

Step Progress Indicator #

GitHub: SandroMaglione Twitter: SandroMaglione

Open source Flutter package, bar indicator made of a series of selected and unselected steps.

Made by Sandro Maglione, check out his personal official website sandromaglione.com

Check out the full step_progress_indicator tutorial

See the full example here

Check out the official dartdoc for the package here

Screenshots #

Install and import the package. Then just customize its parameters.

dependencies:
  flutter:
    sdk: flutter
  step_progress_indicator: ^0.2.0+3

HorizontalVertical
Horizontal indicator screenVertical indicator screen
Circular1Circular2
Circular step progress indicator screen 1Circular step progress indicator screen 2
Circular step progress indicator screen 1

Examples #

StepProgressIndicator - Example 1

Step Progress Indicator - Example 1

StepProgressIndicator(
    totalSteps: 10,
)

StepProgressIndicator - Example 2

Step Progress Indicator - Example 2

StepProgressIndicator(
    totalSteps: 10,
    currentStep: 6,
    selectedColor: Colors.red,
    unselectedColor: Colors.yellow,
)

StepProgressIndicator - Example 3

Step Progress Indicator - Example 3

StepProgressIndicator(
    totalSteps: 20,
    currentStep: 6,
    size: 10,
    selectedColor: Colors.purple,
    unselectedColor: Colors.transparent,
)

StepProgressIndicator - Example 4

Step Progress Indicator - Example 4

StepProgressIndicator(
    totalSteps: 100,
    currentStep: 32,
    size: 6,
    padding: 0,
    selectedColor: Colors.yellow,
    unselectedColor: Colors.cyan,
)

StepProgressIndicator - Example 5

Step Progress Indicator - Example 5

StepProgressIndicator(
    totalSteps: 12,
    currentStep: 4,
    padding: 6.0,
    size: 12,
    progressDirection: TextDirection.rtl,
    selectedColor: Colors.green,
    unselectedColor: Colors.black12,
)

StepProgressIndicator - Example 6

Step Progress Indicator - Example 6

StepProgressIndicator(
    totalSteps: 5,
    padding: 20.0,
    size: 20,
    customColor: (index) => index == 0
        ? Colors.redAccent
        : index == 4 ? Colors.blueAccent : Colors.deepOrange,
)

StepProgressIndicator - Example 7

Step Progress Indicator - Example 7

StepProgressIndicator(
    totalSteps: 6,
    currentStep: 4,
    size: 36,
    selectedColor: Colors.black,
    unselectedColor: Colors.grey[200],
    customStep: (index, color, _) => color == Colors.black
        ? Container(
            color: color,
            child: Icon(
            Icons.check,
            color: Colors.white,
            ),
        )
        : Container(
            color: color,
            child: Icon(
            Icons.remove,
            ),
        ),
)

StepProgressIndicator - Example 8

Step Progress Indicator - Example 8

StepProgressIndicator(
    totalSteps: 10,
    currentStep: 7,
    selectedColor: Colors.pink,
    unselectedColor: Colors.amber,
    customSize: (index) => (index + 1) * 10.0,
)

CircularStepProgressIndicator - Example 1

Circular Step Progress Indicator - Example 1

Row(
    mainAxisAlignment: MainAxisAlignment.spaceEvenly,
    children: <Widget>[
        CircularStepProgressIndicator(
            totalSteps: 10,
            currentStep: 6,
            width: 100,
        ),
        CircularStepProgressIndicator(
            totalSteps: 12,
            currentStep: 6,
            selectedColor: Colors.redAccent,
            unselectedColor: Colors.grey[200],
            selectedStepSize: 10.0,
            width: 100,
        ),
        CircularStepProgressIndicator(
            totalSteps: 20,
            currentStep: 6,
            padding: math.pi / 15,
            selectedColor: Colors.cyan,
            unselectedColor: Colors.yellowAccent,
            selectedStepSize: 3.0,
            unselectedStepSize: 9.0,
            width: 100,
        ),
    ],
)

CircularStepProgressIndicator - Example 2

Circular Step Progress Indicator - Example 2

Row(
    mainAxisAlignment: MainAxisAlignment.spaceEvenly,
    children: <Widget>[
        CircularStepProgressIndicator(
            totalSteps: 30,
            currentStep: 12,
            stepSize: 20,
            selectedColor: Colors.red,
            unselectedColor: Colors.grey[200],
            padding: math.pi / 80,
            width: 150,
            height: 150,
        ),
        CircularStepProgressIndicator(
            totalSteps: 100,
            currentStep: 74,
            stepSize: 10,
            selectedColor: Colors.greenAccent,
            unselectedColor: Colors.grey[200],
            padding: 0,
            width: 150,
            height: 150,
            selectedStepSize: 15,
        ),
    ],
)

CircularStepProgressIndicator - Example 3

Circular Step Progress Indicator - Example 3

CircularStepProgressIndicator(
    totalSteps: 100,
    currentStep: 72,
    selectedColor: Colors.yellow,
    unselectedColor: Colors.lightBlue,
    padding: 0,
    width: 100,
    child: Icon(
        Icons.tag_faces,
        color: Colors.red,
        size: 84,
    ),
)

CircularStepProgressIndicator - Example 4

Circular Step Progress Indicator - Example 4

CircularStepProgressIndicator(
    totalSteps: 20,
    stepSize: 20,
    customColor: (index) => index % 3 == 0
        ? Colors.deepPurple
        : index % 2 == 0
            ? Colors.deepOrange
            : Colors.grey[100],
    width: 250,
)

StepProgressIndicator Parameters #

ParameterTypeDescriptionDefault
totalStepsintTotal number of step of the complete indicator.@required
currentStepintNumber of steps to underline, all the steps with index <= currentStep will have Color equal to selectedColor.0
customStep(int, Color, double)WidgetDefines a custom Widget to display at each step, given the current step index, the Color, which could be defined with selectedColor and unselectedColor or using customColor, and its size, which could be defined using size, selectedSize, unselectedSize, or customSize.-
onTap(int)void Function()Defines onTap function given index of the pressed step.-
customColor(int)ColorAssign a custom Color for each step.-
customSize(int)doubleAssign a custom size for each step.-
selectedColorColorColor of the selected steps.Colors.blue
unselectedColorColorColor of the unselected steps.Colors.grey
directionAxisDefines if indicator is horizontal or vertical.Axis.horizontal
progressDirectionTextDirectionDefines if steps grow from left-to-right / top-to-bottom TextDirection.ltr or right-to-left / bottom-to-top TextDirection.rtl.TextDirection.ltr
sizedoubleSize of the indicator (height if direction is Axis.horizontal, width if Axis.vertical).4.0
paddingdoubleSpacing, left-right if horizontal, top-bottom if vertical, of each step.2.0
fallbackLengthdoubleLength of the progress indicator in case the main axis (based on direction attribute) has no size limit i.e. double.infinity.100.0
selectedSizedoubleSpecify a custom size for selected steps.-
unselectedSizedoubleSpecify a custom size for unselected steps.-

CircularStepProgressIndicator Parameters #

ParameterTypeDescriptionDefault
totalStepsintTotal number of step of the complete indicator.@required
currentStepintNumber of steps to underline, all the steps with index <= currentStep will have Color equal to selectedColor.0
childWidgetWidget child contained inside the indicator.-
selectedColorColorColor of the selected steps.Colors.blue
unselectedColorColorColor of the unselected steps.Colors.grey
customColor(int)ColorAssign a custom Color for each step.-
customStepSize(int)doubleAssign a custom size for each step.-
selectedStepSizedoubleSpecify a custom size for selected steps.-
unselectedStepSizedoubleSpecify a custom size for unselected steps.-
circularDirectionTextDirectionDefines if steps grow clockwise (CircularDirection.clockwise) or counterclockwise (CircularDirection.counterclockwise)CircularDirection.clockwise
stepSizedoubleSize of the each step of the indicator.6.0
heightdoubleHeight of the indicator's container.-
widthdoubleWidth of the indicator's container.-
paddingdoubleSpacing between each step.math.pi / 20
startingAngledoubleAngle in which is placed the starting point of the indicator.-math.pi / 2
fallbackHeightdoubleHeight of the indicator's container in case the parent height has no size limit i.e. double.infinity.100.0
fallbackWidthdoubleWidth of the indicator's container in case the parent width has no size limit i.e. double.infinity.100.0

Roadmap #

I am always open for suggestions and ideas for possible improvements or fixes.

Here below a list of coming/future improvements:

  • Adding support for animations

Versioning #

  • v0.2.0+3 - 24 February 2020
  • v0.1.1+2 - 24 January 2020
  • v0.1.0+1 - 23 January 2020

License #

GNU General Public License v3.0, see the LICENSE.md file for details.

[0.2.1+4] - 25 Febraury 2020 #

  • Updated LICENSE, from GPL3 to MIT

[0.2.0+3] - 24 Febraury 2020 #

  • Added CircularStepProgressIndicator
  • Added optimized support for Continuous Progress Indicators (by setting padding to 0 and not using custom attributes)
  • Added more attributes
    • customSize
    • selectedSize
    • unselectedSize
    • fallbackLength
  • Made indicator custom attributes (customStep, customColor, onTap, customSize) zero-based (breaking change)
  • Added more examples
  • Updated the documentation with more screens and detailed examples
  • Added CircularStepProgressIndicator animation example
  • Bug fixing

[0.1.1+2] - 24 January 2020 #

[0.1.0+1] - 23 January 2020 #

Initial release.

example/main.dart

import 'package:flutter/material.dart';

import 'horizontal_bar.dart';
import 'vertical_bar.dart';

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

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

class _MyAppState extends State<MyApp> {
  int _bottomBarIndex = 0;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Step Progress Bar',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      debugShowCheckedModeBanner: false,
      home: SafeArea(
        child: Scaffold(
          body: _bottomBarIndex == 0 ? HorizontalBar() : VerticalBar(),
          bottomNavigationBar: BottomNavigationBar(
            currentIndex: _bottomBarIndex,
            onTap: (index) => setState(() => _bottomBarIndex = index),
            items: [
              BottomNavigationBarItem(
                icon: Icon(Icons.more_horiz),
              ),
              BottomNavigationBarItem(
                icon: Icon(Icons.more_vert),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  step_progress_indicator: ^0.2.1+4

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:step_progress_indicator/step_progress_indicator.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
87
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 Apr 6, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 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