mirror of
https://github.com/smmarty/friflex_flutter_starter.git
synced 2025-12-22 01:20:46 +00:00
97 lines
3.3 KiB
Dart
97 lines
3.3 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|||
|
|
import 'package:friflex_starter/app/app_box.dart';
|
|||
|
|
import 'package:friflex_starter/app/app_context_ext.dart';
|
|||
|
|
import 'package:friflex_starter/features/debug/debug_routes.dart';
|
|||
|
|
import 'package:go_router/go_router.dart';
|
|||
|
|
|
|||
|
|
class DebugScreen extends StatelessWidget {
|
|||
|
|
const DebugScreen({Key? key}) : super(key: key);
|
|||
|
|
|
|||
|
|
@override
|
|||
|
|
Widget build(BuildContext context) {
|
|||
|
|
return Scaffold(
|
|||
|
|
appBar: AppBar(title: const Text('Debug Screen')),
|
|||
|
|
body: Center(
|
|||
|
|
child: ListView(
|
|||
|
|
padding: const EdgeInsets.all(16),
|
|||
|
|
children: [
|
|||
|
|
Text(
|
|||
|
|
'Окружение: ${context.di.appConfig.env.name}',
|
|||
|
|
),
|
|||
|
|
const HBox(22),
|
|||
|
|
Text(
|
|||
|
|
'Реализация AppServices: ${context.di.services.secureStorage.nameImpl}',
|
|||
|
|
),
|
|||
|
|
const HBox(22),
|
|||
|
|
ElevatedButton(
|
|||
|
|
onPressed: () async {
|
|||
|
|
await context.di.debugService.openDebugScreen(context);
|
|||
|
|
},
|
|||
|
|
child: const Text('Вызывать Экран отладки'),
|
|||
|
|
),
|
|||
|
|
const HBox(22),
|
|||
|
|
const Text('Экраны для отладки:'),
|
|||
|
|
const HBox(16),
|
|||
|
|
ElevatedButton(
|
|||
|
|
onPressed: () {
|
|||
|
|
context.pushNamed(DebugRoutes.iconsScreenName);
|
|||
|
|
},
|
|||
|
|
child: const Text('Экран с иконками'),
|
|||
|
|
),
|
|||
|
|
const HBox(16),
|
|||
|
|
ElevatedButton(
|
|||
|
|
onPressed: () {
|
|||
|
|
context.pushNamed(DebugRoutes.themeScreenName);
|
|||
|
|
},
|
|||
|
|
child: const Text('Экран настроек темы'),
|
|||
|
|
),
|
|||
|
|
const HBox(16),
|
|||
|
|
ElevatedButton(
|
|||
|
|
onPressed: () {
|
|||
|
|
context.pushNamed(DebugRoutes.tokensScreenName);
|
|||
|
|
},
|
|||
|
|
child: const Text('Экран с токенами'),
|
|||
|
|
),
|
|||
|
|
const HBox(16),
|
|||
|
|
ElevatedButton(
|
|||
|
|
onPressed: () {
|
|||
|
|
context.pushNamed(DebugRoutes.uiKitScreenName);
|
|||
|
|
},
|
|||
|
|
child: const Text('Экран UI Kit'),
|
|||
|
|
),
|
|||
|
|
const HBox(16),
|
|||
|
|
ElevatedButton(
|
|||
|
|
onPressed: () {
|
|||
|
|
context.pushNamed(DebugRoutes.langScreenName);
|
|||
|
|
},
|
|||
|
|
child: const Text('Экран локализации'),
|
|||
|
|
),
|
|||
|
|
const HBox(22),
|
|||
|
|
const Text('Имитирование ошибок:'),
|
|||
|
|
const HBox(16),
|
|||
|
|
ElevatedButton(
|
|||
|
|
onPressed: () {
|
|||
|
|
throw Exception(
|
|||
|
|
'Тестовая ошибка Exception для отладки FlutterError',
|
|||
|
|
);
|
|||
|
|
},
|
|||
|
|
child: const Text('Вызывать ошибку FlutterError'),
|
|||
|
|
),
|
|||
|
|
const HBox(16),
|
|||
|
|
ElevatedButton(
|
|||
|
|
onPressed: () async {
|
|||
|
|
await _callError();
|
|||
|
|
},
|
|||
|
|
child: const Text('Вызывать ошибку PlatformDispatcher'),
|
|||
|
|
),
|
|||
|
|
],
|
|||
|
|
),
|
|||
|
|
),
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Future<void> _callError() async {
|
|||
|
|
throw Exception('Тестовая ошибка Exception для отладки PlatformDispatcher');
|
|||
|
|
}
|
|||
|
|
}
|