2025-04-27 17:08:34 +03:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:friflex_starter/app/app_context_ext.dart';
|
2025-06-19 12:51:57 +03:00
|
|
|
import 'package:friflex_starter/app/theme/app_colors_scheme.dart';
|
2025-04-27 17:08:34 +03:00
|
|
|
|
|
|
|
|
/// {@template ThemeScreen}
|
|
|
|
|
/// Экран для отладки темы приложения
|
|
|
|
|
/// {@endtemplate}
|
|
|
|
|
class ThemeScreen extends StatelessWidget {
|
|
|
|
|
/// {@macro ThemeScreen}
|
|
|
|
|
const ThemeScreen({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2025-06-19 12:51:57 +03:00
|
|
|
final colors = context.appColors;
|
2025-04-27 17:08:34 +03:00
|
|
|
return Scaffold(
|
|
|
|
|
appBar: AppBar(title: const Text('Theme')),
|
|
|
|
|
body: Center(
|
|
|
|
|
child: ListView(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
children: [
|
|
|
|
|
ElevatedButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
context.theme.changeTheme();
|
|
|
|
|
},
|
|
|
|
|
child: const Text('Сменить тему'),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
|
ColoredBox(
|
2025-06-19 12:51:57 +03:00
|
|
|
color: context.appColors.testColor,
|
2025-04-27 17:08:34 +03:00
|
|
|
child: const SizedBox(height: 100, width: 100),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 16),
|
2025-06-18 18:54:32 +07:00
|
|
|
Card(
|
|
|
|
|
elevation: 4,
|
|
|
|
|
shadowColor: colors.infoSnackbarBackground,
|
|
|
|
|
margin: const EdgeInsets.symmetric(vertical: 10),
|
|
|
|
|
color: colors.infoSnackbarBackground,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(16),
|
|
|
|
|
),
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: Text(
|
|
|
|
|
'Текущая тема: ${context.theme.themeMode}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: colors.itemTextColor,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
trailing: Icon(Icons.color_lens, color: colors.itemTextColor),
|
|
|
|
|
),
|
|
|
|
|
),
|
2025-04-27 17:08:34 +03:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|