@@ -455,10 +455,16 @@ class ColorScheme with Diagnosticable {
455
455
_inversePrimary = inversePrimary,
456
456
_surfaceTint = surfaceTint;
457
457
458
- /// Create a color scheme from a [MaterialColor] swatch.
458
+ /// Creates a color scheme from a [MaterialColor] swatch.
459
459
///
460
- /// This constructor is used by [ThemeData] to create its default
461
- /// color scheme.
460
+ /// In Material 3, this constructor is ignored by [ThemeData] when creating
461
+ /// its default color scheme. Instead, [ThemeData] uses [ ColorScheme.fromSeed]
462
+ /// to create its default color scheme. This constructor shouldn't be used
463
+ /// to update the Material 3 color scheme. It will be phased out gradually;
464
+ /// see https://github.com/flutter/flutter/issues/91772 for more details.
465
+ ///
466
+ /// If [ThemeData.useMaterial3] is false, then this constructor is used by
467
+ /// [ThemeData] to create its default color scheme.
462
468
factory ColorScheme .fromSwatch ({
463
469
MaterialColor primarySwatch = Colors .blue,
464
470
Color ? accentColor,
@@ -467,7 +473,6 @@ class ColorScheme with Diagnosticable {
467
473
Color ? errorColor,
468
474
Brightness brightness = Brightness .light,
469
475
}) {
470
-
471
476
final bool isDark = brightness == Brightness .dark;
472
477
final bool primaryIsDark = _brightnessFor (primarySwatch) == Brightness .dark;
473
478
final Color secondary = accentColor ?? (isDark ? Colors .tealAccent[200 ]! : primarySwatch);
0 commit comments