Enhanced material design 3 implementation
This commit is contained in:
@@ -28,6 +28,8 @@ import '../../widgets/tasq_adaptive_list.dart';
|
||||
import '../../widgets/typing_dots.dart';
|
||||
import '../../theme/app_surfaces.dart';
|
||||
import '../../utils/snackbar.dart';
|
||||
import '../../widgets/app_page_header.dart';
|
||||
import '../../widgets/app_state_view.dart';
|
||||
import '../../utils/subject_suggestions.dart';
|
||||
import '../../widgets/gemini_button.dart';
|
||||
import '../../widgets/gemini_animated_text_field.dart';
|
||||
@@ -156,17 +158,14 @@ class _TasksListScreenState extends ConsumerState<TasksListScreen>
|
||||
builder: (context) {
|
||||
// Show error only when there is genuinely no data.
|
||||
if (tasksAsync.hasError && !tasksAsync.hasValue) {
|
||||
return Center(
|
||||
child: Text('Failed to load tasks: ${tasksAsync.error}'),
|
||||
return AppErrorView(
|
||||
error: tasksAsync.error!,
|
||||
title: 'Could not load tasks',
|
||||
onRetry: () => ref.invalidate(tasksProvider),
|
||||
);
|
||||
}
|
||||
|
||||
final tasks = tasksAsync.valueOrNull ?? <Task>[];
|
||||
|
||||
// True empty state — data loaded but nothing returned.
|
||||
if (tasks.isEmpty && !effectiveShowSkeleton) {
|
||||
return const Center(child: Text('No tasks yet.'));
|
||||
}
|
||||
final offices = officesAsync.valueOrNull ?? <Office>[];
|
||||
final officesSorted = List<Office>.from(offices)
|
||||
..sort(
|
||||
@@ -479,12 +478,12 @@ class _TasksListScreenState extends ConsumerState<TasksListScreen>
|
||||
),
|
||||
],
|
||||
if (hasMention)
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
child: Icon(
|
||||
Icons.circle,
|
||||
size: 10,
|
||||
color: Colors.red,
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -513,17 +512,9 @@ class _TasksListScreenState extends ConsumerState<TasksListScreen>
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16, bottom: 8),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'Tasks',
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.titleLarge
|
||||
?.copyWith(fontWeight: FontWeight.w700),
|
||||
),
|
||||
),
|
||||
const AppPageHeader(
|
||||
title: 'Tasks',
|
||||
subtitle: 'Work items assigned to your team',
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -539,8 +530,28 @@ class _TasksListScreenState extends ConsumerState<TasksListScreen>
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
children: [
|
||||
makeList(myTasks),
|
||||
makeList(filteredTasks),
|
||||
myTasks.isEmpty && !effectiveShowSkeleton
|
||||
? AppEmptyView(
|
||||
icon: Icons.task_outlined,
|
||||
title: _hasTaskFilters
|
||||
? 'No matching tasks'
|
||||
: 'No tasks assigned to you',
|
||||
subtitle: _hasTaskFilters
|
||||
? 'Try adjusting your filters.'
|
||||
: 'Tasks assigned to you will appear here.',
|
||||
)
|
||||
: makeList(myTasks),
|
||||
filteredTasks.isEmpty && !effectiveShowSkeleton
|
||||
? AppEmptyView(
|
||||
icon: Icons.task_alt_outlined,
|
||||
title: _hasTaskFilters
|
||||
? 'No matching tasks'
|
||||
: 'No tasks yet',
|
||||
subtitle: _hasTaskFilters
|
||||
? 'Try adjusting your filters.'
|
||||
: 'Tasks created for your team will appear here.',
|
||||
)
|
||||
: makeList(filteredTasks),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user