testsAndMisc-archive/pomodoro_app/lib/widgets/pomodoro_indicators.dart
Krzysztof kuhy Rudnicki 01091c09ce Add tests and fix pre-commit issues across all projects
- C/lichess_random_engine, vocabulary_curve, misc/split,
  1dvelocitysimulator, opening_learner: test suites added
- CPP/miscelanious: tests added
- TS/battery-status, champions_leauge_scores, two-inputs: tests added
- python_pkg/fm24_searcher, wake_alarm: new packages added
- Fix ruff/cppcheck/eslint/clang-format failures
- Update .gitignore for C/C++ build artifacts
2026-04-12 20:45:24 +02:00

46 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:pomodoro_app/models/pomodoro_state.dart';
import 'package:pomodoro_app/theme/pomodoro_theme.dart';
/// Shows completed pomodoro indicators as filled/unfilled dots.
class PomodoroIndicators extends StatelessWidget {
/// Creates [PomodoroIndicators].
const PomodoroIndicators({
required this.state,
super.key,
});
/// The current Pomodoro state.
final PomodoroState state;
@override
Widget build(BuildContext context) => Row(
mainAxisAlignment: MainAxisAlignment.center,
children: List.generate(
state.pomodorosPerCycle,
(index) {
final isCompleted = index < state.completedPomodoros % state.pomodorosPerCycle;
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 6),
child: AnimatedContainer(
duration: const Duration(milliseconds: 300),
width: 14,
height: 14,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: isCompleted
? PomodoroTheme.workColor
: Colors.white24,
border: Border.all(
color: PomodoroTheme.workColor.withValues(alpha: 0.5),
width: 2,
),
),
),
);
},
),
);
}