mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-22 14:59:12 +00:00
33 lines
No EOL
830 B
Dart
33 lines
No EOL
830 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:pie_chart/pie_chart.dart';
|
|
|
|
class CustomPieChart extends StatelessWidget {
|
|
final Map<String, double> data;
|
|
final List<Color> colors;
|
|
final Duration? animationDuration;
|
|
|
|
const CustomPieChart({
|
|
super.key,
|
|
required this.data,
|
|
required this.colors,
|
|
this.animationDuration = const Duration(milliseconds: 800),
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return PieChart(
|
|
dataMap: data,
|
|
animationDuration: animationDuration,
|
|
colorList: colors,
|
|
initialAngleInDegree: 270,
|
|
chartType: ChartType.ring,
|
|
ringStrokeWidth: 12,
|
|
legendOptions: const LegendOptions(
|
|
showLegends: false
|
|
),
|
|
chartValuesOptions: const ChartValuesOptions(
|
|
showChartValues: false,
|
|
),
|
|
);
|
|
}
|
|
} |