Description
Looks like Switch
widget still needs deprecated accentColor
to be defined in ThemeData
in order to not use the default color on Android. In my project I defined a whole ColorScheme
to not use deprecated color values in ThemeData
and saw that Switch
ignores secondary
defined in the app theme. I can only change color by adding accentColor
property.
Attached a sample project with fully defined ColorScheme
and Switch
not following it.
This is how Switch
looks with just ColorScheme
defined:
This is how Switch
should look like and how it looks when I add accentColor
to ThemeData
:
Steps to Reproduce
- Create new project
- Define full
ColorScheme
(with all defined colors) - Add
Switch
widget and observe that it has the default Material blue color on Android.
Expected results: Switch
follows secondary
color as it is suggested in deprecation message for accentColor
Actual results: Switch
has default Material blue color on Android
Code sample
flutter doctor output
// Attaching only Flutter related info, since other is irrelevant for the issue
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.6.1 20G224 darwin-x64, locale en-UA)
• Flutter version 2.5.3 at /Users/vb/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (5 weeks ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4
Metadata
Metadata
Assignees
Labels
Type
Projects
Status