Ramon Farizel
8cdb466a8a
Fix Scrollbar drag behavior ( #179199 )
...
<!--
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
-->
Updates `_canHandleScrollGestures()` to check if there's an actual
scrollable range (`maxScrollExtent > minScrollExtent`) instead of only
checking if `maxScrollExtent > 0.0`.
Fixes https://github.com/flutter/flutter/issues/178863
## Pre-launch Checklist
- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [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, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code ).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- 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
---------
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
2025-12-09 20:24:24 +00:00
Kate Lovett
9d96df2364
Modernize framework lints ( #179089 )
...
WIP
Commits separated as follows:
- Update lints in analysis_options files
- Run `dart fix --apply`
- Clean up leftover analysis issues
- Run `dart format .` in the right places.
Local analysis and testing passes. Checking CI now.
Part of https://github.com/flutter/flutter/issues/178827
- Adoption of flutter_lints in examples/api coming in a separate change
(cc @loic-sharma)
## 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.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code ).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- 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
2025-11-26 01:10:39 +00:00
Kishan Rathore
433e543260
Fix: Assertion failure in RawScrollbarState with dynamic controller assignment ( #173156 )
...
Fix: Assertion failure in RawScrollbarState with dynamic controller
assignment
fixes : #172614
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [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, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-09-02 20:25:08 +00:00
Loïc Sharma
384331e171
Migrate to list and builder Sliver convenience constructors ( #173011 )
...
In 2022, we introduced new convenience constructors like
`SliverList.builder` and `SliverList.list`. Unfortunately, LLMs like
Gemini seem to prefer the delegate pattern even when these convenience
constructors are usable. This updates Flutter's docs, code, and tests to
use these convenience constructors where possible. Hopefully this will
nudge LLMs to consider using the new APIs :)
I migrated 80% of the code by hand, and 20% using Gemini CLI. See
[go/loic-ai-log](http://goto.google.com/loic-ai-log ) (Google internal)
for details.
There's a few locations that I wasn't able to migrate to the convenience
constructors due to missing APIs. I filed the following issues:
1. https://github.com/flutter/flutter/issues/173018
2. https://github.com/flutter/flutter/issues/173019
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] 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, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code ).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- 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
2025-08-04 22:32:22 +00:00
Alex Talebi
a5934ee348
fix(scrollbar): Update padding type to EdgeInsetsGeometry ( #172056 )
...
<!--
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 : #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
2025-07-29 20:51:22 +00:00
greyovo
1cc9fcb587
Fix dragging scrollbar down causes unexpected behavior when scrollable has a negative minScrollExtent ( #170331 )
...
<!--
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 fixed #170246 .
In the original method for calculating the thumb position based on the
offset, the minimum scroll distance was assumed to be 0 by default,
which caused the scrollbar offset fraction to be constrained between 0
and 1. However, when minScrollExtent is negative, this range is
incorrect.
Modifications are listed below:
- The valid range has been updated to be between `minScrollExtent /
scrollableExtent` and `maxScrollExtent / scrollableExtent`.
- Added corresponding test cases for this change.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [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, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- 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
2025-06-16 18:40:00 +00:00
Flop
1dd3f5d45b
Fix unexpected shown of Scrollbar ( #159386 )
...
Fixes [Narrow DatePickerDialog has unnecessary scrollbar on months with
6 rows #141348 ](https://github.com/flutter/flutter/issues/141348 )
## Details
`288 / 7 + 288 / 7 * 6 = 288.00000000000006`
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- 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
2025-01-30 17:33:05 +00:00
Michael Goderbauer
5491c8c146
Auto-format Framework ( #160545 )
...
This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.
**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.
---------
Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
2024-12-19 20:06:21 +00:00
Anis Alibegić
e2ada1c939
Fixed typos ( #159331 )
...
Here's another one of my PRs where I hunt for typos across `flutter`
repo.
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] 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].
- [x] All existing and new tests are passing.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#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/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-12-05 16:54:09 +00:00
Jason Simmons
4f2211b550
Determine the scroll gesture axis based on the effectiveScrollController ( #156190 )
...
Fixes https://github.com/flutter/flutter/issues/154520
2024-10-15 20:58:51 +00:00
Konstantin Scheglov
74a31399e1
Remove unnecessary imports. ( #154527 )
...
With https://dart-review.googlesource.com/c/sdk/+/382901 we will start checking it differently, and find more unnecessary imports.
2024-09-03 16:14:44 +00:00
Hans Muller
e4c18b702a
Improve the behavior of scrollbar drag-scrolls triggered by the trackpad ( #150275 )
...
Corrects some problems related to trackpad scrolls introduced by https://github.com/flutter/flutter/pull/146654 .
Fixes https://github.com/flutter/flutter/issues/149999
Fixes #150342
Fixes https://github.com/flutter/flutter/issues/150236
2024-06-27 00:50:26 +00:00
Hans Muller
1b8dc90590
RawScrollbar: don't listen for drag gestures when scrolling is not possible ( #149925 )
...
Fixes https://github.com/flutter/flutter/issues/149803
2024-06-13 17:20:58 +00:00
Hans Muller
92f8455ff8
Scrollbar thumb drag gestures now produce one start and one end scroll notification ( #146654 )
...
The scroll notification events reported for a press-drag-release gesture within a scrollable on a touch screen device begin with a `ScrollStartNotification`, followed by a series of `ScrollUpdateNotifications`, and conclude with a `ScrollEndNotification`. This protocol can be used to defer work until an interactive scroll gesture ends. For example, you might defer updating a scrollable's contents via network requests until the scroll has ended, or you might want to automatically auto-scroll at that time.
In the example that follows the CustomScrollView automatically scrolls so that the last partially visible fixed-height item is completely visible when the scroll gesture ends. Many iOS applications do this kind of thing. It only makes sense to auto-scroll when the user isn't actively dragging the scrollable around.
It's easy enough to do this by reacting to a ScrollEndNotifcation by auto-scrolling to align the last fixed-height list item ([source code](https://gist.github.com/HansMuller/13e2a7adadc9afb3803ba7848b20c410 )).
https://github.com/flutter/flutter/assets/1377460/a6e6fc77-6742-4f98-81ba-446536535f73
Dragging the scrollbar thumb in a desktop application is a similar user gesture. Currently it's not possible to defer work or auto-scroll (or whatever) while the scrollable is actively being dragged via the scrollbar thumb because each scrollbar thumb motion is mapped to a scroll start - scroll update - scroll end series of notifications. On a desktop platform, the same code behaves quite differently when the scrollbar thumb is dragged.
https://github.com/flutter/flutter/assets/1377460/2593d8a3-639c-407f-80c1-6e6f67fb8c5f
The stream of scroll-end events triggers auto-scrolling every time the thumb moves. From the user's perspective this feels like a losing struggle.
One can also detect the beginning and end of a touch-drag by listening to the value of a ScrollPosition's `isScrollingNotifier`. This approach suffers from a similar problem: during a scrollbar thumb-drag, the `isScrollingNotifier` value isn't updated at all.
This PR refactors the RawScrollbar implementation to effectively use a ScrollDragController to manage scrolls caused by dragging the scrollbar's thumb. Doing so means that dragging the thumb will produce the same notifications as dragging the scrollable on a touch device.
Now desktop applications can choose to respond to scrollbar thumb drags in the same that they respond to drag scrolling on a touch screen. With the changes included here, the desktop or web version of the app works as expected, whether you're listing to scroll notifications or the scroll position's `isScrollingNotifier`.
https://github.com/flutter/flutter/assets/1377460/67435c40-a866-4735-a19b-e3d68eac8139
This PR also makes the second [ScrollPosition API doc example](https://api.flutter.dev/flutter/widgets/ScrollPosition-class.html#cupertino.ScrollPosition.2 ) work as expected when used with the DartPad that's part of API doc page.
Desktop applications also see scroll start-update-end notifications due to the mouse wheel. There is no touch screen analog for the mouse wheel, so an application that wanted to enable this kind of auto-scrolling alignment would have to include a heuristic that dealt with the sequence of small scrolls triggered by the mouse wheel. Here's an example of that: [source code](https://gist.github.com/HansMuller/ce5c474a458f5f4bcc07b0d621843165 ). This version of the app does not auto-align in response to small changes, wether they're triggered by dragging the scrollbar thumb of the mouse wheel.
Related sliver utility PRs: https://github.com/flutter/flutter/pull/143538 , https://github.com/flutter/flutter/pull/143196 , https://github.com/flutter/flutter/pull/143325 .
2024-06-04 22:02:12 +00:00
Nate
b9e537336f
Turning if chains into shorter switch statements ( #144977 )
...
This pull request is part of the effort to solve issue #144903 .
In the past, my efforts to reduce line length involved refactoring away from switch statements, but unlike [yesterday's PR](https://github.com/flutter/flutter/pull/144905 ), this one is full of switch statements that make things more concise!
2024-03-13 17:16:17 +00:00
Loïc Sharma
b4270f7b06
Improve some scrollbar error messages ( #143279 )
...
Adds some missing spaces, rewords some errors, and splits some errors into more lines.
2024-02-13 22:46:56 +00:00
Polina Cherkasova
baf739c8e6
Remove usage of testWidgetsWithLeakTracking. ( #140239 )
2023-12-15 14:13:31 -08:00
Kostia Sokolovskyi
98ebab58ee
Cover more test/widgets tests with leak tracking #8 ( #135045 )
2023-09-20 07:34:41 -07:00
Kate Lovett
f054f5aa09
Move mock canvas to flutter_test ( #131631 )
...
Fixes https://github.com/flutter/flutter/issues/59413
This relocates `mock_canvas.dart` and `recording_canvas.dart` from `flutter/test/rendering` to `flutter_test`.
The testing functionality afforded by mock_canvas should be available to everyone, not just the framework. :)
mock_canvas.dart needed a bit of cleanup - things like formatting and super parameters.
2023-08-07 23:43:03 +00:00
Kate Lovett
a3ddead1a4
Remove scrollbar deprecations isAlwaysShown and hoverThickness ( #127351 )
...
The deprecated `[RawScrollbar/Scrollbar/CupertinoScrollbar/ScrollbarThemeData].isAlwaysShown` has expired and is removed in thi PR.
Also, `Scrollbar.hoverThickness` is also removed after having expired.
The replacement for `isAlwaysShown` is `thumbVisibility`. This deprecation was introduced in #96957 . The name change came from new behaviors like a track that is conditionally visible. Since the original API only referred to the thumb, the name was changed to reflect this intention. This change is supported by dart fix. â
The replacement for `hoverThickness` is `ScrollbarThemeData.thickness`, which is a MaterialStateProperty that allows for the thickness to respond to multiple states including hover. This deprecation was introduced in #97173 . This change is not supported by dart fix. ð
Part of https://github.com/flutter/flutter/issues/127042
2023-06-05 21:15:32 +00:00
Michael Goderbauer
fda9ecfef7
Remove 1745 decorative breaks ( #123259 )
...
Remove 1745 decorative breaks
2023-03-22 21:12:22 +00:00
pdblasi-google
7ba1d5ec1b
Updates flutter/test/widgets to no longer reference TestWindow ( #122354 )
...
Updates `flutter/test/widgets` to no longer reference `TestWindow`
2023-03-14 18:19:17 +00:00
xubaolin
c0e748fbf6
fix a scroll bar stutter bug ( #121786 )
...
Fix a scrolling stutter caused by dragging scrollbar
2023-03-09 00:18:18 +00:00
Michael Goderbauer
fdc25a1700
Reland "Remove single-view assumption from ScrollPhysics ( #117503 )" ( #117916 )
...
This reverts commit c956121ac098b91061bfc0a93c930121ff3279ba.
2023-01-03 21:34:08 +00:00
Xilai Zhang
c956121ac0
Revert "Remove single-view assumption from ScrollPhysics ( #117503 )" ( #117647 )
...
This reverts commit 999356b776f70132d569a37f13f65333a1bb0779.
2022-12-27 21:22:16 +00:00
Michael Goderbauer
999356b776
Remove single-view assumption from ScrollPhysics ( #117503 )
...
* Remove single-view assumption from ScrollPhysics
* fix scrollable_dispose_test.dart
* add deprecated method back
2022-12-22 21:54:09 +00:00
xubaolin
1aada6fc5c
[New Feature]Support mouse wheel event on the scrollbar widget ( #109659 )
...
* rebase master and add a test
* fix the test
* fix the test
* fix the test
2022-11-05 00:57:52 +00:00
xubaolin
6154b3b4bd
Improve Scrollbar drag behavior ( #112434 )
2022-10-24 23:45:04 +00:00
Kate Lovett
1b583a837d
Revert "Fix Scrollbar thumb drag behavior on desktop." ( #111978 )
2022-09-20 16:51:13 +00:00
Taha Tesser
ff6aa928aa
Fix Scrollbar thumb drag behavior on desktop. ( #111250 )
2022-09-19 07:51:16 +00:00
Bernardo Ferrari
01f3fca3f5
Improve ShapeDecoration performance. ( #108648 )
2022-08-17 19:25:06 +00:00
xubaolin
3d94a014b7
Scrollbar respect the NeverScrollableScrollPhysics physics ( #109609 )
2022-08-17 00:58:11 +00:00
Kate Lovett
f852c46c87
Expose padding on RawScrollbar ( #107756 )
2022-07-19 13:26:07 +00:00
Kate Lovett
2987d9e10a
Fix scrollbar margins ( #107172 )
2022-07-14 20:56:08 +00:00
Kate Lovett
017fc6c907
Fix RawScrollbar colors ( #107177 )
2022-07-07 03:38:05 +00:00
Kate Lovett
6806884525
Fix scrollbar track offset ( #106835 )
2022-06-30 20:30:05 +00:00
Kate Lovett
9f4b9bfd49
Apply PrimaryScrollController updates to SingleChildScrollView ( #106430 )
2022-06-23 17:27:09 +00:00
Kate Lovett
784520bd04
Updating PrimaryScrollController for Desktop ( #102099 )
2022-06-09 16:49:45 -05:00
Pierre-Louis
2aa348b940
Use curly_braces_in_flow_control_structures for widgets ( #104609 )
...
* Use `curly_braces_in_flow_control_structures` for `widgets`
* fix comments
* fix comments
2022-05-26 09:48:09 +02:00
Tong Mu
23bc3d64eb
[Mouse] Remove all pointers at the end of tests ( #102694 )
2022-05-19 17:48:10 -07:00
xubaolin
93211a48d7
[Scrollbar]Skip the ScrollPosition check if the bar was unmounted ( #103948 )
2022-05-18 20:12:10 -07:00
Phil Quitslund
bca071815f
rename local functions with _s ( #102615 )
2022-04-27 09:14:57 -07:00
xubaolin
4b20ce74e3
Fix a Scrollbar hittest penetration issue ( #99328 )
2022-03-02 10:26:23 -08:00
Viren Khatri
281f1421df
adds trackRadius to ScrollbarPainter and RawScrollbar ( #98018 )
2022-02-24 19:26:23 -08:00
Kate Lovett
e854b8cc88
Update RawScrollbar to support the track ( #97335 )
2022-01-27 16:55:22 -08:00
Kate Lovett
03da339ffe
Deprecate Scrollbar isAlwaysShown -> thumbVisibility ( #96957 )
2022-01-24 14:25:15 -08:00
xubaolin
02bf594f36
fix a scrollbar bug ( #95894 )
2022-01-07 16:20:17 -08:00
xubaolin
765fbe66a7
Fix a scrollbar crash bug ( #92657 )
2021-11-08 09:13:07 -08:00
nt4f04uNd
158939a89d
Scrollbar shouldRepaint to respect the shape ( #91506 )
2021-10-13 17:58:04 -07:00
Ian Hickson
61a0add286
Enable avoid_redundant_argument_values lint ( #91409 ) ( #91462 )
2021-10-08 09:25:14 -07:00