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)