better builtin profiles

This commit is contained in:
stopflock
2025-08-27 21:24:22 -05:00
parent 24b20e8a57
commit 376fa27736
5 changed files with 97 additions and 14 deletions
+6 -1
View File
@@ -19,7 +19,12 @@ class ProfileState extends ChangeNotifier {
// Initialize profiles from built-in and custom sources
Future<void> init() async {
// Initialize profiles: built-in + custom
_profiles.add(CameraProfile.alpr());
_profiles.add(CameraProfile.genericAlpr());
_profiles.add(CameraProfile.flock());
_profiles.add(CameraProfile.motorola());
_profiles.add(CameraProfile.genetec());
_profiles.add(CameraProfile.leonardo());
_profiles.add(CameraProfile.neology());
_profiles.addAll(await ProfileService().load());
// Load enabled profile IDs from prefs
+5 -1
View File
@@ -18,7 +18,11 @@ class SessionState extends ChangeNotifier {
AddCameraSession? get session => _session;
void startAddSession(List<CameraProfile> enabledProfiles) {
_session = AddCameraSession(profile: enabledProfiles.first);
final submittableProfiles = enabledProfiles.where((p) => p.isSubmittable).toList();
final defaultProfile = submittableProfiles.isNotEmpty
? submittableProfiles.first
: enabledProfiles.first; // Fallback to any enabled profile
_session = AddCameraSession(profile: defaultProfile);
notifyListeners();
}