Wrong (default) color of the trailing widget on app bar

This issue has been created since 2022-09-22.

Steps to Reproduce

  1. Use the Example Theme from below in a new Flutter Project

Expected results:
Coming from Material 2 I expected that onSurface color as part of ColorScheme defines the appearance of the scaffold header text AND icon, but it's only the text.

When I set foregroundColor as a parameter of AppBar it also only affects the title and not the icon.

Actual results:
However, when I set onSurfaceVariant to make the text and icon in the header look the same, also the suffixIcon in InputDecoration of a TextFormField gets the onSurfaceVariant color (which in my case is on a different background color and not visible anymore).

I think it's related to #110635.

Example Theme
 colorScheme: ThemeData.light().colorScheme.copyWith(
      onSurface: Colors.blue,
      // Without that icons in scaffold header / app bar have the wrong color
      onSurfaceVariant: Colors.blue
)
Example InputDecoration for TextFormField
      decoration: InputDecoration(
        hintText: 'Type here',
        suffixIcon: IconButton(
          onPressed: _onPressed,
          icon: const Icon(Icons.clear_rounded),
        ),
        errorMaxLines: 2,
      )
)
Logs
[✓] Flutter (Channel stable, 3.3.2, on macOS 12.6 21G115 darwin-arm, locale en-GB)
    • Flutter version 3.3.2 on channel stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e3c29ec00c (8 days ago), 2022-09-14 08:46:55 -0500
    • Engine revision a4ff2c53d8
    • Dart version 2.18.1
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14A309
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.71.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.48.0

[✓] Connected device (3 available)
    • PCT L29 (mobile) • X5BDU19129003323 • android-arm64  • Android 10 (API 29)
    • macOS (desktop)  • macos            • darwin-arm64   • macOS 12.6 21G115 darwin-arm
    • Chrome (web)     • chrome           • web-javascript • Google Chrome 105.0.5195.125

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

exaby73 wrote this answer on 2022-09-22

Hello @7h30n3. Can you confirm if this issue is still reproducible on the master channel?

7h30n3 wrote this answer on 2022-09-22

Oh, I forgot to test that, but I did just now.
The result is that the problem doesn't persist anymore.

More Details About Repo
Owner Name flutter
Repo Name flutter
Full Name flutter/flutter
Language Dart
Created Date 2015-03-06
Updated Date 2022-10-05
Star Count 145512
Watcher Count 3569
Fork Count 23398
Issue Count 11205

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Conflict with unity.physics 3 2021-04-30 2022-03-30
Retire use of package branches and ubump 4 2021-08-01 2022-03-30
Add automated linting and/or code formatting 2 2021-06-23 2022-03-30
New package: Pathing 1 2021-06-18 2022-03-30
Add flocking to navigation package 9 2021-06-19 2022-03-30
'Update available' dialog missing 5 2021-07-24 2022-05-03
试图实现在 picker 中只能选 x 张图片的效果 2 2021-12-23 2022-08-30
How to Convert format string `YYYY-MM-DD` to `std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<int, std::ratio_multiply<std::ratio<24>, std::chrono::hours::period>>>` 6 2021-08-03 2022-08-17
Replace high bit cutting with a proper hash-to-field call from arkworks 0 2021-02-09 2022-04-27
Make PoK works for both G1 and G2 1 2021-02-09 2022-09-06
Verify support BLS12-377 2 2021-06-14 2022-09-01
Resolve the failure of `bit::tests::proofs_of_possession` 2 2021-01-12 2022-09-23
Clean up BLS PoP code and prepare it for review 1 2021-01-22 2022-10-03
Server Crash Problem - Paying scripters. 3 2021-07-23 2022-09-25
Document all wazeroir instructions with ref to the spec 1 2022-02-07 2022-07-27
Optional "info" object for each entry 0 2021-05-19 2022-09-03
[Feature]: Display a `Notice` when a card is due soon 1 2021-12-06 2022-09-03
[Crash report] No such file or directory: 'EAappInstaller.exe' 1 2022-03-10 2022-09-06
How to solve ? Error: No connection, retry after 10 seconds 9 2021-11-26 2022-10-02
Filesystem not working in real hardware 2 2022-05-31 2022-10-01
When I run the example.py, error occured 0 2019-12-10 2022-08-30
Feature Request [Developement ]: No issue and PR template in github repository 2 2022-08-19 2022-09-19
Summernote xss protected 2 2022-06-11 2022-10-02
Evalator hangs while training 1 2022-08-02 2022-09-24
Upcoming HTML standard issue triage meeting on 7/7/2022 1 2022-06-02 2022-08-04
"Preview Blocked" not in prefered language 4 2022-04-11 2022-09-20
How to convert ipyleaflet object into ee object? 2 2021-09-13 2022-09-15
Documentation is down 1 2021-09-15 2022-10-04
Export JSON file with "incorrect" format of note item 9 2022-07-20 2022-09-27
Crash When Trying to Set Custom Day Start 2 2021-11-10 2022-09-23
Likely race conditions when core library files are modified 10 2022-07-11 2022-09-09
Does not catch some initial page load cases 0 2021-08-04 2022-10-02
Move Fast in Low Gravity with This One Easy Trick! 1 2022-02-14 2022-09-17
Storybook build fails in CI environment with error Error: Cannot find module 'react/package.json' 12 2022-02-09 2022-09-04
NGINX not starting with Portainer stack 9 2021-02-19 2022-09-23
Pasting Multiple Shapes Onto Connection Results In Unexpected Connections 5 2021-04-30 2022-09-07
SidePanel animation stuck on FireFox 1 2022-09-21 2022-09-30
/entrypoint.sh: illegal option -- P 1 2021-01-17 2022-09-17
Intermittent UI test failure - < WebControlsTest. verifyCalendarFormTest > 3 2022-05-25 2022-09-29
APIstax client extension 4 2022-07-27 2022-09-18
sort: change byte order for Big-endian 0 2019-10-27 2021-12-23
[Docs]: Add Readme.md to packages/rrweb 0 2022-08-23 2022-09-27
[Bug]: Replayer not working properly 3 2022-08-17 2022-09-27
[Bug]: Recording missing styles 4 2022-08-18 2022-09-27
Exception when trying to create a Gift for CO without a preparation 3 2021-08-13 2022-09-22
Bleuscore from torchmetric give different results compare to NLTK 6 2022-06-07 2022-09-24
move some plugins into independent project 2 2020-11-24 2022-10-04
PostWriteResponsePlugin将ctx强转为share.Context失败 1 2021-02-03 2022-09-28
Java: `hasSubtype` / `getASubtype` does not work correctly for generic types 2 2022-03-04 2022-09-20
Kubernetes examples/spark-pi.yaml sparkapplication failing 2 2021-07-30 2022-10-03