diff --git a/dev/tools/gen_defaults/lib/list_tile_template.dart b/dev/tools/gen_defaults/lib/list_tile_template.dart index 78c99432537d..728f8f310f9c 100644 --- a/dev/tools/gen_defaults/lib/list_tile_template.dart +++ b/dev/tools/gen_defaults/lib/list_tile_template.dart @@ -42,7 +42,7 @@ class _${blockName}DefaultsM3 extends ListTileThemeData { Color? get selectedColor => ${componentColor('md.comp.list.list-item.selected.trailing-icon')}; @override - Color? get iconColor => ${componentColor('md.comp.list.list-item.unselected.trailing-icon')}; + Color? get iconColor => ${componentColor('md.comp.list.list-item.trailing-icon')}; } '''; } diff --git a/examples/api/lib/material/list_tile/list_tile.0.dart b/examples/api/lib/material/list_tile/list_tile.0.dart index 4f4ebeded534..996c6e3a5e9a 100644 --- a/examples/api/lib/material/list_tile/list_tile.0.dart +++ b/examples/api/lib/material/list_tile/list_tile.0.dart @@ -17,7 +17,8 @@ class ListTileApp extends StatelessWidget { theme: ThemeData( listTileTheme: const ListTileThemeData( textColor: Colors.white, - ) + ), + useMaterial3: true, ), home: const LisTileExample(), ); diff --git a/examples/api/lib/material/list_tile/list_tile.1.dart b/examples/api/lib/material/list_tile/list_tile.1.dart index 9df3aeb8fab4..389977e80415 100644 --- a/examples/api/lib/material/list_tile/list_tile.1.dart +++ b/examples/api/lib/material/list_tile/list_tile.1.dart @@ -13,8 +13,9 @@ class ListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { - return const MaterialApp( - home: LisTileExample(), + return MaterialApp( + theme: ThemeData(useMaterial3: true), + home: const LisTileExample(), ); } } diff --git a/examples/api/lib/material/list_tile/list_tile.2.dart b/examples/api/lib/material/list_tile/list_tile.2.dart index 3a37177c8066..ad8a25ddef31 100644 --- a/examples/api/lib/material/list_tile/list_tile.2.dart +++ b/examples/api/lib/material/list_tile/list_tile.2.dart @@ -14,7 +14,7 @@ class ListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(useMaterial3: true), home: const ListTileExample(), ); } diff --git a/examples/api/lib/material/list_tile/list_tile.3.dart b/examples/api/lib/material/list_tile/list_tile.3.dart index 6ec41c2da5c4..d0d47b8f7c0e 100644 --- a/examples/api/lib/material/list_tile/list_tile.3.dart +++ b/examples/api/lib/material/list_tile/list_tile.3.dart @@ -14,7 +14,7 @@ class ListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(useMaterial3: true), home: const ListTileExample(), ); } diff --git a/examples/api/lib/material/list_tile/list_tile.selected.0.dart b/examples/api/lib/material/list_tile/list_tile.selected.0.dart index c746378218a2..7ff56ac83c47 100644 --- a/examples/api/lib/material/list_tile/list_tile.selected.0.dart +++ b/examples/api/lib/material/list_tile/list_tile.selected.0.dart @@ -13,8 +13,9 @@ class ListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { - return const MaterialApp( - home: LisTileExample(), + return MaterialApp( + theme: ThemeData(useMaterial3: true), + home: const LisTileExample(), ); } } diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart index 398a3c33a475..e881745d65a7 100644 --- a/packages/flutter/lib/src/material/list_tile.dart +++ b/packages/flutter/lib/src/material/list_tile.dart @@ -474,7 +474,7 @@ class ListTile extends StatelessWidget { /// Defines the default color for [leading] and [trailing] icons. /// /// If this property is null and [selected] is false then [ListTileThemeData.iconColor] - /// is used. If that is also null and [ThemeData.useMaterial3] is true, [ColorScheme.onSurface] + /// is used. If that is also null and [ThemeData.useMaterial3] is true, [ColorScheme.onSurfaceVariant] /// is used, otherwise if [ThemeData.brightness] is [Brightness.light], [Colors.black54] is used, /// and if [ThemeData.brightness] is [Brightness.dark], the value is null. /// @@ -1593,7 +1593,7 @@ class _LisTileDefaultsM3 extends ListTileThemeData { Color? get selectedColor => _colors.primary; @override - Color? get iconColor => _colors.onSurface; + Color? get iconColor => _colors.onSurfaceVariant; } // END GENERATED TOKEN PROPERTIES - LisTile diff --git a/packages/flutter/test/material/list_tile_test.dart b/packages/flutter/test/material/list_tile_test.dart index 58e91facd188..5d0204ff88b8 100644 --- a/packages/flutter/test/material/list_tile_test.dart +++ b/packages/flutter/test/material/list_tile_test.dart @@ -1882,10 +1882,10 @@ void main() { expect(iconColor(trailingKey), colorScheme.primary); await tester.pumpWidget(buildFrame(selected: false)); - expect(iconColor(leadingKey), colorScheme.onSurface); - expect(iconColor(titleKey), colorScheme.onSurface); - expect(iconColor(subtitleKey), colorScheme.onSurface); - expect(iconColor(trailingKey), colorScheme.onSurface); + expect(iconColor(leadingKey), colorScheme.onSurfaceVariant); + expect(iconColor(titleKey), colorScheme.onSurfaceVariant); + expect(iconColor(subtitleKey), colorScheme.onSurfaceVariant); + expect(iconColor(trailingKey), colorScheme.onSurfaceVariant); }); testWidgets('ListTile font size', (WidgetTester tester) async {