Add back button on ticket and task detail screens

This commit is contained in:
Marc Rejohn Castillano 2026-03-03 18:15:18 +08:00
parent d9270b3edf
commit 1e678ea2e5
2 changed files with 101 additions and 77 deletions

View File

@ -2400,7 +2400,21 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
final detailsCard = Card( final detailsCard = Card(
child: Padding( child: Padding(
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(20),
child: SingleChildScrollView(child: detailsContent), child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Align(
alignment: Alignment.topLeft,
child: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () => Navigator.of(context).pop(),
),
),
detailsContent,
],
),
),
), ),
); );
@ -2605,27 +2619,24 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
), ),
); );
if (isWide) { final mainContent = isWide
return Row( ? Row(
children: [ children: [
Expanded(flex: 2, child: detailsCard), Expanded(flex: 2, child: detailsCard),
const SizedBox(width: 16), const SizedBox(width: 16),
Expanded(flex: 3, child: tabbedCard), Expanded(flex: 3, child: tabbedCard),
], ],
); )
} : Stack(
// Mobile/tablet: allow vertical scrolling of detail card while
// keeping the chat/activity panel filling the remaining viewport
// (and scrolling internally). Use a CustomScrollView to provide a
// bounded height for the tabbed card via SliverFillRemaining.
return Stack(
children: [ children: [
CustomScrollView( CustomScrollView(
slivers: [ slivers: [
SliverToBoxAdapter(child: detailsCard), SliverToBoxAdapter(child: detailsCard),
const SliverToBoxAdapter(child: SizedBox(height: 12)), const SliverToBoxAdapter(child: SizedBox(height: 12)),
SliverFillRemaining(hasScrollBody: true, child: tabbedCard), SliverFillRemaining(
hasScrollBody: true,
child: tabbedCard,
),
], ],
), ),
if (isRetrieving) if (isRetrieving)
@ -2633,9 +2644,8 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
child: AbsorbPointer( child: AbsorbPointer(
absorbing: true, absorbing: true,
child: Container( child: Container(
color: Theme.of( color: Theme.of(context).colorScheme.surface
context, .withAlpha((0.35 * 255).round()),
).colorScheme.surface.withAlpha((0.35 * 255).round()),
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
padding: const EdgeInsets.only(top: 36), padding: const EdgeInsets.only(top: 36),
child: SizedBox( child: SizedBox(
@ -2655,7 +2665,9 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
), ),
), ),
SizedBox(width: 12), SizedBox(width: 12),
Expanded(child: Text('Retrieving updates…')), Expanded(
child: Text('Retrieving updates…'),
),
], ],
), ),
), ),
@ -2666,6 +2678,8 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
), ),
], ],
); );
return mainContent;
}, },
), ),
), ),

View File

@ -199,7 +199,21 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
final detailsCard = Card( final detailsCard = Card(
child: Padding( child: Padding(
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(20),
child: SingleChildScrollView(child: detailsContent), child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Align(
alignment: Alignment.topLeft,
child: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () => Navigator.of(context).pop(),
),
),
detailsContent,
],
),
),
), ),
); );
@ -437,27 +451,23 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
), ),
); );
if (isWide) { final mainContent = isWide
return Row( ? Row(
children: [ children: [
Expanded(flex: 2, child: detailsCard), Expanded(flex: 2, child: detailsCard),
const SizedBox(width: 16), const SizedBox(width: 16),
Expanded(flex: 3, child: messagesCard), Expanded(flex: 3, child: messagesCard),
], ],
); )
} : Column(
// Mobile: avoid nesting scrollables. detailsCard itself is
// scrollable if it grows tall, and the messages area takes the
// remaining space so the chat list can always receive touch
// gestures and never end up offscreen.
return Column(
children: [ children: [
detailsCard, detailsCard,
const SizedBox(height: 12), const SizedBox(height: 12),
Expanded(child: messagesCard), Expanded(child: messagesCard),
], ],
); );
return mainContent;
}, },
), ),
); );