mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 04:07:55 +00:00
fixes bugs and add project id staging
This commit is contained in:
@@ -306,7 +306,7 @@ class CeilingSensorInterface extends StatelessWidget {
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.replaceAll('sec', 's')
|
||||
.replaceAll('1hr', '1hour'), // Replacing "sec" with "s"
|
||||
.replaceAll('1hr', '1hour'),
|
||||
code: 'nobody_time'));
|
||||
}
|
||||
} else if (title == 'Maximum Distance') {
|
||||
@@ -344,7 +344,7 @@ class CeilingSensorInterface extends StatelessWidget {
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => const CeilingHelpDescription()),
|
||||
);
|
||||
} else if (title == 'Induction History') {
|
||||
} else if (title == 'Presence Record') {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
@@ -393,7 +393,7 @@ class CeilingSensorInterface extends StatelessWidget {
|
||||
'val': nobodyTimeVal,
|
||||
},
|
||||
{
|
||||
'title': 'Induction History',
|
||||
'title': 'Presence Record',
|
||||
'icon': Assets.assetsIconsPresenceSensorAssetsInductionRecording,
|
||||
'page': null,
|
||||
'withArrow': false,
|
||||
|
||||
@@ -31,12 +31,12 @@ class MaxDistanceControl extends StatefulWidget {
|
||||
}
|
||||
|
||||
int _parseValue(String value) {
|
||||
if (value.endsWith('sec')) {
|
||||
return int.parse(value.replaceAll('sec', '').trim());
|
||||
if (value.endsWith('s')) {
|
||||
return int.parse(value.replaceAll('s', '').trim());
|
||||
} else if (value.endsWith('min')) {
|
||||
return int.parse(value.replaceAll('min', '').trim()) * 60;
|
||||
} else if (value.endsWith('hr')) {
|
||||
return int.parse(value.replaceAll('hr', '').trim()) * 3600;
|
||||
} else if (value.endsWith('hour')) {
|
||||
return int.parse(value.replaceAll('hour', '').trim()) * 3600;
|
||||
}
|
||||
return 0; // Default to 0 if the format is unrecognized
|
||||
}
|
||||
@@ -58,7 +58,7 @@ class MaxDistanceControlState extends State<MaxDistanceControl> {
|
||||
|
||||
String _formatLabel(double seconds) {
|
||||
if (seconds == 0) return 'None';
|
||||
if (seconds < 60) return '${seconds.toInt()}sec';
|
||||
if (seconds < 60) return '${seconds.toInt()}s';
|
||||
if (seconds < 3600) {
|
||||
final minutes = (seconds / 60).round();
|
||||
return '${minutes}min';
|
||||
@@ -90,7 +90,6 @@ class MaxDistanceControlState extends State<MaxDistanceControl> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double currentSeconds = _stepValues[_currentIndex];
|
||||
|
||||
return Dialog(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
@@ -128,7 +127,9 @@ class MaxDistanceControlState extends State<MaxDistanceControl> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
TitleMedium(
|
||||
text: _formatLabel(currentSeconds),
|
||||
text: _formatLabel(currentSeconds)
|
||||
.replaceAll('1hr', '1hour')
|
||||
.replaceAllMapped(RegExp(r's$'), (match) => 'sec'),
|
||||
style: context.titleMedium.copyWith(
|
||||
color: Colors.black,
|
||||
fontWeight: FontsManager.bold,
|
||||
|
||||
Reference in New Issue
Block a user