Last active
January 10, 2019 13:09
-
-
Save netsmertia/1dd81122a6f7001e96d7b69485834b40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(), | |
], | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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