Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(ios): correctly inherits the handle color from the theme #166507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 1, 2025

Conversation

ricardodalarme
Copy link
Contributor

@ricardodalarme ricardodalarme commented Apr 3, 2025

Description

If specified, apply the selectionHandleColor from the theme to the iOS handle.

Related Issue

Minimum reproducible example

import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      theme: ThemeData(
        textSelectionTheme: TextSelectionThemeData(
          selectionHandleColor: Colors.yellow,
        ),
      ),
      home: Scaffold(body: Center(child: TextField())),
    ),
  );
}

Visual Reference

Previous Now

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].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository labels Apr 3, 2025
@ricardodalarme ricardodalarme force-pushed the fix/ios-selection-color branch from e8453ed to 8d6ab5c Compare April 3, 2025 01:49
Copy link
Contributor

@Renzo-Olivares Renzo-Olivares left a comment

Choose a reason for hiding this comment

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

Hi @ricardodalarme, thank you for your contribution. I left a comment regarding current guidance around this issue. Let me know what you think.

@ricardodalarme ricardodalarme force-pushed the fix/ios-selection-color branch from 8d6ab5c to 205c395 Compare April 3, 2025 04:25
@github-actions github-actions bot added the f: material design flutter/packages/flutter/material repository. label Apr 3, 2025
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

At first I dismissed this idea as WAI (see #166506 (comment)), but I think this makes sense. It looks like an easy-ish change to get more alignment between Cupertino and Material themes. @MitchellGoodwin do you know if this works with any upcoming ideas for Cupertino and Material theming?

Also note that this could be a breaking change for people that have previously used primaryColor to control the iOS selection handle color. We should see if the Google tests and customer tests pass.

And FYI there are analyzer failures.

@MitchellGoodwin
Copy link
Contributor

@MitchellGoodwin do you know if this works with any upcoming ideas for Cupertino and Material theming?

This doesn't interfere with anything, and is straightforward enough so I doubt it would cause any extra difficulty when migrating later.

@ricardodalarme ricardodalarme force-pushed the fix/ios-selection-color branch 4 times, most recently from be240ff to 42961b4 Compare April 10, 2025 00:47
@ricardodalarme ricardodalarme force-pushed the fix/ios-selection-color branch 3 times, most recently from c81464f to ad3dd85 Compare April 10, 2025 16:16
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM when the tests are green 👍. I've also triggered the Google tests to run so we'll see how that goes. It looks like the customer tests have passed at least.

@ricardodalarme ricardodalarme force-pushed the fix/ios-selection-color branch 3 times, most recently from 9a5f070 to 23a5f45 Compare April 11, 2025 15:02
@justinmc
Copy link
Contributor

Google tests are green thankfully, but other test checks are failing.

@ricardodalarme ricardodalarme force-pushed the fix/ios-selection-color branch from 23a5f45 to aa2e368 Compare April 12, 2025 05:23
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #166507 at sha aa2e368

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Apr 12, 2025
@ricardodalarme
Copy link
Contributor Author

@justinmc I've just fixed the tests, can you check again please?

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants