Skip to content

Conversation

@Renzo-Olivares
Copy link
Contributor

@Renzo-Olivares Renzo-Olivares commented Aug 24, 2023

Fixes #133027

When setting a textButtonTheme it should not override the native context menu colors.

  theme: ThemeData(
    textButtonTheme: const TextButtonThemeData(
      style: ButtonStyle(
        backgroundColor: MaterialStatePropertyAll<Color>(
            Color(0xff05164d)), // blue color
      ),
    ),
  ),
Before After
Screenshot 2023-08-24 at 1 17 25 PM Screenshot 2023-08-24 at 1 15 35 PM

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.

@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: material design flutter/packages/flutter/material repository. labels Aug 24, 2023
@Renzo-Olivares Renzo-Olivares changed the title Fix Android Context Menu when textButtonTheme is set Fix context menu color on Android when textButtonTheme is set Aug 24, 2023
@Renzo-Olivares Renzo-Olivares marked this pull request as ready for review August 24, 2023 20:37
@Renzo-Olivares Renzo-Olivares force-pushed the material-context-menu-fix branch from fed4fa2 to a4e0bcc Compare August 24, 2023 20:38
@Renzo-Olivares Renzo-Olivares changed the title Fix context menu color on Android when textButtonTheme is set Fix context menu button color on Android when textButtonTheme is set Aug 24, 2023
@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 #133271 at sha a4e0bcca9c16282ae2bf0275f84d5a1e228b1fcc

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Aug 24, 2023
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.

One idea about how to simplify this, but if I'm wrong then it looks fine as-is.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we supposed to use testWidgetsWithLeakTracking for everything now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure about that. @polina-c do you have any thoughts on when we should use testWidgetsWithLeakTracing?

Copy link
Contributor

Choose a reason for hiding this comment

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

What if you just hardcode this backgroundColor to transparent?

In my context menu color PR, I set the context menu's background color to surface on the TextSelectionToolbar under the assumption that these TextSelectionToolbarButtons would be transparent and so look like the color behind them. It looks like the problem in this issue is that setting textButtonTheme's backgroundColor changes the buttons to be non-transparent.

Just a hunch, let me know if it works. If so, maybe it's a preferable solution since the logic about the color of these buttons isn't stored in two places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense! Changing the backgroundColor to Colors.transparent works as expected.

@Renzo-Olivares Renzo-Olivares force-pushed the material-context-menu-fix branch from 865a025 to 78d3b75 Compare August 28, 2023 20:45
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 👍

@Renzo-Olivares Renzo-Olivares added autosubmit Merge PR when tree becomes green via auto submit App and removed autosubmit Merge PR when tree becomes green via auto submit App labels Aug 28, 2023
@auto-submit auto-submit bot merged commit ca33836 into flutter:master Aug 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 29, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 29, 2023
flutter/flutter@ec387a4...6c95737

2023-08-29 [email protected] Roll Flutter Engine from d84763e04496 to 65438c7bb46a (1 revision) (flutter/flutter#133563)
2023-08-29 [email protected] Roll Flutter Engine from 0625049b5ee3 to d84763e04496 (6 revisions) (flutter/flutter#133559)
2023-08-29 [email protected] Roll Flutter Engine from c2ec683c4ea8 to 0625049b5ee3 (2 revisions) (flutter/flutter#133538)
2023-08-29 [email protected] Roll Flutter Engine from 3d1faae1bc2f to c2ec683c4ea8 (4 revisions) (flutter/flutter#133535)
2023-08-29 [email protected] Roll Flutter Engine from c7c61ff9732c to 3d1faae1bc2f (1 revision) (flutter/flutter#133530)
2023-08-29 [email protected] Fix bug in setPreferredOrientations example (flutter/flutter#133503)
2023-08-29 [email protected] Roll Flutter Engine from 9778c2cb1d51 to c7c61ff9732c (2 revisions) (flutter/flutter#133527)
2023-08-29 [email protected] Roll Flutter Engine from ffda7e3cfc7f to 9778c2cb1d51 (1 revision) (flutter/flutter#133526)
2023-08-29 [email protected] Roll Flutter Engine from 1e821961e96a to ffda7e3cfc7f (2 revisions) (flutter/flutter#133523)
2023-08-29 [email protected] Roll Flutter Engine from 45e2b41e5ae5 to 1e821961e96a (2 revisions) (flutter/flutter#133520)
2023-08-29 [email protected] Roll Flutter Engine from bd2132a0814f to 45e2b41e5ae5 (2 revisions) (flutter/flutter#133518)
2023-08-29 [email protected] add missing forwards of local-engine-host in benchmark runners (flutter/flutter#133517)
2023-08-28 [email protected] Roll Flutter Engine from a7a4c1c70bad to bd2132a0814f (3 revisions) (flutter/flutter#133516)
2023-08-28 [email protected] FocusNode and FocusManager should dispatch creation in constructor. (flutter/flutter#133490)
2023-08-28 [email protected] Use flutter pub get instead of dart pub get in create_api_docs.dart (flutter/flutter#133493)
2023-08-28 [email protected] PlatformRouteInformationProvider should dispatch creation in constructor. (flutter/flutter#133492)
2023-08-28 [email protected] Roll Flutter Engine from 91522a188bda to a7a4c1c70bad (11 revisions) (flutter/flutter#133508)
2023-08-28 [email protected] Revert "Remove `ImageProvider.load`, `DecoderCallback` and `PaintingBâ�¦ (flutter/flutter#133482)
2023-08-28 [email protected] Fix context menu button color on Android when textButtonTheme is set (flutter/flutter#133271)
2023-08-28 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.21.4 to 2.21.5 (flutter/flutter#133504)
2023-08-28 [email protected] Fix  `DatePickerDialog` & `DateRangePickerDialog` overflow when resized from landscape to portrait (flutter/flutter#133327)
2023-08-28 [email protected] Empty commit to re-trigger tests (flutter/flutter#133495)
2023-08-28 [email protected] Revert "PlatformRouteInformationProvider  should dispatch creation in constructor." (flutter/flutter#133479)
2023-08-28 [email protected] Revert "FocusNode and FocusManager should dispatch creation in constructor." (flutter/flutter#133474)

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] 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 Nov 15, 2023
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 autosubmit Merge PR when tree becomes green via auto submit App 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.

Options (i.e copy,cut,paste) selecting the text from app is not clear in android

2 participants