@@ -31,6 +31,8 @@ import 'text_theme.dart';
3131import 'theme.dart' ;
3232import 'theme_data.dart' ;
3333
34+ part 'generated/input_decorator_defaults_m3.g.dart' ;
35+
3436// Examples can assume:
3537// late Widget _myIcon;
3638// late BuildContext context;
@@ -6017,184 +6019,3 @@ class _InputDecoratorDefaultsM2 extends InputDecorationThemeData {
60176019 };
60186020 });
60196021}
6020-
6021- // BEGIN GENERATED TOKEN PROPERTIES - InputDecorator
6022-
6023- // Do not edit by hand. The code between the "BEGIN GENERATED" and
6024- // "END GENERATED" comments are generated from data in the Material
6025- // Design token database by the script:
6026- // dev/tools/gen_defaults/bin/gen_defaults.dart.
6027-
6028- // dart format off
6029- class _InputDecoratorDefaultsM3 extends InputDecorationThemeData {
6030- _InputDecoratorDefaultsM3 (this .context)
6031- : super ();
6032-
6033- final BuildContext context;
6034-
6035- late final ColorScheme _colors = Theme .of (context).colorScheme;
6036- late final TextTheme _textTheme = Theme .of (context).textTheme;
6037-
6038- // For InputDecorator, focused state should take precedence over hovered state.
6039- // For instance, the focused state increases border width (2dp) and applies bright
6040- // colors (primary color or error color) while the hovered state has the same border
6041- // than the non-focused state (1dp) and uses a color a little darker than non-focused
6042- // state. On desktop, it is also very common that a text field is focused and hovered
6043- // because users often rely on mouse selection.
6044- // For other widgets, hovered state takes precedence over focused state, because it
6045- // is mainly used to determine the overlay color,
6046- // see https://github.com/flutter/flutter/pull/125905.
6047-
6048- @override
6049- TextStyle ? get hintStyle => WidgetStateTextStyle .resolveWith ((Set <WidgetState > states) {
6050- if (states.contains (WidgetState .disabled)) {
6051- return TextStyle (color: _colors.onSurface.withOpacity (0.38 ));
6052- }
6053- return TextStyle (color: _colors.onSurfaceVariant);
6054- });
6055-
6056- @override
6057- Color ? get fillColor => WidgetStateColor .resolveWith ((Set <WidgetState > states) {
6058- if (states.contains (WidgetState .disabled)) {
6059- return _colors.onSurface.withOpacity (0.04 );
6060- }
6061- return _colors.surfaceContainerHighest;
6062- });
6063-
6064- @override
6065- BorderSide ? get activeIndicatorBorder => WidgetStateBorderSide .resolveWith ((Set <WidgetState > states) {
6066- if (states.contains (WidgetState .disabled)) {
6067- return BorderSide (color: _colors.onSurface.withOpacity (0.38 ));
6068- }
6069- if (states.contains (WidgetState .error)) {
6070- if (states.contains (WidgetState .focused)) {
6071- return BorderSide (color: _colors.error, width: 2.0 );
6072- }
6073- if (states.contains (WidgetState .hovered)) {
6074- return BorderSide (color: _colors.onErrorContainer);
6075- }
6076- return BorderSide (color: _colors.error);
6077- }
6078- if (states.contains (WidgetState .focused)) {
6079- return BorderSide (color: _colors.primary, width: 2.0 );
6080- }
6081- if (states.contains (WidgetState .hovered)) {
6082- return BorderSide (color: _colors.onSurface);
6083- }
6084- return BorderSide (color: _colors.onSurfaceVariant);
6085- });
6086-
6087- @override
6088- BorderSide ? get outlineBorder => WidgetStateBorderSide .resolveWith ((Set <WidgetState > states) {
6089- if (states.contains (WidgetState .disabled)) {
6090- return BorderSide (color: _colors.onSurface.withOpacity (0.12 ));
6091- }
6092- if (states.contains (WidgetState .error)) {
6093- if (states.contains (WidgetState .focused)) {
6094- return BorderSide (color: _colors.error, width: 2.0 );
6095- }
6096- if (states.contains (WidgetState .hovered)) {
6097- return BorderSide (color: _colors.onErrorContainer);
6098- }
6099- return BorderSide (color: _colors.error);
6100- }
6101- if (states.contains (WidgetState .focused)) {
6102- return BorderSide (color: _colors.primary, width: 2.0 );
6103- }
6104- if (states.contains (WidgetState .hovered)) {
6105- return BorderSide (color: _colors.onSurface);
6106- }
6107- return BorderSide (color: _colors.outline);
6108- });
6109-
6110- @override
6111- Color ? get iconColor => _colors.onSurfaceVariant;
6112-
6113- @override
6114- Color ? get prefixIconColor => WidgetStateColor .resolveWith ((Set <WidgetState > states) {
6115- if (states.contains (WidgetState .disabled)) {
6116- return _colors.onSurface.withOpacity (0.38 );
6117- }
6118- return _colors.onSurfaceVariant;
6119- });
6120-
6121- @override
6122- Color ? get suffixIconColor => WidgetStateColor .resolveWith ((Set <WidgetState > states) {
6123- if (states.contains (WidgetState .disabled)) {
6124- return _colors.onSurface.withOpacity (0.38 );
6125- }
6126- if (states.contains (WidgetState .error)) {
6127- if (states.contains (WidgetState .hovered)) {
6128- return _colors.onErrorContainer;
6129- }
6130- return _colors.error;
6131- }
6132- return _colors.onSurfaceVariant;
6133- });
6134-
6135- @override
6136- TextStyle ? get labelStyle => WidgetStateTextStyle .resolveWith ((Set <WidgetState > states) {
6137- final TextStyle textStyle = _textTheme.bodyLarge ?? const TextStyle ();
6138- if (states.contains (WidgetState .disabled)) {
6139- return textStyle.copyWith (color: _colors.onSurface.withOpacity (0.38 ));
6140- }
6141- if (states.contains (WidgetState .error)) {
6142- if (states.contains (WidgetState .focused)) {
6143- return textStyle.copyWith (color: _colors.error);
6144- }
6145- if (states.contains (WidgetState .hovered)) {
6146- return textStyle.copyWith (color: _colors.onErrorContainer);
6147- }
6148- return textStyle.copyWith (color: _colors.error);
6149- }
6150- if (states.contains (WidgetState .focused)) {
6151- return textStyle.copyWith (color: _colors.primary);
6152- }
6153- if (states.contains (WidgetState .hovered)) {
6154- return textStyle.copyWith (color: _colors.onSurfaceVariant);
6155- }
6156- return textStyle.copyWith (color: _colors.onSurfaceVariant);
6157- });
6158-
6159- @override
6160- TextStyle ? get floatingLabelStyle => WidgetStateTextStyle .resolveWith ((Set <WidgetState > states) {
6161- final TextStyle textStyle = _textTheme.bodyLarge ?? const TextStyle ();
6162- if (states.contains (WidgetState .disabled)) {
6163- return textStyle.copyWith (color: _colors.onSurface.withOpacity (0.38 ));
6164- }
6165- if (states.contains (WidgetState .error)) {
6166- if (states.contains (WidgetState .focused)) {
6167- return textStyle.copyWith (color: _colors.error);
6168- }
6169- if (states.contains (WidgetState .hovered)) {
6170- return textStyle.copyWith (color: _colors.onErrorContainer);
6171- }
6172- return textStyle.copyWith (color: _colors.error);
6173- }
6174- if (states.contains (WidgetState .focused)) {
6175- return textStyle.copyWith (color: _colors.primary);
6176- }
6177- if (states.contains (WidgetState .hovered)) {
6178- return textStyle.copyWith (color: _colors.onSurfaceVariant);
6179- }
6180- return textStyle.copyWith (color: _colors.onSurfaceVariant);
6181- });
6182-
6183- @override
6184- TextStyle ? get helperStyle => WidgetStateTextStyle .resolveWith ((Set <WidgetState > states) {
6185- final TextStyle textStyle = _textTheme.bodySmall ?? const TextStyle ();
6186- if (states.contains (WidgetState .disabled)) {
6187- return textStyle.copyWith (color: _colors.onSurface.withOpacity (0.38 ));
6188- }
6189- return textStyle.copyWith (color: _colors.onSurfaceVariant);
6190- });
6191-
6192- @override
6193- TextStyle ? get errorStyle => WidgetStateTextStyle .resolveWith ((Set <WidgetState > states) {
6194- final TextStyle textStyle = _textTheme.bodySmall ?? const TextStyle ();
6195- return textStyle.copyWith (color: _colors.error);
6196- });
6197- }
6198- // dart format on
6199-
6200- // END GENERATED TOKEN PROPERTIES - InputDecorator
0 commit comments