WOISectionBar constructor
WOISectionBar({
- Key? key,
- required double width,
- required List<
int> sections, - bool borderedSections = false,
- Color borderColor = Colors.black,
- double borderWidth = 1,
- bool prefixAndSuffixText = true,
- double barHeight = 15,
- BoxShadow progressIndicatorShadow = const BoxShadow(color: Colors.black, blurRadius: 10, spreadRadius: 0),
- int currentProgress = 0,
- Color progressIndicatorColor = Colors.white,
- double progressIndicatorBorderRadius = 20,
- double barBottomPadding = 0,
- double sectionSpacing = 5,
- double progressIndicatorSize = 25,
- required int initialValue,
- Color inactiveBarColor = Colors.grey,
- Color activeBarColor = Colors.blueGrey,
- TextStyle fontStyle = const TextStyle(fontWeight: FontWeight.w400, fontSize: 18, color: Colors.grey),
- double tiltValue = 5,
- double textPadding = 5,
The WOISectionBar can be divided into multiple different sections that jointly tracks the progress and completion of a single task. Each section as defined by the user can track the progress of all hierarchical steps needed to achieve a goal. The section bar takes width and a list called sections as required parameters. Sections can not contain a value of 0 and currentProgress cannot be greater that the sum of all elements in the section list.
Implementation
WOISectionBar({
super.key,
required this.width,
required this.sections,
this.borderedSections = false,
this.borderColor = Colors.black,
this.borderWidth = 1,
this.prefixAndSuffixText = true,
this.barHeight = 15,
this.progressIndicatorShadow = const BoxShadow(
color: Colors.black,
blurRadius: 10,
spreadRadius: 0,
),
this.currentProgress = 0,
this.progressIndicatorColor = Colors.white,
this.progressIndicatorBorderRadius = 20,
this.barBottomPadding = 0,
this.sectionSpacing = 5,
this.progressIndicatorSize = 25,
required this.initialValue,
this.inactiveBarColor = Colors.grey,
this.activeBarColor = Colors.blueGrey,
this.fontStyle = const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 18,
color: Colors.grey,
),
this.tiltValue = 5,
this.textPadding = 5,
}) : assert(!sections.contains(0), 'List can not have the value 0'),
assert(
currentProgress <=
sections.reduce((value, element) => value + element),
'Current progress cannot be greater than the sum of elements of sections list.');