2025-01-21 14:24:31 +03:00
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
import 'package:friflex_starter/app/app_context_ext.dart';
|
2025-02-06 09:30:08 +03:00
|
|
|
|
import 'package:friflex_starter/app/theme/app_colors_scheme.dart';
|
|
|
|
|
|
import 'package:friflex_starter/gen/assets.gen.dart';
|
|
|
|
|
|
import 'package:friflex_starter/gen/fonts.gen.dart';
|
2025-01-21 14:24:31 +03:00
|
|
|
|
|
|
|
|
|
|
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(
|
2025-02-06 09:30:08 +03:00
|
|
|
|
child: ListView(
|
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
2025-01-21 14:24:31 +03:00
|
|
|
|
children: [
|
2025-02-06 09:30:08 +03:00
|
|
|
|
Text(
|
2025-02-12 10:53:38 +03:00
|
|
|
|
'Реализация SecureStorage: ${context.di.services.secureStorage.nameImpl}',
|
2025-02-06 09:30:08 +03:00
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
Text(
|
|
|
|
|
|
'Окружение: ${context.di.appConfig.env.name}',
|
|
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
2025-01-21 14:24:31 +03:00
|
|
|
|
ElevatedButton(
|
|
|
|
|
|
onPressed: () {
|
2025-02-06 09:30:08 +03:00
|
|
|
|
context.theme.changeTheme();
|
2025-01-21 14:24:31 +03:00
|
|
|
|
},
|
2025-02-06 09:30:08 +03:00
|
|
|
|
child: const Text('Сменить тему'),
|
|
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
ColoredBox(
|
|
|
|
|
|
color: context.colors.testColor,
|
|
|
|
|
|
child: const SizedBox(height: 100, width: 100),
|
|
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
Text(
|
|
|
|
|
|
'Текущая тема: ${context.theme.themeMode}',
|
|
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
Text(
|
|
|
|
|
|
'Текущий репозиторий: ${context.di.repositories.authRepository.name}',
|
2025-01-21 14:24:31 +03:00
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
ElevatedButton(
|
2025-02-06 09:30:08 +03:00
|
|
|
|
onPressed: () {
|
|
|
|
|
|
context.localization.changeLocal(
|
|
|
|
|
|
const Locale('ru', 'RU'),
|
|
|
|
|
|
);
|
2025-01-21 14:24:31 +03:00
|
|
|
|
},
|
2025-02-06 09:30:08 +03:00
|
|
|
|
child: const Text('Сменить язык на Rусский'),
|
2025-01-21 14:24:31 +03:00
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
ElevatedButton(
|
2025-02-06 09:30:08 +03:00
|
|
|
|
onPressed: () {
|
|
|
|
|
|
context.localization.changeLocal(
|
|
|
|
|
|
const Locale('en', 'EN'),
|
|
|
|
|
|
);
|
2025-01-21 14:24:31 +03:00
|
|
|
|
},
|
2025-02-06 09:30:08 +03:00
|
|
|
|
child: const Text('Сменить язык на Английский'),
|
2025-01-21 14:24:31 +03:00
|
|
|
|
),
|
2025-02-06 09:30:08 +03:00
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
Text(
|
|
|
|
|
|
'Тестовое слово montserrat bold: ${context.l10n.helloWorld}',
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
color: context.colors.testColor,
|
|
|
|
|
|
fontFamily: Assets.fonts.montserratBold,
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
Text(
|
|
|
|
|
|
'Тестовое слово montserrat medium: ${context.l10n.helloWorld}',
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
color: context.colors.testColor,
|
|
|
|
|
|
fontFamily: FontFamily.montserrat,
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
Text(
|
|
|
|
|
|
'Текущий язык: ${context.l10n.localeName}',
|
|
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
const Text('Тестовая иконка из assets'),
|
2025-02-12 10:53:38 +03:00
|
|
|
|
const SizedBox(height: 16),
|
2025-02-06 09:30:08 +03:00
|
|
|
|
Assets.icons.home.svg(),
|
2025-02-12 10:53:38 +03:00
|
|
|
|
ElevatedButton(
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
throw Exception(
|
|
|
|
|
|
'Тестовая ошибка Exception для отладки FlutterError',
|
|
|
|
|
|
);
|
|
|
|
|
|
},
|
|
|
|
|
|
child: const Text('Вызывать ошибку FlutterError'),
|
|
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
ElevatedButton(
|
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
await _callError();
|
|
|
|
|
|
},
|
|
|
|
|
|
child: const Text('Вызывать ошибку PlatformDispatcher'),
|
|
|
|
|
|
),
|
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
|
ElevatedButton(
|
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
await context.di.debugService.openDebugScreen(context);
|
|
|
|
|
|
},
|
|
|
|
|
|
child: const Text('Вызывать Экран отладки'),
|
|
|
|
|
|
),
|
2025-01-21 14:24:31 +03:00
|
|
|
|
],
|
|
|
|
|
|
),
|
|
|
|
|
|
),
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-02-12 10:53:38 +03:00
|
|
|
|
Future<void> _callError() async {
|
2025-01-21 14:24:31 +03:00
|
|
|
|
throw Exception('Тестовая ошибка Exception для отладки PlatformDispatcher');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|