Skip to content

Instantly share code, notes, and snippets.

@rrifafauzikomara
Created December 14, 2019 16:15
Show Gist options
  • Save rrifafauzikomara/cbafba832e5ce9d6c0f3f73c2b5f2e4e to your computer and use it in GitHub Desktop.
Save rrifafauzikomara/cbafba832e5ce9d6c0f3f73c2b5f2e4e to your computer and use it in GitHub Desktop.
// circle vote average
Container(
width: 40,
height: 40,
child: Stack(
children: <Widget>[
Center(
child: Container(
width: 40,
height: 40,
decoration: BoxDecoration(
color: Colors.blueGrey,
borderRadius: BorderRadius.circular(
20)),
),
),
Center(
child: Container(
width: 30,
height: 30,
child: CircularProgressIndicator(
strokeWidth: 3.0,
valueColor: AlwaysStoppedAnimation<Color>(
VoteColorHelper.getColor(
double.parse(vote))),
backgroundColor: Colors.grey,
value: double.parse(vote) / 10.0,
)),
),
Center(
child: Container(
width: 30,
height: 30,
child: Center(
child: Text(
(double.parse(vote) * 10.0)
.floor()
.toString() +
'%',
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 11,
color: Colors.white),
),
)),
)
],
),
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment