mirror of
https://github.com/kuhyx/testsAndMisc-archive.git
synced 2026-07-04 12:03:14 +02:00
- 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
46 lines
1.4 KiB
Dart
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,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|