Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
d50ec246
Unverified
Commit
d50ec246
authored
Sep 20, 2021
by
Kate Lovett
Committed by
GitHub
Sep 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix overflow in stretching overscroll (#90215)
parent
8d5d37d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
4 deletions
+60
-4
overscroll_indicator.dart
packages/flutter/lib/src/widgets/overscroll_indicator.dart
+6
-4
overscroll_stretch_indicator_test.dart
...utter/test/widgets/overscroll_stretch_indicator_test.dart
+54
-0
No files found.
packages/flutter/lib/src/widgets/overscroll_indicator.dart
View file @
d50ec246
...
...
@@ -760,10 +760,12 @@ class _StretchingOverscrollIndicatorState extends State<StretchingOverscrollIndi
_lastOverscrollNotification
?.
overscroll
??
0.0
);
return
Transform
(
alignment:
alignment
,
transform:
Matrix4
.
diagonal3Values
(
x
,
y
,
1.0
),
child:
widget
.
child
,
return
ClipRect
(
child:
Transform
(
alignment:
alignment
,
transform:
Matrix4
.
diagonal3Values
(
x
,
y
,
1.0
),
child:
widget
.
child
,
),
);
},
),
...
...
packages/flutter/test/widgets/overscroll_stretch_indicator_test.dart
View file @
d50ec246
...
...
@@ -308,4 +308,58 @@ void main() {
await
gesture
.
up
();
await
tester
.
pumpAndSettle
();
});
testWidgets
(
'Stretch does not overflow bounds of container'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/90197
await
tester
.
pumpWidget
(
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
ScrollConfiguration
(
behavior:
const
ScrollBehavior
().
copyWith
(
overscroll:
false
),
child:
Column
(
children:
<
Widget
>[
StretchingOverscrollIndicator
(
axisDirection:
AxisDirection
.
down
,
child:
SizedBox
(
height:
300
,
child:
ListView
.
builder
(
itemCount:
20
,
itemBuilder:
(
BuildContext
context
,
int
index
){
return
Padding
(
padding:
const
EdgeInsets
.
all
(
10.0
),
child:
Text
(
'Index
$index
'
),
);
},
),
),
),
Opacity
(
opacity:
0.5
,
child:
Container
(
color:
const
Color
(
0xD0FF0000
),
height:
100
,
),
)
],
)
)
));
expect
(
find
.
text
(
'Index 1'
),
findsOneWidget
);
expect
(
tester
.
getCenter
(
find
.
text
(
'Index 1'
)).
dy
,
51.0
);
final
TestGesture
gesture
=
await
tester
.
startGesture
(
tester
.
getCenter
(
find
.
text
(
'Index 1'
)));
// Overscroll the start.
await
gesture
.
moveBy
(
const
Offset
(
0.0
,
200.0
));
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'Index 1'
),
findsOneWidget
);
expect
(
tester
.
getCenter
(
find
.
text
(
'Index 1'
)).
dy
,
greaterThan
(
0
));
// Image should not show the text overlapping the red area below the list.
await
expectLater
(
find
.
byType
(
Column
),
matchesGoldenFile
(
'overscroll_stretch.no_overflow.png'
),
);
await
gesture
.
up
();
await
tester
.
pumpAndSettle
();
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment