circular_progress_bar_with_lines 0.0.7

SDKflutter
Platformandroidioswindowslinuxmacosweb

Simple configurable circular progress bar built out of the lines.

Simple configurable circular progress bar built out of the lines.

An animated image of the iOS in-app purchase UI     

Configuration

ParamDescriptionTypeDefault value
linesLengthDefines how long will lines in loader bedouble50
radiusDefines radius between center of circle and start point of each linedouble100
percentDefines progress, min value is 0, max value is 100doublerequired field
linesAmountDefines how many lines progress bar containsint60
linesWidthDefines width for each linedouble2
linesColorDefines lines' colorColorColors.black
centerWidgetBuilderBuilder for widget that will be placed in center of progress barWidget Function(BuildContext)?optional field

Getting started

Installing

dependencies:
  circular_progress_bar_with_lines: ^0.0.5

Import

import 'package:circular_progress_bar_with_lines/circular_progress_bar_with_lines.dart';

Example

class _HomePageState extends State<HomePage> {
  double _percent = 0;

  void _updateValue(double newValue) {
    setState(() {
      _percent = newValue;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          children: [
            Flexible(
              child: CircularProgressBarWithLines(
                percent: _percent,
                centerWidgetBuilder: (context) => Text(
                  '${_percent.round()}',
                ),
              ),
            ),
            Slider(
              value: _percent.toDouble(),
              min: 0,
              max: 100,
              onChanged: _updateValue,
            )
          ],
        ),
      ),
    );
  }
}