@@ -6,14 +6,30 @@ import 'package:flutter_test/flutter_test.dart';
6
6
7
7
/// Simulates the user interacting with a Scrollbar.
8
8
extension ScrollbarInteractions on WidgetTester {
9
+ /// Drag the scrollbar down by [delta] pixels.
10
+ ///
11
+ /// By default, this method expects a single [Scrollbar] in the widget tree and
12
+ /// finds it `byType` . To specify one [Scrollbar] among many, pass a [finder] .
13
+ Future <void > dragScrollbarDown (double delta, [Finder ? finder]) async {
14
+ await _dragScrollbar (delta, finder);
15
+ }
16
+
17
+ /// Drag the scrollbar up by [delta] pixels.
18
+ ///
19
+ /// By default, this method expects a single [Scrollbar] in the widget tree and
20
+ /// finds it `byType` . To specify one [Scrollbar] among many, pass a [finder] .
21
+ Future <void > dragScrollbarUp (double delta, [Finder ? finder]) async {
22
+ await _dragScrollbar (- delta, finder);
23
+ }
24
+
9
25
/// Drag the scrollbar by [delta] pixels.
10
26
///
11
27
/// A positive [delta] scrolls down or right, depending on the scrollbar's orientation,
12
28
/// and a negative [delta] scrolls up or left.
13
29
///
14
30
/// By default, this method expects a single [Scrollbar] in the widget tree and
15
31
/// finds it `byType` . To specify one [Scrollbar] among many, pass a [finder] .
16
- Future <void > dragScrollbar (double delta, [Finder ? finder]) async {
32
+ Future <void > _dragScrollbar (double delta, [Finder ? finder]) async {
17
33
// Find where the scrollbar's thumb sits.
18
34
final thumbRect = _findThumbRect (finder ?? find.byType (Scrollbar ));
19
35
final thumbOffset = thumbRect.center;
0 commit comments