Skip to content

Update ListTile text defaults to use ColorScheme - #128581

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
TahaTesser:update_m3_text_color_defaults
Jun 12, 2023
Merged

auto-submit[bot] merged 2 commits into
flutter:masterfrom
TahaTesser:update_m3_text_color_defaults

Conversation

@TahaTesser

@TahaTesser TahaTesser commented Jun 9, 2023 •

Copy link
Copy Markdown
Contributor

fixes #128569

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        useMaterial3: true,
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.red).copyWith(
          onSurface: Colors.yellow,
          onSurfaceVariant: Colors.green,
        ),
      ),
      home: const Scaffold(
        body: Center(
          child: ListTile(
            title: Text('title'),
            subtitle: Text('subtitle'),
          ),
        ),
      ),
    );
  }
}

Description

M3 ListTile couldn't be customized using ColorScheme colors.

  • This PR updates the list tile text defaults to ColorScheme text color tokens.
  • Improved the ListTile template to use the token group.
  • Update docs and tests.
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.red).copyWith(
          onSurface: Colors.yellow,
          onSurfaceVariant: Colors.green,
        ),

Before

Screenshot 2023-06-09 at 17 47 04

After

Screenshot 2023-06-09 at 17 46 17

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions Bot added p: material_ui material_ui package in flutter/packages framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Jun 9, 2023

@guidezpl guidezpl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just about to file an issue for this and found this PR... you're amazing

  _    ___ _____ __  __ 
 | |  / __|_   _|  \/  |
 | |_| (_ | | | | |\/| |
 |____\___| |_| |_|  |_|
                        

Comment thread dev/tools/gen_defaults/bin/gen_defaults.dart Outdated
Comment thread dev/tools/gen_defaults/lib/list_tile_template.dart Outdated
@TahaTesser
TahaTesser marked this pull request as ready for review June 9, 2023 15:17
@TahaTesser TahaTesser added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 9, 2023
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 10, 2023
@auto-submit

auto-submit Bot commented Jun 10, 2023

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter, pr: 128581, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@TahaTesser TahaTesser added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 12, 2023
@auto-submit
auto-submit Bot merged commit ca5aa23 into flutter:master Jun 12, 2023
@TahaTesser
TahaTesser deleted the update_m3_text_color_defaults branch June 12, 2023 14:53
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 12, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 12, 2023
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jun 12, 2023
flutter/flutter@3df163f...353b8bc

2023-06-12 [email protected] Roll Packages from afe2f05 to c9865e8 (6 revisions) (flutter/flutter#128701)
2023-06-12 [email protected] Fix RangeSlider notifies start and end twice when participates in gesture arena (flutter/flutter#128674)
2023-06-12 [email protected] Address leak tracker breaking changes. (flutter/flutter#128623)
2023-06-12 [email protected] Update `ListTile` text defaults to use `ColorScheme` (flutter/flutter#128581)
2023-06-12 [email protected] Roll Flutter Engine from effea50196ca to 4b022f4e871f (2 revisions) (flutter/flutter#128683)
2023-06-12 [email protected] Roll Flutter Engine from 9bb0a5907403 to effea50196ca (1 revision) (flutter/flutter#128678)
2023-06-11 [email protected] Roll Flutter Engine from 788437e41ee0 to 9bb0a5907403 (1 revision) (flutter/flutter#128673)
2023-06-11 [email protected] Roll Flutter Engine from 5da44b9aafdd to 788437e41ee0 (2 revisions) (flutter/flutter#128672)
2023-06-11 [email protected] Roll Flutter Engine from 6e2c71adccad to 5da44b9aafdd (1 revision) (flutter/flutter#128669)
2023-06-11 [email protected] Roll Flutter Engine from 1cca9cc6dbd1 to 6e2c71adccad (1 revision) (flutter/flutter#128662)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
flutter/flutter@3df163f...353b8bc

2023-06-12 [email protected] Roll Packages from afe2f05 to c9865e8 (6 revisions) (flutter/flutter#128701)
2023-06-12 [email protected] Fix RangeSlider notifies start and end twice when participates in gesture arena (flutter/flutter#128674)
2023-06-12 [email protected] Address leak tracker breaking changes. (flutter/flutter#128623)
2023-06-12 [email protected] Update `ListTile` text defaults to use `ColorScheme` (flutter/flutter#128581)
2023-06-12 [email protected] Roll Flutter Engine from effea50196ca to 4b022f4e871f (2 revisions) (flutter/flutter#128683)
2023-06-12 [email protected] Roll Flutter Engine from 9bb0a5907403 to effea50196ca (1 revision) (flutter/flutter#128678)
2023-06-11 [email protected] Roll Flutter Engine from 788437e41ee0 to 9bb0a5907403 (1 revision) (flutter/flutter#128673)
2023-06-11 [email protected] Roll Flutter Engine from 5da44b9aafdd to 788437e41ee0 (2 revisions) (flutter/flutter#128672)
2023-06-11 [email protected] Roll Flutter Engine from 6e2c71adccad to 5da44b9aafdd (1 revision) (flutter/flutter#128669)
2023-06-11 [email protected] Roll Flutter Engine from 1cca9cc6dbd1 to 6e2c71adccad (1 revision) (flutter/flutter#128662)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
flutter/flutter@3df163f...353b8bc

2023-06-12 [email protected] Roll Packages from 9e0fadb to ada07ff (6 revisions) (flutter/flutter#128701)
2023-06-12 [email protected] Fix RangeSlider notifies start and end twice when participates in gesture arena (flutter/flutter#128674)
2023-06-12 [email protected] Address leak tracker breaking changes. (flutter/flutter#128623)
2023-06-12 [email protected] Update `ListTile` text defaults to use `ColorScheme` (flutter/flutter#128581)
2023-06-12 [email protected] Roll Flutter Engine from effea50196ca to 4b022f4e871f (2 revisions) (flutter/flutter#128683)
2023-06-12 [email protected] Roll Flutter Engine from 9bb0a5907403 to effea50196ca (1 revision) (flutter/flutter#128678)
2023-06-11 [email protected] Roll Flutter Engine from 788437e41ee0 to 9bb0a5907403 (1 revision) (flutter/flutter#128673)
2023-06-11 [email protected] Roll Flutter Engine from 5da44b9aafdd to 788437e41ee0 (2 revisions) (flutter/flutter#128672)
2023-06-11 [email protected] Roll Flutter Engine from 6e2c71adccad to 5da44b9aafdd (1 revision) (flutter/flutter#128669)
2023-06-11 [email protected] Roll Flutter Engine from 1cca9cc6dbd1 to 6e2c71adccad (1 revision) (flutter/flutter#128662)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App c: contributor-productivity Team-specific productivity, code health, technical debt. framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subtitle's color in ListTile doesn't match M3 specs.

2 participants