feat: implement base architecture and core repositories for weapon tracking and target analysis functionality
This commit is contained in:
@@ -3,11 +3,14 @@ class AppConstants {
|
||||
|
||||
// Database
|
||||
static const String databaseName = 'bully_targets.db';
|
||||
static const int databaseVersion = 1;
|
||||
static const int databaseVersion = 6;
|
||||
|
||||
// Tables
|
||||
static const String sessionsTable = 'sessions';
|
||||
static const String targetAnalysesTable = 'target_analyses';
|
||||
static const String shotsTable = 'shots';
|
||||
static const String weaponsTable = 'weapons';
|
||||
static const String maintenanceTable = 'weapon_maintenance';
|
||||
|
||||
// Image processing
|
||||
static const double minImpactRadius = 2.0;
|
||||
|
||||
44
lib/core/theme/theme_provider.dart
Normal file
44
lib/core/theme/theme_provider.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class ThemeProvider with ChangeNotifier {
|
||||
static const String _themeModeKey = 'user_theme_mode';
|
||||
|
||||
ThemeMode _themeMode = ThemeMode.system;
|
||||
|
||||
ThemeMode get themeMode => _themeMode;
|
||||
|
||||
ThemeProvider() {
|
||||
loadThemeMode();
|
||||
}
|
||||
|
||||
Future<void> loadThemeMode() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final modeIndex = prefs.getInt(_themeModeKey);
|
||||
if (modeIndex != null) {
|
||||
_themeMode = ThemeMode.values[modeIndex];
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> setThemeMode(ThemeMode mode) async {
|
||||
if (_themeMode == mode) return;
|
||||
|
||||
_themeMode = mode;
|
||||
notifyListeners();
|
||||
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setInt(_themeModeKey, mode.index);
|
||||
}
|
||||
|
||||
String get themeModeName {
|
||||
switch (_themeMode) {
|
||||
case ThemeMode.system:
|
||||
return 'Automatique';
|
||||
case ThemeMode.light:
|
||||
return 'Clair';
|
||||
case ThemeMode.dark:
|
||||
return 'Sombre';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user