Skip to content

Instantly share code, notes, and snippets.

@letsar
Created September 1, 2018 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save letsar/fe4f3d4b67fb1c3932d9de86a3a2b28b to your computer and use it in GitHub Desktop.
Save letsar/fe4f3d4b67fb1c3932d9de86a3a2b28b to your computer and use it in GitHub Desktop.
SlidableDrawerDelegateAnimation({
Key key,
this.controller,
}) : dxPositions = <Animation<Offset>>[
Tween<Offset>(
begin: Offset(-1.0, 0.0),
end: Offset(1.0, 0.0),
).animate(
CurvedAnimation(
parent: controller,
curve: _kAnimInterval03,
),
),
Tween<Offset>(
begin: Offset(-1.0, 0.0),
end: Offset(0.0, 0.0),
).animate(
CurvedAnimation(
parent: controller,
curve: _kAnimInterval03,
),
),
Tween<Offset>(
begin: Offset(0.0, 0.0),
end: Offset(0.5, 0.0),
).animate(
CurvedAnimation(
parent: controller,
curve: _kAnimInterval03,
),
),
],
dyPositions1 = List.generate(
_kCount,
(i) => Tween<Offset>(
begin: Offset.zero,
end: Offset(0.0, -i.toDouble() / 2),
).animate(
CurvedAnimation(
parent: controller,
curve: _kAnimInterval01,
),
),
),
dyPositions2 = List.generate(
_kCount,
(i) => Tween<Offset>(
begin: Offset.zero,
end: Offset(0.0, i.toDouble() / 2),
).animate(
CurvedAnimation(
parent: controller,
curve: _kAnimInterval04,
),
),
),
skewTransform1 = Tween<double>(begin: 0.0, end: 0.5).animate(
CurvedAnimation(
parent: controller,
curve: _kAnimInterval02,
),
),
skewTransform2 = Tween<double>(begin: 0.0, end: -0.5).animate(
CurvedAnimation(
parent: controller,
curve: _kAnimInterval05,
),
),
super(key: key);
final Animation<double> controller;
final List<Animation<Offset>> dyPositions1;
final List<Animation<Offset>> dyPositions2;
final List<Animation<Offset>> dxPositions;
final Animation<double> skewTransform1;
final Animation<double> skewTransform2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment