Created
March 29, 2022 17:48
-
-
Save apgapg/feeb455c681f1dc33dd3ac108f7a8c1d to your computer and use it in GitHub Desktop.
Pie Chart with base color support
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 HomePage2 extends StatelessWidget { | |
HomePage2({Key? key}) : super(key: key); | |
final dataMap = <String, double>{ | |
"Flutter": 5, | |
}; | |
final colorList = <Color>[ | |
Colors.greenAccent, | |
]; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Pie Chart 1"), | |
), | |
body: Container( | |
padding: EdgeInsets.symmetric(horizontal: 16), | |
child: PieChart( | |
dataMap: dataMap, | |
chartType: ChartType.ring, | |
baseChartColor: Colors.grey[300]!, | |
colorList: colorList, | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment