Files
kooltab/lib/views/error_screen_view.dart
T

65 lines
2.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
class ErrorScreenView extends StatelessWidget {
const ErrorScreenView({super.key});
@override
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
return Scaffold(
appBar: AppBar(
leading: IconButton(
onPressed: () => context.pop(),
icon: const Icon(Icons.arrow_back),
),
title: const Text('Error Screen'),
centerTitle: true,
),
body: Center(
child: Padding(
padding: const EdgeInsets.all(32),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: scheme.error.withValues(alpha: 0.12),
),
child: Icon(
Icons.error_outline_rounded,
size: 64,
color: scheme.error,
),
),
const SizedBox(height: 24),
Text(
'Something went wrong',
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
color: scheme.error,
),
),
const SizedBox(height: 12),
Text(
'An unexpected error occurred.\nPlease try restarting the app.',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: scheme.onSurface.withValues(alpha: 0.6),
),
),
const SizedBox(height: 32),
FilledButton.icon(
onPressed: () => context.go('/bar'),
icon: const Icon(Icons.home_rounded),
label: const Text('Go to bar screen'),
),
],
),
),
),
);
}
}