From 614cb48dffc771513fb6f522627cd37ff31dd20b Mon Sep 17 00:00:00 2001 From: WaseemAbbasi22 <50428976+WaseemAbbasi22@users.noreply.github.com> Date: Wed, 3 Jun 2026 11:01:15 +0300 Subject: [PATCH] dashboard ui fixes --- .../widgets/progress_fragment.dart | 87 ++++++++++--------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/lib/dashboard_latest/widgets/progress_fragment.dart b/lib/dashboard_latest/widgets/progress_fragment.dart index 4d48e4c2..6b0ddd8b 100644 --- a/lib/dashboard_latest/widgets/progress_fragment.dart +++ b/lib/dashboard_latest/widgets/progress_fragment.dart @@ -278,66 +278,69 @@ class _ProgressFragmentState extends State with SingleTickerPr 8.height, Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.stretch, spacing: 60.toScreenWidth, children: [ Expanded( flex: 3, - child: SizedBox( - height: 124.toScreenWidth, - width: 124.toScreenWidth, - child: PieChart( - dataMap: {for (var v in chartData) v.x: v.y}, - animationDuration: const Duration(milliseconds: 750), - chartLegendSpacing: 0, - chartRadius: 124, - colorList: chartData.map((element) => element.color).toList(), - initialAngleInDegree: 270, - chartType: ChartType.ring, - ringStrokeWidth: 32, - legendOptions: LegendOptions( - showLegendsInRow: true, - legendPosition: LegendPosition.top, - showLegends: false, - legendTextStyle: AppTextStyles.textStyle9, - ), - chartValuesOptions: ChartValuesOptions( - showChartValueBackground: true, - chartValueBackgroundColor: const Color(0xff226187).withValues(alpha: .75), - chartValueStyle: AppTextStyles.tinyFont2.copyWith(height: 1.5, color: Colors.white), - showChartValues: true, - showChartValuesInPercentage: true, - showChartValuesOutside: true, - decimalPlaces: 0, - ), - ).toShimmer(isShow: snapshot.isAllCountLoading, radius: 250, context: context).paddingAll(0), - ), + child: Center( + child: AspectRatio( + aspectRatio: 1, + child: PieChart( + dataMap: {for (var v in chartData) v.x: v.y}, + animationDuration: const Duration(milliseconds: 750), + chartLegendSpacing: 0, + chartRadius: MediaQuery.of(context).size.width * 0.35, + colorList: chartData.map((element) => element.color).toList(), + initialAngleInDegree: 270, + chartType: ChartType.ring, + ringStrokeWidth: 32.toScreenWidth, + legendOptions: LegendOptions( + showLegendsInRow: true, + legendPosition: LegendPosition.top, + showLegends: false, + legendTextStyle: AppTextStyles.textStyle9, + ), + chartValuesOptions: ChartValuesOptions( + showChartValueBackground: true, + chartValueBackgroundColor: const Color(0xff226187).withValues(alpha: .75), + chartValueStyle: AppTextStyles.tinyFont2.copyWith(height: 1.5, color: Colors.white), + showChartValues: true, + showChartValuesInPercentage: true, + showChartValuesOutside: true, + decimalPlaces: 0, + ), + ).toShimmer(isShow: snapshot.isAllCountLoading, radius: 250, context: context), + ), + ).paddingOnly(top: 14,bottom: 14), ), Expanded( flex: 2, child: Column( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, - spacing: 8, children: [ for (int i = 0; i < chartData.length; i++) Row( - spacing: 16, + spacing: 16.toScreenWidth, children: [ chartData[i].icon.toSvgAsset(height: 26, width: 26, color: chartData[i].color).toShimmer(isShow: snapshot.isAllCountLoading, context: context), - Column( - spacing: 4, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(chartData[i].x, style: AppTextStyles.textStyle9.copyWith(color: AppColor.text9Color(context))) - .toShimmer(isShow: snapshot.isAllCountLoading, context: context), - Text("${chartData[i].y.toInt()}", style: AppTextStyles.bodyText.copyWith(color: AppColor.headingTextColor(context))) - .toShimmer(isShow: snapshot.isAllCountLoading, context: context), - ], + Expanded( + child: Column( + spacing: 4.toScreenHeight, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(chartData[i].x, style: AppTextStyles.textStyle9.copyWith(color: AppColor.text9Color(context))) + .toShimmer(isShow: snapshot.isAllCountLoading, context: context), + Text("${chartData[i].y.toInt()}", style: AppTextStyles.bodyText.copyWith(color: AppColor.headingTextColor(context))) + .toShimmer(isShow: snapshot.isAllCountLoading, context: context), + ], + ), ) ], ) ], - ), + ).paddingOnly(top: 4,bottom: 4), ), ], ).expanded,