@@ -9,7 +9,7 @@ import 'package:material_color_utilities/material_color_utilities.dart';
9
9
import 'colors.dart' ;
10
10
import 'theme_data.dart' ;
11
11
12
- /// A set of 25 colors based on the
12
+ /// A set of 30 colors based on the
13
13
/// [Material spec] (https://m3.material.io/styles/color/the-color-system/color-roles)
14
14
/// that can be used to configure the color properties of most components.
15
15
///
@@ -100,7 +100,9 @@ class ColorScheme with Diagnosticable {
100
100
Color ? surfaceVariant,
101
101
Color ? onSurfaceVariant,
102
102
Color ? outline,
103
+ Color ? outlineVariant,
103
104
Color ? shadow,
105
+ Color ? scrim,
104
106
Color ? inverseSurface,
105
107
Color ? onInverseSurface,
106
108
Color ? inversePrimary,
@@ -139,7 +141,9 @@ class ColorScheme with Diagnosticable {
139
141
_surfaceVariant = surfaceVariant,
140
142
_onSurfaceVariant = onSurfaceVariant,
141
143
_outline = outline,
144
+ _outlineVariant = outlineVariant,
142
145
_shadow = shadow,
146
+ _scrim = scrim,
143
147
_inverseSurface = inverseSurface,
144
148
_onInverseSurface = onInverseSurface,
145
149
_inversePrimary = inversePrimary,
@@ -189,6 +193,7 @@ class ColorScheme with Diagnosticable {
189
193
Color ? errorContainer,
190
194
Color ? onErrorContainer,
191
195
Color ? outline,
196
+ Color ? outlineVariant,
192
197
Color ? background,
193
198
Color ? onBackground,
194
199
Color ? surface,
@@ -199,6 +204,7 @@ class ColorScheme with Diagnosticable {
199
204
Color ? onInverseSurface,
200
205
Color ? inversePrimary,
201
206
Color ? shadow,
207
+ Color ? scrim,
202
208
Color ? surfaceTint,
203
209
}) {
204
210
final Scheme scheme;
@@ -228,6 +234,7 @@ class ColorScheme with Diagnosticable {
228
234
errorContainer: errorContainer ?? Color (scheme.errorContainer),
229
235
onErrorContainer: onErrorContainer ?? Color (scheme.onErrorContainer),
230
236
outline: outline ?? Color (scheme.outline),
237
+ outlineVariant: outlineVariant ?? Color (scheme.outlineVariant),
231
238
background: background ?? Color (scheme.background),
232
239
onBackground: onBackground ?? Color (scheme.onBackground),
233
240
surface: surface ?? Color (scheme.surface),
@@ -238,6 +245,7 @@ class ColorScheme with Diagnosticable {
238
245
onInverseSurface: onInverseSurface ?? Color (scheme.inverseOnSurface),
239
246
inversePrimary: inversePrimary ?? Color (scheme.inversePrimary),
240
247
shadow: shadow ?? Color (scheme.shadow),
248
+ scrim: scrim ?? Color (scheme.scrim),
241
249
surfaceTint: surfaceTint ?? Color (scheme.primary),
242
250
brightness: brightness,
243
251
);
@@ -270,7 +278,9 @@ class ColorScheme with Diagnosticable {
270
278
Color ? surfaceVariant,
271
279
Color ? onSurfaceVariant,
272
280
Color ? outline,
281
+ Color ? outlineVariant,
273
282
Color ? shadow,
283
+ Color ? scrim,
274
284
Color ? inverseSurface,
275
285
Color ? onInverseSurface,
276
286
Color ? inversePrimary,
@@ -309,7 +319,9 @@ class ColorScheme with Diagnosticable {
309
319
_surfaceVariant = surfaceVariant,
310
320
_onSurfaceVariant = onSurfaceVariant,
311
321
_outline = outline,
322
+ _outlineVariant = outlineVariant,
312
323
_shadow = shadow,
324
+ _scrim = scrim,
313
325
_inverseSurface = inverseSurface,
314
326
_onInverseSurface = onInverseSurface,
315
327
_inversePrimary = inversePrimary,
@@ -344,7 +356,9 @@ class ColorScheme with Diagnosticable {
344
356
Color ? surfaceVariant,
345
357
Color ? onSurfaceVariant,
346
358
Color ? outline,
359
+ Color ? outlineVariant,
347
360
Color ? shadow,
361
+ Color ? scrim,
348
362
Color ? inverseSurface,
349
363
Color ? onInverseSurface,
350
364
Color ? inversePrimary,
@@ -383,7 +397,9 @@ class ColorScheme with Diagnosticable {
383
397
_surfaceVariant = surfaceVariant,
384
398
_onSurfaceVariant = onSurfaceVariant,
385
399
_outline = outline,
400
+ _outlineVariant = outlineVariant,
386
401
_shadow = shadow,
402
+ _scrim = scrim,
387
403
_inverseSurface = inverseSurface,
388
404
_onInverseSurface = onInverseSurface,
389
405
_inversePrimary = inversePrimary,
@@ -418,7 +434,9 @@ class ColorScheme with Diagnosticable {
418
434
Color ? surfaceVariant,
419
435
Color ? onSurfaceVariant,
420
436
Color ? outline,
437
+ Color ? outlineVariant,
421
438
Color ? shadow,
439
+ Color ? scrim,
422
440
Color ? inverseSurface,
423
441
Color ? onInverseSurface,
424
442
Color ? inversePrimary,
@@ -457,7 +475,9 @@ class ColorScheme with Diagnosticable {
457
475
_surfaceVariant = surfaceVariant,
458
476
_onSurfaceVariant = onSurfaceVariant,
459
477
_outline = outline,
478
+ _outlineVariant = outlineVariant,
460
479
_shadow = shadow,
480
+ _scrim = scrim,
461
481
_inverseSurface = inverseSurface,
462
482
_onInverseSurface = onInverseSurface,
463
483
_inversePrimary = inversePrimary,
@@ -492,7 +512,9 @@ class ColorScheme with Diagnosticable {
492
512
Color ? surfaceVariant,
493
513
Color ? onSurfaceVariant,
494
514
Color ? outline,
515
+ Color ? outlineVariant,
495
516
Color ? shadow,
517
+ Color ? scrim,
496
518
Color ? inverseSurface,
497
519
Color ? onInverseSurface,
498
520
Color ? inversePrimary,
@@ -531,7 +553,9 @@ class ColorScheme with Diagnosticable {
531
553
_surfaceVariant = surfaceVariant,
532
554
_onSurfaceVariant = onSurfaceVariant,
533
555
_outline = outline,
556
+ _outlineVariant = outlineVariant,
534
557
_shadow = shadow,
558
+ _scrim = scrim,
535
559
_inverseSurface = inverseSurface,
536
560
_onInverseSurface = onInverseSurface,
537
561
_inversePrimary = inversePrimary,
@@ -718,10 +742,19 @@ class ColorScheme with Diagnosticable {
718
742
/// A utility color that creates boundaries and emphasis to improve usability.
719
743
Color get outline => _outline ?? onBackground;
720
744
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
+
721
750
final Color ? _shadow;
722
751
/// A color use to paint the drop shadows of elevated components.
723
752
Color get shadow => _shadow ?? const Color (0xff000000 );
724
753
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
+
725
758
final Color ? _inverseSurface;
726
759
/// A surface color used for displaying the reverse of what’s seen in the
727
760
/// surrounding UI, for example in a SnackBar to bring attention to
@@ -790,7 +823,9 @@ class ColorScheme with Diagnosticable {
790
823
Color ? surfaceVariant,
791
824
Color ? onSurfaceVariant,
792
825
Color ? outline,
826
+ Color ? outlineVariant,
793
827
Color ? shadow,
828
+ Color ? scrim,
794
829
Color ? inverseSurface,
795
830
Color ? onInverseSurface,
796
831
Color ? inversePrimary,
@@ -831,7 +866,9 @@ class ColorScheme with Diagnosticable {
831
866
surfaceVariant : surfaceVariant ?? this .surfaceVariant,
832
867
onSurfaceVariant : onSurfaceVariant ?? this .onSurfaceVariant,
833
868
outline : outline ?? this .outline,
869
+ outlineVariant : outlineVariant ?? this .outlineVariant,
834
870
shadow : shadow ?? this .shadow,
871
+ scrim : scrim ?? this .scrim,
835
872
inverseSurface : inverseSurface ?? this .inverseSurface,
836
873
onInverseSurface : onInverseSurface ?? this .onInverseSurface,
837
874
inversePrimary : inversePrimary ?? this .inversePrimary,
@@ -870,7 +907,9 @@ class ColorScheme with Diagnosticable {
870
907
surfaceVariant: Color .lerp (a.surfaceVariant, b.surfaceVariant, t),
871
908
onSurfaceVariant: Color .lerp (a.onSurfaceVariant, b.onSurfaceVariant, t),
872
909
outline: Color .lerp (a.outline, b.outline, t),
910
+ outlineVariant: Color .lerp (a.outlineVariant, b.outlineVariant, t),
873
911
shadow: Color .lerp (a.shadow, b.shadow, t),
912
+ scrim: Color .lerp (a.scrim, b.scrim, t),
874
913
inverseSurface: Color .lerp (a.inverseSurface, b.inverseSurface, t),
875
914
onInverseSurface: Color .lerp (a.onInverseSurface, b.onInverseSurface, t),
876
915
inversePrimary: Color .lerp (a.inversePrimary, b.inversePrimary, t),
@@ -913,7 +952,9 @@ class ColorScheme with Diagnosticable {
913
952
&& other.surfaceVariant == surfaceVariant
914
953
&& other.onSurfaceVariant == onSurfaceVariant
915
954
&& other.outline == outline
955
+ && other.outlineVariant == outlineVariant
916
956
&& other.shadow == shadow
957
+ && other.scrim == scrim
917
958
&& other.inverseSurface == inverseSurface
918
959
&& other.onInverseSurface == onInverseSurface
919
960
&& other.inversePrimary == inversePrimary
@@ -949,7 +990,9 @@ class ColorScheme with Diagnosticable {
949
990
surfaceVariant,
950
991
onSurfaceVariant,
951
992
outline,
993
+ outlineVariant,
952
994
shadow,
995
+ scrim,
953
996
inverseSurface,
954
997
onInverseSurface,
955
998
inversePrimary,
@@ -987,7 +1030,9 @@ class ColorScheme with Diagnosticable {
987
1030
properties.add (ColorProperty ('surfaceVariant' , surfaceVariant, defaultValue: defaultScheme.surfaceVariant));
988
1031
properties.add (ColorProperty ('onSurfaceVariant' , onSurfaceVariant, defaultValue: defaultScheme.onSurfaceVariant));
989
1032
properties.add (ColorProperty ('outline' , outline, defaultValue: defaultScheme.outline));
1033
+ properties.add (ColorProperty ('outlineVariant' , outlineVariant, defaultValue: defaultScheme.outlineVariant));
990
1034
properties.add (ColorProperty ('shadow' , shadow, defaultValue: defaultScheme.shadow));
1035
+ properties.add (ColorProperty ('scrim' , scrim, defaultValue: defaultScheme.scrim));
991
1036
properties.add (ColorProperty ('inverseSurface' , inverseSurface, defaultValue: defaultScheme.inverseSurface));
992
1037
properties.add (ColorProperty ('onInverseSurface' , onInverseSurface, defaultValue: defaultScheme.onInverseSurface));
993
1038
properties.add (ColorProperty ('inversePrimary' , inversePrimary, defaultValue: defaultScheme.inversePrimary));
0 commit comments