Last active
August 24, 2018 13:39
-
-
Save letsar/b326a6e82c55eef09ca2a4bdf4bc5987 to your computer and use it in GitHub Desktop.
slidable_in_depth_01
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class SlidableStackDelegate extends SlidableDelegate { | |
const SlidableStackDelegate({ | |
double fastThreshold, | |
}) : super(fastThreshold: fastThreshold); | |
@override | |
Widget buildActions(BuildContext context, SlidableDelegateContext ctx) { | |
final animation = new Tween( | |
begin: Offset.zero, | |
end: ctx.createOffset(ctx.state.totalActionsExtent * ctx.state.dragSign), | |
).animate(ctx.state.actionsMoveAnimation); | |
if (ctx.state.actionsMoveAnimation.value != .0) { | |
return new Container( | |
child: new Stack( | |
children: <Widget>[ | |
buildStackActions( | |
context, | |
ctx, | |
), | |
new SlideTransition( | |
position: animation, | |
child: ctx.state.widget.child, | |
), | |
], | |
), | |
); | |
} else { | |
return ctx.state.widget.child; | |
} | |
} | |
Widget buildStackActions(BuildContext context, SlidableDelegateContext ctx); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment