FlScoreBar.editable constructor

const FlScoreBar.editable({
  1. Key? key,
  2. String? title,
  3. required double score,
  4. TextStyle? textStyle,
  5. Color highScoreColor = BaseColors.highScoreColor,
  6. Color lowScoreColor = BaseColors.lowScoreColor,
  7. Color averageScoreColor = BaseColors.averageScoreColor,
  8. int maxScore = 5,
  9. void onChanged(
    1. double
    )?,
})

This named constructor sets _editable value to true and make slider visible to the user. score must be lower or equal than maxScore to make the widget work correctly. Also, maxScore must be between 2 and 8.

Implementation

const FlScoreBar.editable({
  Key? key,
  this.title,
  required this.score,
  this.textStyle,
  this.highScoreColor = BaseColors.highScoreColor,
  this.lowScoreColor = BaseColors.lowScoreColor,
  this.averageScoreColor = BaseColors.averageScoreColor,
  this.maxScore = 5,
  this.onChanged,
})  : assert(score <= maxScore, 'score must be lower or equal than maxScore'),
      assert(maxScore < 8 && maxScore > 2,
          'maxScore must be lower than 8 and greater than 2'),
      _editable = true,
      super(key: key);