mirror of
https://github.com/smmarty/friflex_flutter_starter.git
synced 2025-12-22 09:30:45 +00:00
feat(theme): Добавить ThemeExtension для токенов цвета (#12)
* feat * fix * fix: исправил ширину строки * feat: добавить визуальный элемент
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:friflex_starter/app/app_context_ext.dart';
|
||||
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';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:friflex_starter/app/app_context_ext.dart';
|
||||
import 'package:friflex_starter/app/theme/app_colors_scheme.dart';
|
||||
|
||||
/// {@template ThemeScreen}
|
||||
/// Экран для отладки темы приложения
|
||||
@@ -11,6 +10,7 @@ class ThemeScreen extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = context.colors;
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Theme')),
|
||||
body: Center(
|
||||
@@ -29,7 +29,25 @@ class ThemeScreen extends StatelessWidget {
|
||||
child: const SizedBox(height: 100, width: 100),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text('Текущая тема: ${context.theme.themeMode}'),
|
||||
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),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user