[flutter_markdown] remove backgroundColor from code text theme to enable code selection highlight#7090
Conversation
|
I'll defer to @stuartmorgan if this is the best approach. |
I'm not familiar with this portion of the framework, so I'm not a good authority for this. @HosamHasanRamadan I would suggest asking for feedback on this in the |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
nate-thegrate
left a comment
There was a problem hiding this comment.
IMO, the ideal long-term solution would be to rework this API to use WidgetSpan objects for code snippets, to give full control over the background's padding and border radius.
If that's a bit too much work for your schedule, I think a less disruptive workaround would be to make the following change:
code: theme.textTheme.bodyMedium!.copyWith(
- backgroundColor: theme.cardTheme.color ?? theme.cardColor,
+ backgroundColor: theme.cardTheme.color,
fontFamily: 'monospace',
fontSize: theme.textTheme.bodyMedium!.fontSize! * 0.85,
),We're already planning to get rid of that field at some point (see flutter/flutter#91772), so I'd be down with allowing selection highlight visibility by preemptively removing the theme.cardColor reference here.
|
LGTM once @nate-thegrate's request is integrated. |
|
@nate-thegrate Ok , I will update the PR. |
|
@nate-thegrate What about Cupertino theme color ? |
It looks like the |
nate-thegrate
left a comment
There was a problem hiding this comment.
It looks like Linux repo_checks is failing since this PR currently doesn't include a changelog update.
I imagine we'll be good to land this change once that's addressed :)
nate-thegrate
left a comment
There was a problem hiding this comment.
LGTM, thanks for the contribution!
domesticmouse
left a comment
There was a problem hiding this comment.
PTAL @stuartmorgan
…e to enable code selection highlight (flutter/packages#7090)
…e to enable code selection highlight (flutter/packages#7090)
flutter/packages@f38b780...0321757 2024-09-26 engine-flutter-autoroll@skia.org Roll Flutter from 538e742 to fa402c8 (19 revisions) (flutter/packages#7713) 2024-09-26 hosam.hasan.ramadan@gmail.com [flutter_markdown] remove backgroundColor from code text theme to enable code selection highlight (flutter/packages#7090) 2024-09-26 10687576+bparrishMines@users.noreply.github.com [interactive_media_ads] Adds internal wrapper for iOS native `IMAFriendlyObstruction` (flutter/packages#7696) 2024-09-26 matanlurey@users.noreply.github.com Add a `@SuppressWarnings` in advance (flutter/packages#7712) 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-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@f38b780...0321757 2024-09-26 engine-flutter-autoroll@skia.org Roll Flutter from 538e742 to fa402c8 (19 revisions) (flutter/packages#7713) 2024-09-26 hosam.hasan.ramadan@gmail.com [flutter_markdown] remove backgroundColor from code text theme to enable code selection highlight (flutter/packages#7090) 2024-09-26 10687576+bparrishMines@users.noreply.github.com [interactive_media_ads] Adds internal wrapper for iOS native `IMAFriendlyObstruction` (flutter/packages#7696) 2024-09-26 matanlurey@users.noreply.github.com Add a `@SuppressWarnings` in advance (flutter/packages#7712) 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-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
fixes: flutter/flutter#150053
related to : flutter/flutter#96112
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.