FlScoreBar
A simple flutter score bar package that can be used in 2 states. immutable
is the state that can be shown to the user.
And mutable
is the state that can be changed by the user action. All widgets support Rtl direction.
Usage
First of all, you must add the package to your pubspec.yaml
:
fl_score_bar: ^0.2.4
or enter this in your command line:
flutter pub add fl_score_bar
Sample
FlScoreBar
FlScoreBar can be added to your widget tree like this:
//immutable
FlScoreBar(
title: 'score',
maxScore: 5,
score: 4.3,
averageScoreColor: Colors.yellow,
highScoreColor: Colors.green,
lowScoreColor: Colors.red,
textStyle: TextStyle(color: Colors.black),
);
or
//mutable
FlScoreBar.editable(
title: 'score',
maxScore: 5,
score: 4.3,
averageScoreColor: Colors.yellow,
highScoreColor: Colors.green,
lowScoreColor: Colors.red,
textStyle: const TextStyle(color: Colors.black),
onChanged: (value) {
print('FlScoreBar updated value -> $value');
},
)
IconScoreBar
IconScoreBar can be added to your widget tree like this:
IconScoreBar(
scoreIcon: Icons.star,
iconColor: Colors.amber,
score: 2.6,
maxScore: 5,
readOnly: false,
onChanged: (value) {
print('IconScoreBar updated value -> $value');
},
)