Skip to content

InputDecoration's iconColor, prefixIconColor and suffixIconColor not working in a TextField. #109654

Closed

Description

@bitosaez

Steps to Reproduce

The properties iconColor, prefixIconColor and suffixIconColor of InputDecoration while being used as part of a TextField don't modify the colors of their respective icons. See the code below.

Expected results: The colors of the icons should follow their respective color properties values.

Actual results: The icons have the incorrect color.

Code sample:

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Center(
          child: TextField(
            decoration: InputDecoration(
              icon: Icon(Icons.ac_unit),
              iconColor: Colors.red,
              prefixIcon: Icon(Icons.abc),
              prefixIconColor: Colors.green,
              suffixIcon: Icon(Icons.add),
              suffixIconColor: Colors.blue,
            ),
          ),
        ),
      ),
    );
  }
}
Details
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.5 21G72 darwin-arm, locale en-CA)
    • Flutter version 3.0.5 at /Users/rodxander/Library/Flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (5 weeks ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/rodxander/Library/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.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

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

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

[✓] VS Code (version 1.69.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile)  • emulator-5554                        • android-arm64  • Android 13 (API 33) (emulator)
    • iPad Pro (9.7-inch) (mobile) • 0E5490BF-BD58-4881-B93B-099E72F8A555 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
    • macOS (desktop)              • macos                                • darwin-arm64   • macOS 12.5 21G72 darwin-arm
    • Chrome (web)                 • chrome                               • web-javascript • Google Chrome 104.0.5112.79

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

• No issues found!

Activity

  1. aakansharamesh42 commented on Aug 17, 2022

    @aakansharamesh42

    Hello,
    I wanted to work on this issue, could you kindly assign it to me

  2. danagbemava-nc commented on Aug 18, 2022

    @danagbemava-nc
    Member

    Issue is reproducible on stable and master.

    Might be related #71813

    screenshots
    flutter doctor -v
    [✓] Flutter (Channel stable, 3.0.5, on macOS 12.5 21G72 darwin-arm, locale en-GB)
        • Flutter version 3.0.5 at /Users/nexus/dev/sdks/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision f1875d570e (5 weeks ago), 2022-07-13 11:24:16 -0700
        • Engine revision e85ea0e79c
        • Dart version 2.17.6
        • DevTools version 2.12.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
        • Android SDK at /Users/nexus/Library/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.12+0-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.2)
        • 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.12+0-b1504.28-7817840)
    
    [✓] VS Code (version 1.70.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.46.0
    
    [✓] Connected device (5 available)
        • M2007J20CG (mobile)         • 5dd3be00                  • android-arm64  • Android 11 (API 30)
        • sdk gphone64 arm64 (mobile) • emulator-5554             • android-arm64  • Android 13 (API 33) (emulator)
        • Nexus (mobile)              • 00008020-001875E83A38002E • ios            • iOS 15.6 19G71
        • macOS (desktop)             • macos                     • darwin-arm64   • macOS 12.5 21G72 darwin-arm
        • Chrome (web)                • chrome                    • web-javascript • Google Chrome 104.0.5112.79
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
    [✓] Flutter (Channel master, 3.1.0-0.0.pre.2346, on macOS 12.5 21G72 darwin-arm, locale en-GB)
        • Flutter version 3.1.0-0.0.pre.2346 on channel master at /Users/nexus/dev/sdks/flutters
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision adda088bcc (4 hours ago), 2022-08-17 22:59:07 -0400
        • Engine revision a77ead45a8
        • Dart version 2.19.0 (build 2.19.0-108.0.dev)
        • DevTools version 2.16.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
        • Android SDK at /Users/nexus/Library/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.12+0-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 13F100
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.2)
        • 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.12+0-b1504.28-7817840)
    
    [✓] VS Code (version 1.70.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.46.0
    
    [✓] Connected device (5 available)
        • M2007J20CG (mobile)         • 5dd3be00                  • android-arm64  • Android 11 (API 30)
        • sdk gphone64 arm64 (mobile) • emulator-5554             • android-arm64  • Android 13 (API 33) (emulator)
        • Nexus (mobile)              • 00008020-001875E83A38002E • ios            • iOS 15.6 19G71
        • macOS (desktop)             • macos                     • darwin-arm64   • macOS 12.5 21G72 darwin-arm
        • Chrome (web)                • chrome                    • web-javascript • Google Chrome 104.0.5112.79
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    

    @aakansharamesh42, you can file a PR after reading the Contributor's guide. You don't need to be assigned before you can work on issues

  3. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Aug 18, 2022
  4. aakansharamesh42 commented on Aug 18, 2022

    @aakansharamesh42
  5. github-actions commented on Sep 6, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions