Instantly share code, notes, and snippets.

@artrmz artrmz/water_drop.dart
Last active Sep 20, 2018

Embed
What would you like to do?
Stack(
alignment: Alignment.center,
children: <Widget>[
Center(child: Image.asset('assets/images/drop.png')),
Center(
child: AnimatedBuilder(
animation: CurvedAnimation(
parent: animationController,
curve: Curves.easeInOut),
builder: (context, child) => ClipPath(
child: Image.asset('assets/images/drop-blue.png'),
clipper: WaveClipper(target > 0 ? current / target * 100 : 100.0,
animationController.value),
),
),
),
Center(
child: Column(
children: <Widget>[
ShadowText(
'${(target > 0 ? current / target * 100 : 100).toStringAsFixed(0)}%',
shadowColor: Colors.black.withOpacity(0.15),
offsetX: 3.0,
offsetY: 3.0,
blur: 3.0,
style: TextStyle(
color: const Color(0x7F4C9BFB),
fontSize: 40.0,
fontWeight: FontWeight.bold),
),
ShadowText(
'$current ml',
shadowColor: Colors.black.withOpacity(0.15),
offsetX: 3.0,
offsetY: 3.0,
blur: 3.0,
style: TextStyle(
color: const Color(0x4B4C9BFB),
fontSize: 18.0,
fontWeight: FontWeight.bold),
)
],
),
),
],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment