square_progress_indicator 0.0.8

SDKflutter
Platformandroidioswindowslinuxmacosweb

You can create customizable square progress indicators like native flutter CircularProgressIndicator widget.

Create fully customizable square or rectangle progress indicators like native flutter CircularProgressIndicator widget!

Features

Live demo

You can check the example project web export on this link: https://amir14a.github.io/square_progress_indicator/ Thanks to Github!❤️

Usage

Simple usage:

const SquareProgressIndicator(),

Customize usage:

SquareProgressIndicator(
    value: _value,
    width: 100,
    height: 100,
    borderRadius: 0,
    startPosition: StartPosition.leftCenter,
    strokeCap: StrokeCap.square,
    clockwise: true,
    color: Colors.purple,
    emptyStrokeColor: Colors.purple.withOpacity(.5),
    strokeWidth: 16,
    emptyStrokeWidth: 16,
    strokeAlign: SquareStrokeAlign.center,
    child: Text("${(_value * 100).toStringAsFixed(0)}%"),
),

Additional information

ParameterTypeDefaultInfo
valuedouble?nullThe value of the progress, it should be between 0 and 1. don't pass it to use Indeterminate mode
widthdouble38The width of rectangle that the progress line is drawn around it.
heightdouble38The height of rectangle that the progress line is drawn around it.
borderRadiusdouble8The border radius of the rectangle, it is applied to all four corners.
colorColor?progressIndicatorTheme.colorThe color of the progress line.
emptyStrokeColorColor?progressIndicatorTheme.circularTrackColorThe color of the line behind the progress line which show for reminding progress.
strokeWidthdouble4The width of the progress line.
emptyStrokeWidthdouble4The width of the line behind the progress line which show for reminding progress.
clockwisebooleantrueThe direction of turn of progress line, if you pass false, the progress line will be reversed, default value is true.
startPositiondouble0 (StartPosition.topCenter)Start position of progress line relative to the topCenter, you can pass a value from [StartPosition] class or custom double value you need.
strokeAlignSquareStrokeAlignSquareStrokeAlign.insideThe stroke align of the progress line, pass a value from [SquareStrokeAlign] and read it's documents. see: https://api.flutter.dev/flutter/painting/BorderSide/strokeAlign.html
strokeCapStrokeCap?StrokeCap.roundThe stroke cap of the progress line and empty line, see: https://api.flutter.dev/flutter/dart-ui/StrokeCap.html
childWidget?nullThe child widget, it can be a text or everything you need.

Feel free to create issue or pull requests in github repository!