import 'package:wanisdriver/utils/colors.dart'; import 'package:wanisdriver/widgets/custom_text.dart'; import 'package:flutter/material.dart'; class TabItem extends StatelessWidget { final String title; final bool isSelected; final VoidCallback onTap; const TabItem({ required this.title, required this.isSelected, required this.onTap, }); @override Widget build(BuildContext context) { return GestureDetector( onTap: onTap, child: Container( padding: const EdgeInsets.symmetric(vertical: 10.0,horizontal: 12), decoration: BoxDecoration( color: isSelected ? Theme.of(context).brightness == Brightness.dark? AppColors.darkPrimaryColor: AppColors.white : Theme.of(context).brightness == Brightness.dark? AppColors.darkCardColor:Colors.grey[200], // Background for selected/unselected tabs borderRadius: BorderRadius.circular(10.0), // Rounded corners for tabs darkCardColor boxShadow: isSelected ? [ BoxShadow( color: Colors.grey.withOpacity(0.1), spreadRadius: 1, blurRadius: 5, offset: const Offset(0, 2), // Elevation for selected tab ) ] : null, ), child: Padding( padding: const EdgeInsets.symmetric(vertical: 4.0,horizontal: 42), child: Txt( text: title, style: TextStyle( fontSize: 16, // Match design fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, color: isSelected ? AppColors.primaryNewColor :Theme.of(context).brightness == Brightness.dark? AppColors.whiteBackgroundColor:AppColors.blackBackgroundColor, ), ), ), ), ); } }