@@ -9,7 +9,7 @@ import 'package:material_color_utilities/material_color_utilities.dart';
99import 'colors.dart' ;
1010import 'theme_data.dart' ;
1111
12- /// A set of 25 colors based on the
12+ /// A set of 30 colors based on the
1313/// [Material spec] (https://m3.material.io/styles/color/the-color-system/color-roles)
1414/// that can be used to configure the color properties of most components.
1515///
@@ -100,7 +100,9 @@ class ColorScheme with Diagnosticable {
100100 Color ? surfaceVariant,
101101 Color ? onSurfaceVariant,
102102 Color ? outline,
103+ Color ? outlineVariant,
103104 Color ? shadow,
105+ Color ? scrim,
104106 Color ? inverseSurface,
105107 Color ? onInverseSurface,
106108 Color ? inversePrimary,
@@ -139,7 +141,9 @@ class ColorScheme with Diagnosticable {
139141 _surfaceVariant = surfaceVariant,
140142 _onSurfaceVariant = onSurfaceVariant,
141143 _outline = outline,
144+ _outlineVariant = outlineVariant,
142145 _shadow = shadow,
146+ _scrim = scrim,
143147 _inverseSurface = inverseSurface,
144148 _onInverseSurface = onInverseSurface,
145149 _inversePrimary = inversePrimary,
@@ -189,6 +193,7 @@ class ColorScheme with Diagnosticable {
189193 Color ? errorContainer,
190194 Color ? onErrorContainer,
191195 Color ? outline,
196+ Color ? outlineVariant,
192197 Color ? background,
193198 Color ? onBackground,
194199 Color ? surface,
@@ -199,6 +204,7 @@ class ColorScheme with Diagnosticable {
199204 Color ? onInverseSurface,
200205 Color ? inversePrimary,
201206 Color ? shadow,
207+ Color ? scrim,
202208 Color ? surfaceTint,
203209 }) {
204210 final Scheme scheme;
@@ -228,6 +234,7 @@ class ColorScheme with Diagnosticable {
228234 errorContainer: errorContainer ?? Color (scheme.errorContainer),
229235 onErrorContainer: onErrorContainer ?? Color (scheme.onErrorContainer),
230236 outline: outline ?? Color (scheme.outline),
237+ outlineVariant: outlineVariant ?? Color (scheme.outlineVariant),
231238 background: background ?? Color (scheme.background),
232239 onBackground: onBackground ?? Color (scheme.onBackground),
233240 surface: surface ?? Color (scheme.surface),
@@ -238,6 +245,7 @@ class ColorScheme with Diagnosticable {
238245 onInverseSurface: onInverseSurface ?? Color (scheme.inverseOnSurface),
239246 inversePrimary: inversePrimary ?? Color (scheme.inversePrimary),
240247 shadow: shadow ?? Color (scheme.shadow),
248+ scrim: scrim ?? Color (scheme.scrim),
241249 surfaceTint: surfaceTint ?? Color (scheme.primary),
242250 brightness: brightness,
243251 );
@@ -270,7 +278,9 @@ class ColorScheme with Diagnosticable {
270278 Color ? surfaceVariant,
271279 Color ? onSurfaceVariant,
272280 Color ? outline,
281+ Color ? outlineVariant,
273282 Color ? shadow,
283+ Color ? scrim,
274284 Color ? inverseSurface,
275285 Color ? onInverseSurface,
276286 Color ? inversePrimary,
@@ -309,7 +319,9 @@ class ColorScheme with Diagnosticable {
309319 _surfaceVariant = surfaceVariant,
310320 _onSurfaceVariant = onSurfaceVariant,
311321 _outline = outline,
322+ _outlineVariant = outlineVariant,
312323 _shadow = shadow,
324+ _scrim = scrim,
313325 _inverseSurface = inverseSurface,
314326 _onInverseSurface = onInverseSurface,
315327 _inversePrimary = inversePrimary,
@@ -344,7 +356,9 @@ class ColorScheme with Diagnosticable {
344356 Color ? surfaceVariant,
345357 Color ? onSurfaceVariant,
346358 Color ? outline,
359+ Color ? outlineVariant,
347360 Color ? shadow,
361+ Color ? scrim,
348362 Color ? inverseSurface,
349363 Color ? onInverseSurface,
350364 Color ? inversePrimary,
@@ -383,7 +397,9 @@ class ColorScheme with Diagnosticable {
383397 _surfaceVariant = surfaceVariant,
384398 _onSurfaceVariant = onSurfaceVariant,
385399 _outline = outline,
400+ _outlineVariant = outlineVariant,
386401 _shadow = shadow,
402+ _scrim = scrim,
387403 _inverseSurface = inverseSurface,
388404 _onInverseSurface = onInverseSurface,
389405 _inversePrimary = inversePrimary,
@@ -418,7 +434,9 @@ class ColorScheme with Diagnosticable {
418434 Color ? surfaceVariant,
419435 Color ? onSurfaceVariant,
420436 Color ? outline,
437+ Color ? outlineVariant,
421438 Color ? shadow,
439+ Color ? scrim,
422440 Color ? inverseSurface,
423441 Color ? onInverseSurface,
424442 Color ? inversePrimary,
@@ -457,7 +475,9 @@ class ColorScheme with Diagnosticable {
457475 _surfaceVariant = surfaceVariant,
458476 _onSurfaceVariant = onSurfaceVariant,
459477 _outline = outline,
478+ _outlineVariant = outlineVariant,
460479 _shadow = shadow,
480+ _scrim = scrim,
461481 _inverseSurface = inverseSurface,
462482 _onInverseSurface = onInverseSurface,
463483 _inversePrimary = inversePrimary,
@@ -492,7 +512,9 @@ class ColorScheme with Diagnosticable {
492512 Color ? surfaceVariant,
493513 Color ? onSurfaceVariant,
494514 Color ? outline,
515+ Color ? outlineVariant,
495516 Color ? shadow,
517+ Color ? scrim,
496518 Color ? inverseSurface,
497519 Color ? onInverseSurface,
498520 Color ? inversePrimary,
@@ -531,7 +553,9 @@ class ColorScheme with Diagnosticable {
531553 _surfaceVariant = surfaceVariant,
532554 _onSurfaceVariant = onSurfaceVariant,
533555 _outline = outline,
556+ _outlineVariant = outlineVariant,
534557 _shadow = shadow,
558+ _scrim = scrim,
535559 _inverseSurface = inverseSurface,
536560 _onInverseSurface = onInverseSurface,
537561 _inversePrimary = inversePrimary,
@@ -718,10 +742,19 @@ class ColorScheme with Diagnosticable {
718742 /// A utility color that creates boundaries and emphasis to improve usability.
719743 Color get outline => _outline ?? onBackground;
720744
745+ final Color ? _outlineVariant;
746+ /// A utility color that creates boundaries for decorative elements when a
747+ /// 3:1 contrast isn’t required, such as for dividers or decorative elements.
748+ Color get outlineVariant => _outlineVariant ?? onBackground;
749+
721750 final Color ? _shadow;
722751 /// A color use to paint the drop shadows of elevated components.
723752 Color get shadow => _shadow ?? const Color (0xff000000 );
724753
754+ final Color ? _scrim;
755+ /// A color use to paint the scrim around of modal components.
756+ Color get scrim => _scrim ?? const Color (0xff000000 );
757+
725758 final Color ? _inverseSurface;
726759 /// A surface color used for displaying the reverse of what’s seen in the
727760 /// surrounding UI, for example in a SnackBar to bring attention to
@@ -790,7 +823,9 @@ class ColorScheme with Diagnosticable {
790823 Color ? surfaceVariant,
791824 Color ? onSurfaceVariant,
792825 Color ? outline,
826+ Color ? outlineVariant,
793827 Color ? shadow,
828+ Color ? scrim,
794829 Color ? inverseSurface,
795830 Color ? onInverseSurface,
796831 Color ? inversePrimary,
@@ -831,7 +866,9 @@ class ColorScheme with Diagnosticable {
831866 surfaceVariant : surfaceVariant ?? this .surfaceVariant,
832867 onSurfaceVariant : onSurfaceVariant ?? this .onSurfaceVariant,
833868 outline : outline ?? this .outline,
869+ outlineVariant : outlineVariant ?? this .outlineVariant,
834870 shadow : shadow ?? this .shadow,
871+ scrim : scrim ?? this .scrim,
835872 inverseSurface : inverseSurface ?? this .inverseSurface,
836873 onInverseSurface : onInverseSurface ?? this .onInverseSurface,
837874 inversePrimary : inversePrimary ?? this .inversePrimary,
@@ -870,7 +907,9 @@ class ColorScheme with Diagnosticable {
870907 surfaceVariant: Color .lerp (a.surfaceVariant, b.surfaceVariant, t),
871908 onSurfaceVariant: Color .lerp (a.onSurfaceVariant, b.onSurfaceVariant, t),
872909 outline: Color .lerp (a.outline, b.outline, t),
910+ outlineVariant: Color .lerp (a.outlineVariant, b.outlineVariant, t),
873911 shadow: Color .lerp (a.shadow, b.shadow, t),
912+ scrim: Color .lerp (a.scrim, b.scrim, t),
874913 inverseSurface: Color .lerp (a.inverseSurface, b.inverseSurface, t),
875914 onInverseSurface: Color .lerp (a.onInverseSurface, b.onInverseSurface, t),
876915 inversePrimary: Color .lerp (a.inversePrimary, b.inversePrimary, t),
@@ -913,7 +952,9 @@ class ColorScheme with Diagnosticable {
913952 && other.surfaceVariant == surfaceVariant
914953 && other.onSurfaceVariant == onSurfaceVariant
915954 && other.outline == outline
955+ && other.outlineVariant == outlineVariant
916956 && other.shadow == shadow
957+ && other.scrim == scrim
917958 && other.inverseSurface == inverseSurface
918959 && other.onInverseSurface == onInverseSurface
919960 && other.inversePrimary == inversePrimary
@@ -949,7 +990,9 @@ class ColorScheme with Diagnosticable {
949990 surfaceVariant,
950991 onSurfaceVariant,
951992 outline,
993+ outlineVariant,
952994 shadow,
995+ scrim,
953996 inverseSurface,
954997 onInverseSurface,
955998 inversePrimary,
@@ -987,7 +1030,9 @@ class ColorScheme with Diagnosticable {
9871030 properties.add (ColorProperty ('surfaceVariant' , surfaceVariant, defaultValue: defaultScheme.surfaceVariant));
9881031 properties.add (ColorProperty ('onSurfaceVariant' , onSurfaceVariant, defaultValue: defaultScheme.onSurfaceVariant));
9891032 properties.add (ColorProperty ('outline' , outline, defaultValue: defaultScheme.outline));
1033+ properties.add (ColorProperty ('outlineVariant' , outlineVariant, defaultValue: defaultScheme.outlineVariant));
9901034 properties.add (ColorProperty ('shadow' , shadow, defaultValue: defaultScheme.shadow));
1035+ properties.add (ColorProperty ('scrim' , scrim, defaultValue: defaultScheme.scrim));
9911036 properties.add (ColorProperty ('inverseSurface' , inverseSurface, defaultValue: defaultScheme.inverseSurface));
9921037 properties.add (ColorProperty ('onInverseSurface' , onInverseSurface, defaultValue: defaultScheme.onInverseSurface));
9931038 properties.add (ColorProperty ('inversePrimary' , inversePrimary, defaultValue: defaultScheme.inversePrimary));
0 commit comments