1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

Update ColorScheme to show the newly added color roles (#2299)

This PR is to fix #2289 and add newly added `ColorScheme` roles since
https://github.com/flutter/flutter/pull/144273

---------

Co-authored-by: Parker Lougheed <parlough@gmail.com>
This commit is contained in:
Qun Cheng
2024-05-22 18:22:04 +00:00
committed by GitHub
parent 10776a097c
commit 649e0e4db9
3 changed files with 173 additions and 101 deletions

View File

@@ -311,9 +311,8 @@ class _ColorSeedButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return PopupMenuButton(
icon: Icon(
icon: const Icon(
Icons.palette_outlined,
color: Theme.of(context).colorScheme.surfaceContainerHighest,
),
tooltip: 'Select a seed color',
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
@@ -365,16 +364,14 @@ class _ColorImageButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return PopupMenuButton(
icon: Icon(
icon: const Icon(
Icons.image_outlined,
color: Theme.of(context).colorScheme.surfaceContainerHighest,
),
tooltip: 'Select a color extraction image',
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
itemBuilder: (context) {
return List.generate(ColorImageProvider.values.length, (index) {
ColorImageProvider currentImageProvider =
ColorImageProvider.values[index];
final currentImageProvider = ColorImageProvider.values[index];
return PopupMenuItem(
value: index,
@@ -392,8 +389,7 @@ class _ColorImageButton extends StatelessWidget {
child: ClipRRect(
borderRadius: BorderRadius.circular(8.0),
child: Image(
image: NetworkImage(
ColorImageProvider.values[index].url),
image: NetworkImage(currentImageProvider.url),
),
),
),