From 67d78f02b728a43fe6c87986db6694ee04cdb3fb Mon Sep 17 00:00:00 2001 From: Vaibhav Surve Date: Mon, 23 Jun 2025 15:49:06 +0530 Subject: [PATCH] feat: Add no data message to attendance dashboard chart --- lib/view/dashboard/dashboard_chart.dart | 28 ++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/view/dashboard/dashboard_chart.dart b/lib/view/dashboard/dashboard_chart.dart index 83150cc..5741fd5 100644 --- a/lib/view/dashboard/dashboard_chart.dart +++ b/lib/view/dashboard/dashboard_chart.dart @@ -92,9 +92,11 @@ class AttendanceDashboardChart extends StatelessWidget { duration: const Duration(milliseconds: 300), child: isLoading ? SkeletonLoaders.buildLoadingSkeleton() - : isChartView - ? _buildChart() - : _buildTable(), + : filteredData.isEmpty + ? _buildNoDataMessage() + : isChartView + ? _buildChart() + : _buildTable(), ), ], ), @@ -236,6 +238,26 @@ class AttendanceDashboardChart extends StatelessWidget { ); } + Widget _buildNoDataMessage() { + return SizedBox( + height: 200, + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.info_outline, color: Colors.grey.shade500, size: 48), + const SizedBox(height: 12), + MyText.bodyMedium( + 'No attendance data available for the selected range or project.', + textAlign: TextAlign.center, + color: Colors.grey.shade600, + ), + ], + ), + ), + ); + } + Widget _buildTable() { final formattedDateMap = { for (var e in filteredData)