Skip to content

Instantly share code, notes, and snippets.

@netsmertia
Last active January 10, 2019 13:09
Show Gist options
  • Save netsmertia/1dd81122a6f7001e96d7b69485834b40 to your computer and use it in GitHub Desktop.
Save netsmertia/1dd81122a6f7001e96d7b69485834b40 to your computer and use it in GitHub Desktop.
class DownloadProgressIndicator extends StatelessWidget {
DownloadProgressIndicator({
this.color =Colors.blue,
this.backgroundColor = Colors.black12,
this.content,
this.value,
this.strokeWidth = 4.0,
});
final Color color;
final Color backgroundColor;
final Widget content;
final double value;
final double strokeWidth;
@override
Widget build(BuildContext context) {
return Stack(
fit: StackFit.expand,
children: <Widget>[
Transform.rotate(
angle: pi / 180 * 227,
child: backgroundColor != null ?
CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation(backgroundColor),
value: .75,
strokeWidth: strokeWidth,
): Container(),
),
Transform.rotate(
angle: pi / 180 * 227,
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation(color),
value: value * .75,
strokeWidth: strokeWidth,
),
),
content != null ?
Center(
child: content,
) : Container(),
],
);
}
}
class MyScreen extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Test of list tile"),),
body: Center(
child: SizedBox(
width: 50,
height: 50,
child: DownloadProgressIndicator(
value: .5,
)
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment