mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-14 09:17:37 +00:00
refactor: improve formatting of clamp method for near and far detection values
This commit is contained in:
@ -113,8 +113,10 @@ class FlushMountedPresenceSensorControlView extends StatelessWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value:
|
value: (model.nearDetection / 100).clamp(
|
||||||
((model.nearDetection / 100).toDouble()).clamp(0.0, double.infinity),
|
0.0,
|
||||||
|
double.infinity,
|
||||||
|
),
|
||||||
title: 'Nearest Detect Dist:',
|
title: 'Nearest Detect Dist:',
|
||||||
description: 'm',
|
description: 'm',
|
||||||
minValue: 0.0,
|
minValue: 0.0,
|
||||||
@ -130,7 +132,7 @@ class FlushMountedPresenceSensorControlView extends StatelessWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PresenceUpdateData(
|
PresenceUpdateData(
|
||||||
value: ((model.farDetection / 100).toDouble()).clamp(0.0, double.infinity),
|
value: (model.farDetection / 100).clamp(0.0, double.infinity),
|
||||||
title: 'Max Detect Dist:',
|
title: 'Max Detect Dist:',
|
||||||
description: 'm',
|
description: 'm',
|
||||||
minValue: 0.0,
|
minValue: 0.0,
|
||||||
|
Reference in New Issue
Block a user