LevelGoalTracker constructor
LevelGoalTracker({
- Key? key,
- required List<
GoalItem> goals, - Axis direction = Axis.horizontal,
- bool showLabel = false,
- double spacing = NeonTheme.s8,
- EdgeInsetsGeometry? padding,
- BoxDecoration? itemDecoration,
Implementation
LevelGoalTracker({
super.key,
required this.goals,
this.direction = Axis.horizontal,
this.showLabel = false,
this.spacing = NeonTheme.s8,
this.padding,
this.itemDecoration,
}) {
if (goals.isEmpty || goals.length > 4) {
throw ArgumentError.value(
goals.length,
'goals.length',
'must have 1 to 4 goals',
);
}
final ids = <String>{};
for (final goal in goals) {
if (!ids.add(goal.id)) {
throw ArgumentError.value(
goal.id,
'goals',
'duplicate goal id: "${goal.id}"',
);
}
}
}