mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-02 19:26:37 +00:00
add custom animation curve param to expandable.dart
This commit is contained in:
parent
d07906c4a7
commit
e3dbc64f17
2 changed files with 5 additions and 1 deletions
|
@ -46,6 +46,8 @@ class _ExpandingSubListItemState extends State<ExpandingSubListItem> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expandable(
|
||||
animationDurationMultiplier: 0.1 * widget.entities.length,
|
||||
curve: Curves.easeInOutCubicEmphasized,
|
||||
controller: _controller,
|
||||
onExpandChanged: (state) {
|
||||
setState(() {
|
||||
|
|
|
@ -21,6 +21,7 @@ class Expandable extends StatefulWidget {
|
|||
this.onExpandChanged,
|
||||
this.controller,
|
||||
this.expandOverride,
|
||||
this.curve = Curves.easeInOut,
|
||||
}) : super(key: key);
|
||||
|
||||
final Widget header;
|
||||
|
@ -31,6 +32,7 @@ class Expandable extends StatefulWidget {
|
|||
final void Function(ExpandableState)? onExpandChanged;
|
||||
final ExpandableController? controller;
|
||||
final VoidCallback? expandOverride;
|
||||
final Curve curve;
|
||||
|
||||
@override
|
||||
State<Expandable> createState() => _ExpandableState();
|
||||
|
@ -73,7 +75,7 @@ class _ExpandableState extends State<Expandable> with TickerProviderStateMixin {
|
|||
animation = widget.animation ??
|
||||
Tween<double>(begin: 0.0, end: 1.0).animate(
|
||||
CurvedAnimation(
|
||||
curve: Curves.easeInOut,
|
||||
curve: widget.curve,
|
||||
parent: animationController,
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue