Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
modal_bottom_sheet
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Alex Li
2022-08-28 18:28:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0f8f795c8f465d479b520e0e3f1b1275bf76d46b
0f8f795c
1 parent
200a9c38
✅ ++
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
test/bottom_sheet_test.dart
test/bottom_sheet_test.dart
View file @
0f8f795
...
...
@@ -7,13 +7,17 @@ void main() {
group
(
'Route.mainState are well-controlled by `mainState`'
,
()
{
testWidgets
(
'with showCupertinoModalBottomSheet'
,
(
tester
)
async
{
Future
<
void
>
testInitStateAndDispose
(
WidgetTester
tester
,
Future
<
void
>
Function
(
BuildContext
context
,
WidgetBuilder
builder
)
onPressed
,
)
async
{
int
_initState
=
0
,
_dispose
=
0
;
await
_pumpWidget
(
tester:
tester
,
onPressed:
(
context
)
=>
showCupertinoModalBottomSheet
(
context:
context
,
builder:
(
_
)
=>
_TestWidget
(
onPressed:
(
context
)
=>
onPressed
(
context
,
(
_
)
=>
_TestWidget
(
onInitState:
()
=>
_initState
++,
onDispose:
()
=>
_dispose
++,
),
...
...
@@ -36,6 +40,25 @@ void main() {
await
tester
.
pumpAndSettle
();
expect
(
_initState
,
1
);
expect
(
_dispose
,
1
);
}
testWidgets
(
'with showCupertinoModalBottomSheet'
,
(
tester
)
{
return
testInitStateAndDispose
(
tester
,
(
context
,
builder
)
=>
showCupertinoModalBottomSheet
(
context:
context
,
builder:
builder
,
),
);
});
testWidgets
(
'with showMaterialModalBottomSheet'
,
(
tester
)
{
return
testInitStateAndDispose
(
tester
,
(
context
,
builder
)
=>
showMaterialModalBottomSheet
(
context:
context
,
builder:
builder
,
),
);
});
},
);
...
...
Please
register
or
login
to post a comment