Skip to content

Instantly share code, notes, and snippets.

@epsi95
Created December 31, 2020 11:13
Show Gist options
  • Save epsi95/c3b440b776b72844050176ace277b571 to your computer and use it in GitHub Desktop.
Save epsi95/c3b440b776b72844050176ace277b571 to your computer and use it in GitHub Desktop.
CustomAnimation(
tween: Tween(begin: 0.0, end: (_screenWidth * 0.8) / 2),
duration: widget.animationDuration,
curve: Curves.easeOut,
control: _control,
builder: (context, child, value) {
return Padding(
padding: EdgeInsets.only(left: value),
child: Container(
width: value <= ((_screenWidth * 0.8) / 2) / 2
? (value + ((_screenWidth * 0.8) / 2))
: (_screenWidth * 0.8) - value,
height: 50.0,
margin: EdgeInsets.all(5.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100.0),
color: Colors.white.withOpacity(0.4),
),
),
);
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment