accentColor property

  1. @Deprecated('This property no longer has any function in FlexColorScheme. ' 'It is also deprecated in Flutter SDK after v2.3.0-0.1.pre. ' 'For more info see: ' 'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties')
Color? accentColor
final

Obsolete property that was originally used as the foreground color for widgets (knobs, text, overscroll edge effect, etc).

The material library no longer uses this property. In most cases the theme's colorScheme ColorScheme.secondary property is now used instead.

Apps should migrate uses of this property to the theme's colorScheme ColorScheme.secondary color. In cases where a color is needed that that contrasts well with the secondary color ColorScheme.onSecondary can be used. For more information see: https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties

In previous versions accentColor for ThemeData was set to primary color instead as default. The accentColor was in FlexColorScheme only used for the active border color on text input in dark theme mode. By allowing a custom color with color scheme based themes, we could control the color of the active input border on text fields in dark themes separately from the rest of the color scheme based colors, without the need for a complex text input decoration theme. This only applies to the dark theme mode. The light theme mode still uses the primary color for the active border. If you want to change that you will have to make a custom input decoration themes. The purpose of the past modification was actually to get InputDecorations on TextFields in dark theme mode that as default theme used primary color, instead of accentColor, which by default in the past was same color as secondaryColor. This was actually done to get a default FlexColorScheme based theme that matched the Material Design guide. Flutter SDK (from v2.0.0 it seems) has been updated to have the same default behavior now that FlexColorScheme already did before for InputDecorators. Thus there is no longer any need for this property or ot set a value for it. We can thus deprecate it and not use it for anything, even before the ThemeData.accentColor deprecation actually lands

We could have named this extra property textDarkActiveBorderColor, but since it is still defining the accentColor in ThemeData, it was decided to continue to use this name for the property, just in case it still also impacts other color properties that does not get themed to the scheme secondary color separately. We have not yet noticed any such widgets when using FlexColorScheme. If you come across any, please let us know.

Implementation

@Deprecated(
  'This property no longer has any function in FlexColorScheme. '
  'It is also deprecated in Flutter SDK after v2.3.0-0.1.pre. '
  'For more info see: '
  'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties',
)
final Color? accentColor;