all_devices and Restrict_user

This commit is contained in:
mohammad
2025-01-29 14:10:38 +03:00
parent d72253e3de
commit c578d63134
29 changed files with 1402 additions and 310 deletions
@@ -250,7 +250,9 @@ class CeilingSensorInterface extends StatelessWidget {
),
] else if (button['title'] == 'Space Type') ...[
Text(
model.spaceType.name.toString(),
model.spaceType.name.toString() == "none"
? "Office"
: model.spaceType.name.toString(),
style: const TextStyle(color: Colors.black),
),
] else ...[
@@ -299,7 +301,13 @@ class CeilingSensorInterface extends StatelessWidget {
);
if (result != null) {
bloc.add(ChangeValueEvent(
type: title.toString(), value: result, code: 'nobody_time'));
type: title.toString(),
value: result
.toString()
.toLowerCase()
.replaceAll('sec', 's')
.replaceAll('1hr', '1hour'), // Replacing "sec" with "s"
code: 'nobody_time'));
}
} else if (title == 'Maximum Distance') {
final result = await _showDialog(
@@ -90,9 +90,7 @@ class PresenceRecord extends StatelessWidget {
: Colors.grey,
),
title: Text(
record.value == 'true'
? "Opened"
: "Closed",
record.value.toString(),
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
@@ -106,12 +106,11 @@ class _PresenceSpaceTypeDialogState extends State<PresenceSpaceTypeDialog> {
padding: const EdgeInsets.all(10),
child: SvgPicture.asset(
icon,
),
),
const SizedBox(height: 4),
Text(
title,
title == "None" ? "Office" : title,
style: Theme.of(context)
.textTheme
.bodySmall