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-05-07 12:52:24 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
06296fbafd754f3bc1336665789901d6218bc091
06296fba
1 parent
6fdc6de6
Allow to use custom curves for animating the dialog
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
example/lib/main.dart
lib/src/bottom_sheet.dart
example/lib/main.dart
View file @
06296fb
...
...
@@ -179,6 +179,7 @@ class _MyHomePageState extends State<MyHomePage> {
expand:
true
,
context:
context
,
backgroundColor:
Colors
.
transparent
,
animationCurve:
Curves
.
easeInExpo
,
builder:
(
context
,
scrollController
)
=>
ModalInsideModal
(
scrollController:
scrollController
),
...
...
lib/src/bottom_sheet.dart
View file @
06296fb
...
...
@@ -282,7 +282,7 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
Widget
build
(
BuildContext
context
)
{
final
bounceAnimation
=
CurvedAnimation
(
parent:
_bounceDragController
,
curve:
widget
.
animationCurve
??
Curves
.
easeOutSine
,
curve:
Curves
.
easeOutSine
,
);
var
child
=
widget
.
builder
(
context
,
_scrollController
);
...
...
@@ -296,17 +296,17 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
}
// Todo: Add curved Animation when push and pop without gesture
/* final Animation<double> containerAnimation = CurvedAnimation(
parent: widget.animationController,
curve: Curves.easeOut,
);*/
final
Animation
<
double
>
containerAnimation
=
CurvedAnimation
(
parent:
widget
.
animationController
,
curve:
widget
.
animationCurve
??
Curves
.
linear
,
);
return
AnimatedBuilder
(
animation:
widget
.
animationController
,
builder:
(
context
,
_
)
=>
ClipRect
(
child:
CustomSingleChildLayout
(
delegate:
_ModalBottomSheetLayout
(
widget
.
animationController
.
value
,
widget
.
expanded
),
containerAnimation
.
value
,
widget
.
expanded
),
child:
!
widget
.
enableDrag
?
child
:
KeyedSubtree
(
...
...
Please
register
or
login
to post a comment