From 030e01fe0a1a7ff3b5c9770c04c0a834d5cc1a98 Mon Sep 17 00:00:00 2001 From: petlyh <88139840+petlyh@users.noreply.github.com> Date: Tue, 24 Sep 2024 20:39:29 +0200 Subject: [PATCH] Return to using ColorScheme.surfaceVariant While `surfaceVariant` has been deprecated in favor of `surfaceContainerHighest`, the `dynamic_color` package does not yet support it, leading to an incorrect palette. Ignoring the deprecation warnings while waiting for material-foundation/flutter-packages#599. --- lib/screens/search_options/radical_search_screen.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/screens/search_options/radical_search_screen.dart b/lib/screens/search_options/radical_search_screen.dart index 673daf3..14292f0 100644 --- a/lib/screens/search_options/radical_search_screen.dart +++ b/lib/screens/search_options/radical_search_screen.dart @@ -1,3 +1,5 @@ +// ignore_for_file: deprecated_member_use + import "package:collection/collection.dart"; import "package:flutter/material.dart"; import "package:jsdict/jp_text.dart"; @@ -107,7 +109,7 @@ class _RadicalSelection extends StatelessWidget { Widget build(BuildContext context) { final strokeIndicatorColor = Theme.of(context).highlightColor; final textColor = Theme.of(context).textTheme.bodyLarge!.color; - final selectedColor = Theme.of(context).colorScheme.surfaceContainerHighest; + final selectedColor = Theme.of(context).colorScheme.surfaceVariant; final disabledColor = Theme.of(context).focusColor; return SingleChildScrollView( @@ -172,8 +174,7 @@ class _KanjiSelection extends StatelessWidget { @override Widget build(BuildContext context) { final textColor = Theme.of(context).textTheme.bodyLarge!.color; - final backgroundColor = - Theme.of(context).colorScheme.surfaceContainerHighest; + final backgroundColor = Theme.of(context).colorScheme.surfaceVariant; return matchingKanji.isEmpty ? const Center(child: Text("Select radicals"))