|
|
|
@ -151,10 +151,9 @@
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:pie_chart/pie_chart.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:syncfusion_flutter_charts/charts.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/dashboard_latest/dashboard_provider.dart';
|
|
|
|
import 'package:test_sa/dashboard_latest/dashboard_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/api/all_requests_provider.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
@ -212,46 +211,44 @@ class ProgressFragment extends StatelessWidget {
|
|
|
|
child: Stack(
|
|
|
|
child: Stack(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SfCircularChart(
|
|
|
|
PieChart(
|
|
|
|
tooltipBehavior: TooltipBehavior(
|
|
|
|
dataMap: {for (var v in chartData) v.x: v.y},
|
|
|
|
enable: true,
|
|
|
|
animationDuration: const Duration(milliseconds: 800),
|
|
|
|
// elevation: 2,
|
|
|
|
chartLegendSpacing: 32,
|
|
|
|
color: context.isDark ? const Color(0xFF111427) : const Color(0xffF7F9FB),
|
|
|
|
chartRadius: MediaQuery.of(context).size.width / 3.2,
|
|
|
|
textStyle: context.isDark ? null : const TextStyle(color: Colors.black87, fontSize: 12),
|
|
|
|
colorList: chartData.map((element) => element.color).toList(),
|
|
|
|
|
|
|
|
initialAngleInDegree: 270,
|
|
|
|
|
|
|
|
chartType: ChartType.ring,
|
|
|
|
|
|
|
|
ringStrokeWidth: 32,
|
|
|
|
|
|
|
|
centerWidget: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
context.translation.total,
|
|
|
|
|
|
|
|
style: AppTextStyles.heading5.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
"$total",
|
|
|
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
legendOptions: const LegendOptions(
|
|
|
|
|
|
|
|
showLegendsInRow: false,
|
|
|
|
|
|
|
|
legendPosition: LegendPosition.right,
|
|
|
|
|
|
|
|
showLegends: true,
|
|
|
|
|
|
|
|
legendTextStyle: TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
legend: const Legend(
|
|
|
|
),
|
|
|
|
//isVisible: true,
|
|
|
|
chartValuesOptions: const ChartValuesOptions(
|
|
|
|
),
|
|
|
|
showChartValueBackground: false,
|
|
|
|
series: <CircularSeries>[
|
|
|
|
showChartValues: false,
|
|
|
|
DoughnutSeries<ChartData, String>(
|
|
|
|
showChartValuesInPercentage: false,
|
|
|
|
dataSource: chartData,
|
|
|
|
showChartValuesOutside: false,
|
|
|
|
radius: "100%",
|
|
|
|
decimalPlaces: 1,
|
|
|
|
innerRadius: "60%",
|
|
|
|
),
|
|
|
|
pointColorMapper: (ChartData data, _) => data.color,
|
|
|
|
).toShimmer(isShow: snapshot.isAllCountLoading, radius: 250).paddingAll(0).toShadowContainer(context),
|
|
|
|
xValueMapper: (ChartData data, _) => data.x,
|
|
|
|
|
|
|
|
yValueMapper: (ChartData data, _) => data.y,
|
|
|
|
|
|
|
|
dataLabelMapper: (ChartData data, _) => data.x,
|
|
|
|
|
|
|
|
dataLabelSettings: DataLabelSettings(
|
|
|
|
|
|
|
|
margin: const EdgeInsets.all(8),
|
|
|
|
|
|
|
|
isVisible: true,
|
|
|
|
|
|
|
|
textStyle: TextStyle(color: context.isDark ? Colors.white : AppColor.neutral20, fontSize: 12, fontWeight: FontWeight.w500),
|
|
|
|
|
|
|
|
labelPosition: ChartDataLabelPosition.outside,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
]).toShimmer(isShow: snapshot.isAllCountLoading, radius: 250).paddingAll(0).toShadowContainer(context),
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
context.translation.total,
|
|
|
|
|
|
|
|
style: AppTextStyles.heading5.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
"$total",
|
|
|
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|