-
Notifications
You must be signed in to change notification settings - Fork 29.7k
fix(scrollbar): Update padding type to EdgeInsetsGeometry #172056
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
fix(scrollbar): Update padding type to EdgeInsetsGeometry #172056
Conversation
- Change RawScrollbar padding parameter from EdgeInsets to EdgeInsetsGeometry - This allows support for both logical and physical padding - Enables proper RTL (Right-to-Left) layout support for scroll bars This change is part of Flutter's ongoing RTL support improvements, allowing the scrollbar to work correctly in both LTR and RTL layouts. Fixes flutter#167922
- Add test case for scrollbar with EdgeInsetsDirectional padding - Verify scrollbar positioning with directional padding values - Test both overscroll and regular scroll scenarios - Ensure proper RTL layout support This test complements the recent change to support EdgeInsetsGeometry in the scrollbar widget. Fixes: flutter#167922
victorsanni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for this PR.
justinmc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you again for helping Flutter have better RTL support!
| assert( | ||
| textDirection != null, | ||
| 'A TextDirection must be provided before a Scrollbar can be painted.', | ||
| ); | ||
| _resolvedPadding = padding.resolve(textDirection); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this assert, it looks like textDirection is now effectively required?
Would it be possible to only resolve this if necessary, like if it's an EdgeInsetsGeometry and textDirection is non-null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was previously on the line 556.
Yeah that's a better idea.
What about setting default a value TextDirection.ltr to textDirection if no text direction was provided? Because right now textDirection is required anyways. see https://github.com/flutter/flutter/pull/172056/files#diff-7ea53e627d4729db3a54ab440e8f6d2610cbfc44ac4f9718daef49b2b4645f2dL556
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about the developer experience for RTL users in the case where there is a default? If they pass an EdgeInsetsDirectional, do they want to be warned if there is no TextDirection or would they be ok with an LTR default?
I see this wouldn't be the only place where we default to LTR:
| this.direction = TextDirection.ltr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think current approach is good for RTL users as well, they can change position of almost anything just by defining the locale parameter in MaterialApp or CuppertinoApp. I explained a bit about it here.
justinmc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits 👍 . I like your _resolvedPadding approach, thanks for fixing that.
| } | ||
|
|
||
| _textDirection = value; | ||
| _resolvedPadding = _padding.resolve(_textDirection); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible that _textDirection is null and valuepadding is EdgeInsetsDirectional. Do we need another assert here similar to the one in the constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I don't think _textDirection and textDirection could be null, and also the value here is a TextDirection?.
Do we need another assert here similar to the one in the constructor?
We can make sure of this:
set textDirection(TextDirection? value) {
assert(value != null, 'A non-null textDirection must be provided.');
assert(
padding is! EdgeInsetsDirectional || value != null,
'A non-null textDirection must be provided when using EdgeInsetsDirectional for padding.',
);
if (textDirection == value) {
return;
}
_textDirection = value;
_resolvedPadding = _padding.resolve(_textDirection);
notifyListeners();
}But generally this textDirection is based on the Locale and/or Directionality of the App/Context. So it wouldn't be null and if the 'locale' is null then the system's locale value is used. by default.
See:
flutter/packages/flutter/lib/src/widgets/app.dart
Lines 877 to 884 in dcae0c4
| /// The initial locale for this app's [Localizations] widget is based | |
| /// on this value. | |
| /// | |
| /// If the 'locale' is null then the system's locale value is used. | |
| /// | |
| /// The value of [Localizations.locale] will equal this locale if | |
| /// it matches one of the [supportedLocales]. Otherwise it will be | |
| /// the first element of [supportedLocales]. |
See below for both Material and Cupertino:
| ..textDirection = Directionality.of(context) |
| ..textDirection = Directionality.of(context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I meant padding not value. And that makes sense, thanks for the explanation.
| assert( | ||
| textDirection != null, | ||
| 'A TextDirection must be provided before a Scrollbar can be painted.', | ||
| ); | ||
| _resolvedPadding = padding.resolve(textDirection); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about the developer experience for RTL users in the case where there is a default? If they pass an EdgeInsetsDirectional, do they want to be warned if there is no TextDirection or would they be ok with an LTR default?
I see this wouldn't be the only place where we default to LTR:
| this.direction = TextDirection.ltr, |
|
Warning There is an error in the Gemini Code Assist config file for this repository at |
|
autosubmit label was removed for flutter/flutter/172056, because - The status or check suite Windows framework_tests_libraries has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
@SalehTZ The test is an isolates test failure that must be a flake, I've seen it on another PR this morning. If it doesn't go green, can you try rebasing? |
flutter/flutter@46b097a...c3279ca 2025-07-30 [email protected] Roll Skia from 00765f238077 to da5a6704f8a3 (1 revision) (flutter/flutter#172966) 2025-07-30 [email protected] Roll Skia from 62476cd444d2 to 00765f238077 (3 revisions) (flutter/flutter#172955) 2025-07-30 [email protected] Roll Skia from 34693354289f to 62476cd444d2 (1 revision) (flutter/flutter#172950) 2025-07-30 [email protected] Roll Skia from f72bd01a49b1 to 34693354289f (1 revision) (flutter/flutter#172946) 2025-07-30 [email protected] [a11y] add RangeSlider to a11y test app as additional use-case (flutter/flutter#172922) 2025-07-30 [email protected] Roll Skia from a42898e5d622 to f72bd01a49b1 (21 revisions) (flutter/flutter#172944) 2025-07-29 [email protected] Fix SegmentedButton border doesn't reflect states (flutter/flutter#172754) 2025-07-29 [email protected] Fix documentation for FlutterEngineRunTask (flutter/flutter#172889) 2025-07-29 [email protected] Roll Fuchsia Linux SDK from tK_PAaLeo0pUxi8hv... to bQVQlLssTxxLjoDU0... (flutter/flutter#172925) 2025-07-29 [email protected] fix(scrollbar): Update padding type to EdgeInsetsGeometry (flutter/flutter#172056) 2025-07-29 [email protected] Refactor Android platform view code in advance of enabling HCPP on existing PV widgets (behind a flag) (flutter/flutter#170553) 2025-07-29 [email protected] Roll Packages from 6b2e34e to ed235d1 (4 revisions) (flutter/flutter#172905) 2025-07-29 [email protected] Add package PR triage note (flutter/flutter#172898) 2025-07-29 [email protected] Roll Skia from 409e1c7ba09b to a42898e5d622 (29 revisions) (flutter/flutter#172906) 2025-07-29 [email protected] Made `android_gradle_print_build_variants_test.dart` more robust (flutter/flutter#172910) 2025-07-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reland licenses cpp switch (#172671)" (flutter/flutter#172912) 2025-07-29 [email protected] Fix Gemini Code Assist for GitHub config yaml (flutter/flutter#172887) 2025-07-29 [email protected] Marks Linux_android_emu_unstable android_defines_test to be unflaky (flutter/flutter#171856) 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://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
…r#9699) flutter/flutter@46b097a...c3279ca 2025-07-30 [email protected] Roll Skia from 00765f238077 to da5a6704f8a3 (1 revision) (flutter/flutter#172966) 2025-07-30 [email protected] Roll Skia from 62476cd444d2 to 00765f238077 (3 revisions) (flutter/flutter#172955) 2025-07-30 [email protected] Roll Skia from 34693354289f to 62476cd444d2 (1 revision) (flutter/flutter#172950) 2025-07-30 [email protected] Roll Skia from f72bd01a49b1 to 34693354289f (1 revision) (flutter/flutter#172946) 2025-07-30 [email protected] [a11y] add RangeSlider to a11y test app as additional use-case (flutter/flutter#172922) 2025-07-30 [email protected] Roll Skia from a42898e5d622 to f72bd01a49b1 (21 revisions) (flutter/flutter#172944) 2025-07-29 [email protected] Fix SegmentedButton border doesn't reflect states (flutter/flutter#172754) 2025-07-29 [email protected] Fix documentation for FlutterEngineRunTask (flutter/flutter#172889) 2025-07-29 [email protected] Roll Fuchsia Linux SDK from tK_PAaLeo0pUxi8hv... to bQVQlLssTxxLjoDU0... (flutter/flutter#172925) 2025-07-29 [email protected] fix(scrollbar): Update padding type to EdgeInsetsGeometry (flutter/flutter#172056) 2025-07-29 [email protected] Refactor Android platform view code in advance of enabling HCPP on existing PV widgets (behind a flag) (flutter/flutter#170553) 2025-07-29 [email protected] Roll Packages from 6b2e34e to ed235d1 (4 revisions) (flutter/flutter#172905) 2025-07-29 [email protected] Add package PR triage note (flutter/flutter#172898) 2025-07-29 [email protected] Roll Skia from 409e1c7ba09b to a42898e5d622 (29 revisions) (flutter/flutter#172906) 2025-07-29 [email protected] Made `android_gradle_print_build_variants_test.dart` more robust (flutter/flutter#172910) 2025-07-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reland licenses cpp switch (#172671)" (flutter/flutter#172912) 2025-07-29 [email protected] Fix Gemini Code Assist for GitHub config yaml (flutter/flutter#172887) 2025-07-29 [email protected] Marks Linux_android_emu_unstable android_defines_test to be unflaky (flutter/flutter#171856) 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://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
…2056) <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> This PR enhances RTL support for the RawScrollbar widget by updating its padding type and adding comprehensive tests. The changes include: 1. Updating RawScrollbar's `padding` parameter from `EdgeInsets` to `EdgeInsetsGeometry` - This change is non-breaking because `EdgeInsets` is a subclass of `EdgeInsetsGeometry` - Existing code using `EdgeInsets` will continue to work as before - Users can now optionally use `EdgeInsetsDirectional` for RTL support 2. Adding a test case that verifies scrollbar positioning with EdgeInsetsDirectional padding 3. Testing both overscroll and regular scroll scenarios with directional padding These changes ensure that the scrollbar works correctly in both LTR and RTL layouts, improving accessibility and internationalization support. Fixes: flutter#167922 ## Pre-launch Checklist - [x] I read the [Contributor Guide](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md) wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide](https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md), including [Features we expect every widget to implement](https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement). - [x] I signed the [CLA](https://cla.developers.google.com/). - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord](https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md). <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
…2056) <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> This PR enhances RTL support for the RawScrollbar widget by updating its padding type and adding comprehensive tests. The changes include: 1. Updating RawScrollbar's `padding` parameter from `EdgeInsets` to `EdgeInsetsGeometry` - This change is non-breaking because `EdgeInsets` is a subclass of `EdgeInsetsGeometry` - Existing code using `EdgeInsets` will continue to work as before - Users can now optionally use `EdgeInsetsDirectional` for RTL support 2. Adding a test case that verifies scrollbar positioning with EdgeInsetsDirectional padding 3. Testing both overscroll and regular scroll scenarios with directional padding These changes ensure that the scrollbar works correctly in both LTR and RTL layouts, improving accessibility and internationalization support. Fixes: flutter#167922 ## Pre-launch Checklist - [x] I read the [Contributor Guide](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md) wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide](https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md), including [Features we expect every widget to implement](https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement). - [x] I signed the [CLA](https://cla.developers.google.com/). - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord](https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md). <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
…2056) <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> This PR enhances RTL support for the RawScrollbar widget by updating its padding type and adding comprehensive tests. The changes include: 1. Updating RawScrollbar's `padding` parameter from `EdgeInsets` to `EdgeInsetsGeometry` - This change is non-breaking because `EdgeInsets` is a subclass of `EdgeInsetsGeometry` - Existing code using `EdgeInsets` will continue to work as before - Users can now optionally use `EdgeInsetsDirectional` for RTL support 2. Adding a test case that verifies scrollbar positioning with EdgeInsetsDirectional padding 3. Testing both overscroll and regular scroll scenarios with directional padding These changes ensure that the scrollbar works correctly in both LTR and RTL layouts, improving accessibility and internationalization support. Fixes: flutter#167922 ## Pre-launch Checklist - [x] I read the [Contributor Guide](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md) wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide](https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md), including [Features we expect every widget to implement](https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement). - [x] I signed the [CLA](https://cla.developers.google.com/). - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord](https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md). <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
…2056) <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> This PR enhances RTL support for the RawScrollbar widget by updating its padding type and adding comprehensive tests. The changes include: 1. Updating RawScrollbar's `padding` parameter from `EdgeInsets` to `EdgeInsetsGeometry` - This change is non-breaking because `EdgeInsets` is a subclass of `EdgeInsetsGeometry` - Existing code using `EdgeInsets` will continue to work as before - Users can now optionally use `EdgeInsetsDirectional` for RTL support 2. Adding a test case that verifies scrollbar positioning with EdgeInsetsDirectional padding 3. Testing both overscroll and regular scroll scenarios with directional padding These changes ensure that the scrollbar works correctly in both LTR and RTL layouts, improving accessibility and internationalization support. Fixes: flutter#167922 ## Pre-launch Checklist - [x] I read the [Contributor Guide](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md) wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide](https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md), including [Features we expect every widget to implement](https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement). - [x] I signed the [CLA](https://cla.developers.google.com/). - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord](https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md). <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
This PR enhances RTL support for the RawScrollbar widget by updating its padding type and adding comprehensive tests.
The changes include:
paddingparameter fromEdgeInsetstoEdgeInsetsGeometryEdgeInsetsis a subclass ofEdgeInsetsGeometryEdgeInsetswill continue to work as beforeEdgeInsetsDirectionalfor RTL supportThese changes ensure that the scrollbar works correctly in both LTR and RTL layouts, improving accessibility and internationalization support.
Fixes: #167922
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.