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
Jaime Blasco
2020-07-05 14:46:38 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bdb493f86481f0663a43c17162e5c06082d90250
bdb493f8
1 parent
d09d339d
Add nested scroll example
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
1 deletions
example/lib/main.dart
example/lib/modals/modal_with_nested_scroll.dart
example/lib/main.dart
View file @
bdb493f
...
...
@@ -11,6 +11,7 @@ import 'modals/modal_fit.dart';
import
'modals/modal_inside_modal.dart'
;
import
'modals/modal_will_scope.dart'
;
import
'modals/modal_with_navigator.dart'
;
import
'modals/modal_with_nested_scroll.dart'
;
import
'modals/modal_with_scroll.dart'
;
import
'examples/cupertino_share.dart'
;
...
...
@@ -219,7 +220,7 @@ class _MyHomePageState extends State<MyHomePage> {
scrollController:
scrollController
),
)),
ListTile
(
title:
Text
(
'
Cupertino
Modal with WillPopScope'
),
title:
Text
(
'Modal with WillPopScope'
),
onTap:
()
=>
showCupertinoModalBottomSheet
(
expand:
true
,
context:
context
,
...
...
@@ -228,6 +229,15 @@ class _MyHomePageState extends State<MyHomePage> {
ModalWillScope
(
scrollController:
scrollController
),
)),
ListTile
(
title:
Text
(
'Modal with Nested Scroll'
),
onTap:
()
=>
showCupertinoModalBottomSheet
(
expand:
true
,
context:
context
,
builder:
(
context
,
scrollController
)
=>
NestedScrollModal
(
scrollController:
scrollController
),
)),
],
),
),
...
...
example/lib/modals/modal_with_nested_scroll.dart
0 → 100644
View file @
bdb493f
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
class
NestedScrollModal
extends
StatelessWidget
{
final
ScrollController
scrollController
;
const
NestedScrollModal
({
Key
key
,
this
.
scrollController
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
return
NestedScrollView
(
physics:
ScrollPhysics
(
parent:
PageScrollPhysics
()),
headerSliverBuilder:
(
BuildContext
context
,
bool
innerBoxIsScrolled
)
{
return
<
Widget
>[
SliverList
(
delegate:
SliverChildListDelegate
(
[
Container
(
height:
300
,
color:
Colors
.
blue
),
],
),
),
];
},
body:
ListView
.
builder
(
controller:
scrollController
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
height:
100
,
color:
index
.
isOdd
?
Colors
.
green
:
Colors
.
orange
,
);
},
itemCount:
12
,
));
}
}
...
...
Please
register
or
login
to post a comment