gunshot detection - direction optional as defined by profile

This commit is contained in:
stopflock
2025-08-29 13:47:32 -05:00
parent 57acff8ae7
commit 395ef77fe3
7 changed files with 124 additions and 9 deletions
+19 -1
View File
@@ -64,9 +64,27 @@ class AddCameraSheet extends StatelessWidget {
divisions: 359,
value: session.directionDegrees,
label: session.directionDegrees.round().toString(),
onChanged: (v) => appState.updateSession(directionDeg: v),
onChanged: session.profile.requiresDirection
? (v) => appState.updateSession(directionDeg: v)
: null, // Disables slider when requiresDirection is false
),
),
if (!session.profile.requiresDirection)
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 12),
child: Row(
children: const [
Icon(Icons.info_outline, color: Colors.grey, size: 16),
SizedBox(width: 6),
Expanded(
child: Text(
'This profile does not require a direction.',
style: TextStyle(color: Colors.grey, fontSize: 12),
),
),
],
),
),
if (submittableProfiles.isEmpty)
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 12),
+19 -1
View File
@@ -71,9 +71,27 @@ class EditCameraSheet extends StatelessWidget {
divisions: 359,
value: session.directionDegrees,
label: session.directionDegrees.round().toString(),
onChanged: (v) => appState.updateEditSession(directionDeg: v),
onChanged: session.profile.requiresDirection
? (v) => appState.updateEditSession(directionDeg: v)
: null, // Disables slider when requiresDirection is false
),
),
if (!session.profile.requiresDirection)
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 12),
child: Row(
children: const [
Icon(Icons.info_outline, color: Colors.grey, size: 16),
SizedBox(width: 6),
Expanded(
child: Text(
'This profile does not require a direction.',
style: TextStyle(color: Colors.grey, fontSize: 12),
),
),
],
),
),
if (isSandboxMode)
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 12),