import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:onufitness/constants/text_constant.dart'; import 'package:onufitness/controller/notification_controller.dart'; import 'package:onufitness/routes/route_constant.dart'; import 'package:onufitness/utils/helper_function.dart'; class HeaderSection extends StatelessWidget { HeaderSection({super.key}); final notificationController = Get.find(); @override Widget build(BuildContext context) { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ Text( 'Welcome', style: TextStyle( fontSize: veryLargeSizeText, fontWeight: FontWeight.w600, color: Colors.black87, ), ), ], ), Container( padding: EdgeInsets.all(3.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12.r), boxShadow: [ BoxShadow( color: Colors.black.withValues(alpha: 0.05), blurRadius: 10, offset: Offset(0, 2), ), ], ), child: Stack( children: [ IconButton( icon: Icon( Icons.notifications_none, color: Colors.black, size: 24.sp, ), onPressed: () { notificationController.fetchNotifications(isRefresh: true); Get.toNamed(RouteConstant.notificationListScreen); }, ), notificationController.hasUnreadNotifications ? Positioned( right: isTablet ? 5.w : 12.w, top: isTablet ? 6.h : 12.h, child: Container( width: 8.r, height: 8.r, decoration: BoxDecoration( color: Colors.red, shape: BoxShape.circle, ), ), ) : SizedBox(), ], ), ), ], ); } }