Skip to content

Migrate ListTile unselected icon color to Material 3 #99400

@TheCarpetMerchant

Description

@TheCarpetMerchant

Use case

Trailing IconButtons in ListTiles.

Proposal

ListTileThemeData doesn't inherit its iconColor from iconTheme. Took me a few minutes to figure out. It would make sense that if no iconColor is provided to ThemeData.listTileTheme, the iconColor should default to the one in iconTheme instead of the default Materiel grey color.

Would you consider changing this behaviour ?

Short reproduction code :

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        iconTheme: IconThemeData(color: Colors.red),
      ),
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Column(
          children: const [
            ListTile(
              leading: Icon(Icons.add_rounded),
            ),
            Icon(Icons.add_rounded),
          ]
        ),
      ),
    );
  }
}

Metadata

Metadata

Assignees

Labels

c: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions