mirror of
https://github.com/flutter/samples.git
synced 2026-05-14 02:47:42 +00:00
Add image-based color selection to M3 demo (#1703)
* Add ColorScheme.fromImageProvider selection method * method cleanup * cleanup * Move changes to experimental/ * Move changes from stable branch * update image descriptions * update image selection border * add mac network permissions * comment responses
This commit is contained in:
@@ -13,6 +13,13 @@ const double largeWidthBreakpoint = 1500;
|
||||
|
||||
const double transitionLength = 500;
|
||||
|
||||
// Whether the user has chosen a theme color via a direct [ColorSeed] selection,
|
||||
// or an image [ColorImageProvider].
|
||||
enum ColorSelectionMethod {
|
||||
colorSeed,
|
||||
image,
|
||||
}
|
||||
|
||||
enum ColorSeed {
|
||||
baseColor('M3 Baseline', Color(0xff6750a4)),
|
||||
indigo('Indigo', Colors.indigo),
|
||||
@@ -29,6 +36,19 @@ enum ColorSeed {
|
||||
final Color color;
|
||||
}
|
||||
|
||||
enum ColorImageProvider {
|
||||
leaves('Leaves', 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_1.png'),
|
||||
peonies('Peonies', 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_2.png'),
|
||||
bubbles('Bubbles', 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_3.png'),
|
||||
seaweed('Seaweed', 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_4.png'),
|
||||
seagrapes('Sea Grapes', 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_5.png'),
|
||||
petals('Petals', 'https://flutter.github.io/assets-for-api-docs/assets/material/content_based_color_scheme_6.png');
|
||||
|
||||
const ColorImageProvider(this.label, this.url);
|
||||
final String label;
|
||||
final String url;
|
||||
}
|
||||
|
||||
enum ScreenSelected {
|
||||
component(0),
|
||||
color(1),
|
||||
|
||||
Reference in New Issue
Block a user