WOICurvedBar constructor

const WOICurvedBar({
  1. required int finalValue,
  2. required int currentValue,
  3. Widget center = const SizedBox(),
  4. double size = 300,
  5. Color barColor = Colors.grey,
  6. Color fillColor = Colors.orange,
  7. EdgeInsetsGeometry padding = const EdgeInsets.all(0),
  8. Color backgroundColor = Colors.white,
  9. double backgroundBorderRadius = 20,
  10. double arcWidth = 20,
  11. bool arcBorders = false,
  12. Color borderColor = Colors.black,
  13. double borderWidth = 5,
  14. double arcLength = -20,
  15. ArcDirection arcDirection = ArcDirection.up,
  16. bool rotateCenter = false,
  17. Key? key,
})

The WOICurvedBar is an arc shape progress bar The section bar takes final value(completion value) and current value(the progress value) as required parameters.

Implementation

const WOICurvedBar({
  /// This value will mark the completion point of the curved bar.
  required this.finalValue,

  /// This value will indicate the progress fill on the bar.
  required this.currentValue,

  /// This is to display any widget in the center of curved bar.
  this.center = const SizedBox(),

  /// This is the size of the widget.
  /// By default the value is 300.
  this.size = 300,

  /// This is the color of the bar when it is not filled.
  /// By default the color is grey.
  this.barColor = Colors.grey,

  /// This is the color that the arc fills up with as progress increases.
  /// By default it is orange.
  this.fillColor = Colors.orange,

  /// This is the padding between the curved bar and the container that wraps it.
  /// By default the value is 0. It is required if the background color is changed.
  /// Size of the curved bar will change when adding padding so the size of widget will also need changing.
  this.padding = const EdgeInsets.all(0),

  /// This is the background color of the curved bar.
  this.backgroundColor = Colors.white,

  /// This is border radius of the background of the curved bar.
  /// By default the value is 20. This can be used to give the widget a circular shape.
  this.backgroundBorderRadius = 20,

  /// This is the thickness of the curved bar.
  this.arcWidth = 20,

  /// This boolean value is used if the arc needs to be bordered.
  /// By default it is false.
  this.arcBorders = false,

  /// Color of the border in case the arcBorders flag is set to true.
  this.borderColor = Colors.black,

  /// Width of the border in case the arcBorders flag is set to true.
  this.borderWidth = 5,

  /// Length of the arc. By default the value is -20.
  /// Arc length can be betweeen -20 and 90, inclusive. Hot restart is recommended when arc length is changed.
  this.arcLength = -20,

  /// Changes the direction of the arc. By default the direction is up.
  this.arcDirection = ArcDirection.up,

  /// Boolean value to determine if the center widget needs to rotate when rotating the arc.
  /// By default the value is false.
  this.rotateCenter = false,
  super.key,
}) : assert(currentValue <= finalValue && currentValue >= 0,
          'Current value cannot be greater than final value or less than 0');