mirror of
https://github.com/smmarty/friflex_flutter_starter.git
synced 2025-12-22 01:20:46 +00:00
feat(app): Вынести инициализацию приложения за splash (#4)
Co-authored-by: PetrovY <y.petrov@friflex.com>
This commit is contained in:
@@ -5,16 +5,42 @@ import 'package:flutter/material.dart';
|
||||
/// {@endtemplate}
|
||||
class ErrorScreen extends StatelessWidget {
|
||||
/// {@macro ErrorScreen}
|
||||
const ErrorScreen({super.key});
|
||||
const ErrorScreen({
|
||||
super.key,
|
||||
required this.error,
|
||||
required this.stackTrace,
|
||||
this.onRetry,
|
||||
});
|
||||
|
||||
final Object? error;
|
||||
final StackTrace? stackTrace;
|
||||
final VoidCallback? onRetry;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
body: Center(
|
||||
child: Text(
|
||||
'Что-то пошло не так, попробуйте перезагрузить приложение',
|
||||
textAlign: TextAlign.center,
|
||||
body: SafeArea(
|
||||
child: Center(
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
ElevatedButton(
|
||||
onPressed: onRetry,
|
||||
child: const Text('Перезагрузить приложение'),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'''
|
||||
Что-то пошло не так, попробуйте перезагрузить приложение
|
||||
error: $error
|
||||
stackTrace: $stackTrace
|
||||
''',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user