Add back button on ticket and task detail screens

This commit is contained in:
2026-03-03 18:15:18 +08:00
parent d9270b3edf
commit 1e678ea2e5
2 changed files with 101 additions and 77 deletions
+31 -21
View File
@@ -199,7 +199,21 @@ class _TicketDetailScreenState extends ConsumerState<TicketDetailScreen> {
final detailsCard = Card(
child: Padding(
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) {
return Row(
children: [
Expanded(flex: 2, child: detailsCard),
const SizedBox(width: 16),
Expanded(flex: 3, child: messagesCard),
],
);
}
final mainContent = isWide
? Row(
children: [
Expanded(flex: 2, child: detailsCard),
const SizedBox(width: 16),
Expanded(flex: 3, child: messagesCard),
],
)
: Column(
children: [
detailsCard,
const SizedBox(height: 12),
Expanded(child: messagesCard),
],
);
// 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: [
detailsCard,
const SizedBox(height: 12),
Expanded(child: messagesCard),
],
);
return mainContent;
},
),
);