full app done

This commit is contained in:
davmar
2026-09-18 00:01:42 +02:00
parent 8475abeddb
commit 78fd23f69f
74 changed files with 8104 additions and 1963 deletions
+35
View File
@@ -0,0 +1,35 @@
/// Moon / sun control for switching light and dark themes.
library;
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../providers/theme_provider.dart';
class ThemeToggleButton extends StatelessWidget {
const ThemeToggleButton({super.key});
@override
Widget build(BuildContext context) {
final theme = context.watch<ThemeController>();
final colors = Theme.of(context).colorScheme;
final dark = theme.isDark;
return IconButton(
tooltip: dark ? 'Switch to light mode' : 'Switch to dark mode',
onPressed: theme.toggleLightDark,
visualDensity: VisualDensity.compact,
padding: EdgeInsets.zero,
constraints: const BoxConstraints(minWidth: 32, minHeight: 32),
style: IconButton.styleFrom(
backgroundColor: colors.surfaceContainer,
foregroundColor: colors.onSurfaceVariant,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
icon: Icon(
dark ? Icons.light_mode_outlined : Icons.dark_mode_outlined,
size: 16,
),
);
}
}