Skip to content

Chips delete icon ignores IconTheme from Chip.iconTheme and ChipThemeData.iconTheme #146501

Closed

Description

@TahaTesser

Steps to reproduce

Run the code sample below

According to docs the iconTheme is used for all icons in the chip.

/// Theme used for all icons in the chip.
///
/// If this is null and [ThemeData.useMaterial3] is true, then [IconThemeData]
/// with a [ColorScheme.primary] color and a size of 18.0 is used when
/// the chip is enabled, and [IconThemeData] with a [ColorScheme.onSurface]
/// color and a size of 18.0 is used when the chip is disabled. Otherwise,
/// it defaults to null.
IconThemeData? get iconTheme;

Expected results

Screenshot 2024-04-09 at 15 38 26

Actual results

Screenshot 2024-04-09 at 16 12 40

Code sample

Code sample
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        chipTheme: const ChipThemeData(
          iconTheme: IconThemeData(
            color: Colors.amber,
          ),
        ),
      ),
      home: Scaffold(
        body: Center(
          child: FilterChip(
            avatar: const Icon(Icons.favorite),
            onDeleted: () {},
            label: const Text('Filter Chip'),
            onSelected: (value) {},
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Activity

  1. danagbemava-nc commented on Apr 9, 2024

    @danagbemava-nc
    Member

    Reproducible using the code sample provided above.

    flutter doctor -v
    [!] Flutter (Channel stable, 3.19.5, on macOS 14.4.1 23E224 darwin-arm64, locale en-GB)
        • Flutter version 3.19.5 on channel stable at /Users/nexus/dev/sdks/flutter
        ! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutters/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutter. Consider adding /Users/nexus/dev/sdks/flutter/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutters/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutter. Consider adding /Users/nexus/dev/sdks/flutter/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 300451adae (12 days ago), 2024-03-27 21:54:07 -0500
        • Engine revision e76c956498
        • Dart version 3.3.3
        • DevTools version 2.31.1
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/nexus/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • Java binary at: /Users/nexus/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.3)
        • Xcode at /Applications/Xcode-15.3.0.app/Contents/Developer
        • Build 15E204a
        • CocoaPods version 1.14.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2023.1)
        • Android Studio at /Users/nexus/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 17.0.7+0-17.0.7b1000.6-10550314)
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2023.2.5)
        • IntelliJ at /Users/nexus/Applications/IntelliJ IDEA Ultimate.app
        • Flutter plugin version 77.2.2
        • Dart plugin version 232.10286
    
    [✓] VS Code (version 1.87.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.86.0
    
    [✓] Connected device (4 available)
        • Nexus (mobile)       • 00008020-001875E83A38002E • ios            • iOS 17.4.1 21E236
        • Dean’s iPad (mobile) • 00008103-000825C811E3401E • ios            • iOS 17.4.1 21E236
        • macOS (desktop)      • macos                     • darwin-arm64   • macOS 14.4.1 23E224 darwin-arm64
        • Chrome (web)         • chrome                    • web-javascript • Google Chrome 123.0.6312.107
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
    
    [✓] Flutter (Channel master, 3.22.0-6.0.pre.23, on macOS 14.4.1 23E224 darwin-arm64, locale en-GB)
        • Flutter version 3.22.0-6.0.pre.23 on channel master at /Users/nexus/dev/sdks/flutters
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 6a5be75eb3 (10 hours ago), 2024-04-08 23:14:40 -0400
        • Engine revision 5a824e22de
        • Dart version 3.5.0 (build 3.5.0-36.0.dev)
        • DevTools version 2.34.1
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/nexus/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • Java binary at: /Users/nexus/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.3)
        • Xcode at /Applications/Xcode-15.3.0.app/Contents/Developer
        • Build 15E204a
        • CocoaPods version 1.14.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2023.1)
        • Android Studio at /Users/nexus/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 17.0.7+0-17.0.7b1000.6-10550314)
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2023.2.5)
        • IntelliJ at /Users/nexus/Applications/IntelliJ IDEA Ultimate.app
        • Flutter plugin version 77.2.2
        • Dart plugin version 232.10286
    
    [✓] VS Code (version 1.87.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.86.0
    
    [✓] Connected device (5 available)
        • Nexus (mobile)                  • 00008020-001875E83A38002E • ios            • iOS 17.4.1 21E236
        • Dean’s iPad (mobile)            • 00008103-000825C811E3401E • ios            • iOS 17.4.1 21E236
        • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 14.4.1 23E224 darwin-arm64
        • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 14.4.1 23E224 darwin-arm64
        • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 123.0.6312.107
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    
  2. 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
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Apr 9, 2024
  3. moved this from To do to PR submitted in Nevercodeon Apr 9, 2024
  4. naveenpardeep commented on Apr 11, 2024

    @naveenpardeep

    please wrap FilterChip with Theme ---->>>>
    Theme(data: Theme.of(context)
    .copyWith(canvasColor: Colors.transparent),
    child: child: FilterChip()

  5. moved this from PR submitted to Done (PR merged) in Nevercodeon Apr 23, 2024
  6. added
    r: fixedIssue is closed as already fixed in a newer version
    on Apr 23, 2024
  7. github-actions commented on May 7, 2024

    @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.

  8. locked as resolved and limited conversation to collaborators on May 7, 2024
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.19Found to occur in 3.19found in release: 3.22Found to occur in 3.22frameworkflutter/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 versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

  • Status
    Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions