Implement Asia/Manila Time Zone

Handled saving of Relievers
This commit is contained in:
2026-02-11 20:12:48 +08:00
parent 747edbdd8c
commit 678a73a696
20 changed files with 551 additions and 168 deletions
+18 -16
View File
@@ -9,6 +9,7 @@ import '../../providers/admin_user_provider.dart';
import '../../providers/profile_provider.dart';
import '../../providers/tickets_provider.dart';
import '../../providers/user_offices_provider.dart';
import '../../utils/app_time.dart';
import '../../widgets/mono_text.dart';
import '../../widgets/responsive_body.dart';
import '../../widgets/tasq_adaptive_list.dart';
@@ -122,13 +123,14 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
final query = _searchController.text.trim().toLowerCase();
final filteredProfiles = query.isEmpty
? profiles
: profiles.where((profile) {
final label =
profile.fullName.isNotEmpty ? profile.fullName : profile.id;
return label.toLowerCase().contains(query) ||
profile.id.toLowerCase().contains(query);
}).toList();
? profiles
: profiles.where((profile) {
final label = profile.fullName.isNotEmpty
? profile.fullName
: profile.id;
return label.toLowerCase().contains(query) ||
profile.id.toLowerCase().contains(query);
}).toList();
final officeCountByUser = <String, int>{};
for (final assignment in assignments) {
@@ -156,8 +158,9 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
TasQColumn<Profile>(
header: 'User',
cellBuilder: (context, profile) {
final label =
profile.fullName.isEmpty ? profile.id : profile.fullName;
final label = profile.fullName.isEmpty
? profile.id
: profile.fullName;
return Text(label);
},
),
@@ -166,8 +169,9 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
cellBuilder: (context, profile) {
final status = _statusCache[profile.id];
final hasError = _statusErrors.contains(profile.id);
final email =
hasError ? 'Unavailable' : (status?.email ?? 'Unknown');
final email = hasError
? 'Unavailable'
: (status?.email ?? 'Unknown');
return Text(email);
},
),
@@ -188,8 +192,7 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
final status = _statusCache[profile.id];
final hasError = _statusErrors.contains(profile.id);
final isLoading = _statusLoading.contains(profile.id);
final statusLabel =
_userStatusLabel(status, hasError, isLoading);
final statusLabel = _userStatusLabel(status, hasError, isLoading);
return _StatusBadge(label: statusLabel);
},
),
@@ -204,8 +207,7 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
onRowTap: (profile) =>
_showUserDialog(context, profile, offices, assignments),
mobileTileBuilder: (context, profile, actions) {
final label =
profile.fullName.isEmpty ? profile.id : profile.fullName;
final label = profile.fullName.isEmpty ? profile.id : profile.fullName;
final status = _statusCache[profile.id];
final hasError = _statusErrors.contains(profile.id);
final isLoading = _statusLoading.contains(profile.id);
@@ -673,7 +675,7 @@ String _userStatusLabel(
String _formatLastActiveLabel(DateTime? value) {
if (value == null) return 'N/A';
final now = DateTime.now();
final now = AppTime.now();
final diff = now.difference(value);
if (diff.inMinutes < 1) return 'Just now';
if (diff.inHours < 1) return '${diff.inMinutes}m ago';