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:
@@ -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),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user