Skip to content

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

@TahaTesser

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]

Metadata

Metadata

Assignees

Labels

f: material designflutter/packages/flutter/material repository.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 onr: 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