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
d77bc518
Unverified
Commit
d77bc518
authored
Nov 11, 2021
by
Michael Goderbauer
Committed by
GitHub
Nov 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use navigator instead of overlay as TickerProvider for ModalBottomSheet (#93499)
parent
eabb7cbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
bottom_sheet.dart
packages/flutter/lib/src/material/bottom_sheet.dart
+1
-1
bottom_sheet_test.dart
packages/flutter/test/material/bottom_sheet_test.dart
+37
-0
No files found.
packages/flutter/lib/src/material/bottom_sheet.dart
View file @
d77bc518
...
@@ -508,7 +508,7 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> {
...
@@ -508,7 +508,7 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> {
_animationController
=
transitionAnimationController
;
_animationController
=
transitionAnimationController
;
willDisposeAnimationController
=
false
;
willDisposeAnimationController
=
false
;
}
else
{
}
else
{
_animationController
=
BottomSheet
.
createAnimationController
(
navigator
!
.
overlay
!
);
_animationController
=
BottomSheet
.
createAnimationController
(
navigator
!);
}
}
return
_animationController
!;
return
_animationController
!;
}
}
...
...
packages/flutter/test/material/bottom_sheet_test.dart
View file @
d77bc518
...
@@ -51,6 +51,43 @@ void main() {
...
@@ -51,6 +51,43 @@ void main() {
FlutterError
.
onError
=
handler
;
FlutterError
.
onError
=
handler
;
});
});
testWidgets
(
'Disposing app while bottom sheet is disappearing does not crash'
,
(
WidgetTester
tester
)
async
{
late
BuildContext
savedContext
;
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Builder
(
builder:
(
BuildContext
context
)
{
savedContext
=
context
;
return
Container
();
},
),
),
);
await
tester
.
pump
();
expect
(
find
.
text
(
'BottomSheet'
),
findsNothing
);
// Bring up bottom sheet.
bool
showBottomSheetThenCalled
=
false
;
showModalBottomSheet
<
void
>(
context:
savedContext
,
builder:
(
BuildContext
context
)
=>
const
Text
(
'BottomSheet'
),
).
then
<
void
>((
void
value
)
{
showBottomSheetThenCalled
=
true
;
});
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'BottomSheet'
),
findsOneWidget
);
expect
(
showBottomSheetThenCalled
,
isFalse
);
// Start closing animation of Bottom sheet.
tester
.
state
<
NavigatorState
>(
find
.
byType
(
Navigator
)).
pop
();
await
tester
.
pump
();
// Dispose app by replacing it with a container. This shouldn't crash.
await
tester
.
pumpWidget
(
Container
());
});
testWidgets
(
'Tapping on a modal BottomSheet should not dismiss it'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Tapping on a modal BottomSheet should not dismiss it'
,
(
WidgetTester
tester
)
async
{
late
BuildContext
savedContext
;
late
BuildContext
savedContext
;
...
...
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