Enhanced material design 3 implementation
This commit is contained in:
@@ -14,6 +14,8 @@ import '../../theme/app_surfaces.dart';
|
||||
import '../../providers/user_offices_provider.dart';
|
||||
|
||||
import '../../utils/app_time.dart';
|
||||
import '../../widgets/app_page_header.dart';
|
||||
import '../../widgets/app_state_view.dart';
|
||||
import '../../widgets/mono_text.dart';
|
||||
import '../../widgets/responsive_body.dart';
|
||||
import '../../widgets/tasq_adaptive_list.dart';
|
||||
@@ -105,7 +107,14 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
|
||||
assignmentsAsync.error ??
|
||||
messagesAsync.error ??
|
||||
'Unknown error';
|
||||
return Center(child: Text('Failed to load data: $error'));
|
||||
return AppErrorView(
|
||||
error: error,
|
||||
onRetry: () {
|
||||
ref.invalidate(profilesProvider);
|
||||
ref.invalidate(officesProvider);
|
||||
ref.invalidate(userOfficesProvider);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
final profiles = profilesAsync.valueOrNull ?? [];
|
||||
@@ -124,7 +133,11 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
|
||||
}
|
||||
|
||||
if (profiles.isEmpty) {
|
||||
return const Center(child: Text('No users found.'));
|
||||
return const AppEmptyView(
|
||||
icon: Icons.people_outline,
|
||||
title: 'No users found',
|
||||
subtitle: 'Users who sign up will appear here.',
|
||||
);
|
||||
}
|
||||
|
||||
final query = _searchController.text.trim().toLowerCase();
|
||||
@@ -269,26 +282,16 @@ class _UserManagementScreenState extends ConsumerState<UserManagementScreen> {
|
||||
isLoading: false,
|
||||
);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'User Management',
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.titleLarge?.copyWith(fontWeight: FontWeight.w700),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Expanded(child: listBody),
|
||||
],
|
||||
),
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const AppPageHeader(
|
||||
title: 'User Management',
|
||||
subtitle: 'Manage user roles and office assignments',
|
||||
),
|
||||
Expanded(child: listBody),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user