Add app source and tests

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
alvocool
2026-10-11 10:15:30 +03:00
parent 7e246255c2
commit 38881d1fe1
135 changed files with 21057 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';
/// App-wide theme mode. `main.dart` listens to this and rebuilds MaterialApp;
/// any screen can set it. Persisting the choice is the ViewModel's job — this
/// only carries the live value.
class ThemeController {
ThemeController._();
static final ValueNotifier<ThemeMode> mode = ValueNotifier<ThemeMode>(
ThemeMode.dark,
);
/// The stored string ('dark' | 'light' | 'system') for the current mode.
static String get name => mode.value.name;
static void apply(String stored) {
mode.value = switch (stored) {
'light' => ThemeMode.light,
'system' => ThemeMode.system,
_ => ThemeMode.dark,
};
}
}