chore: fix Flutter baseline checks

This commit is contained in:
Artem Kokos
2026-04-22 21:08:02 +07:00
parent 8198ea09ae
commit ffc2ea1544
12 changed files with 68 additions and 54 deletions

View File

@@ -23,6 +23,9 @@ class _GroupCardState extends ConsumerState<GroupCard> {
double? _localBrightness;
double? _localTemp;
int _channelValue(double channel) =>
(channel * 255.0).round().clamp(0, 255);
@override
Widget build(BuildContext context) {
final g = widget.group;
@@ -53,7 +56,10 @@ class _GroupCardState extends ConsumerState<GroupCard> {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: isOn
? Border.all(color: cardAccent.withOpacity(0.3), width: 1)
? Border.all(
color: cardAccent.withValues(alpha: 0.3),
width: 1,
)
: null,
),
child: Padding(
@@ -84,7 +90,7 @@ class _GroupCardState extends ConsumerState<GroupCard> {
),
Switch(
value: isOn,
activeColor: Colors.deepOrange,
activeThumbColor: Colors.deepOrange,
onChanged: (v) =>
ref.read(groupsProvider.notifier).toggleGroup(id, v),
),
@@ -166,7 +172,12 @@ class _GroupCardState extends ConsumerState<GroupCard> {
initialColor: Color.fromARGB(255, r, gVal, b),
onColorChanged: (c) {
// Обновление UI-превью -- через debounce отправляется на сервер
ref.read(groupsProvider.notifier).setColor(id, c.red, c.green, c.blue);
ref.read(groupsProvider.notifier).setColor(
id,
_channelValue(c.r),
_channelValue(c.g),
_channelValue(c.b),
);
},
),
@@ -257,7 +268,9 @@ class _ModeChip extends StatelessWidget {
duration: const Duration(milliseconds: 200),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
decoration: BoxDecoration(
color: selected ? Colors.deepOrange.withOpacity(0.2) : Colors.white10,
color: selected
? Colors.deepOrange.withValues(alpha: 0.2)
: Colors.white10,
borderRadius: BorderRadius.circular(20),
border: selected
? Border.all(color: Colors.deepOrange, width: 1)