enrollment-app/lib/branch/branch_card_widget.dart
2026-03-26 09:45:12 +05:30

68 lines
2.0 KiB
Dart
Executable File

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class BranchCard extends StatelessWidget {
final String clientName;
final String branchName;
final bool isSelected;
final VoidCallback onTap;
const BranchCard({
Key? key,
required this.clientName,
required this.branchName,
required this.isSelected,
required this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Tooltip(
message: clientName, // 🖱 hover shows full name
waitDuration: const Duration(milliseconds: 400),
child: InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(8),
child: Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color:
isSelected ? const Color(0xFF00999E) : const Color(0xFFF0F9F9),
borderRadius: BorderRadius.circular(8),
border: Border.all(
color: const Color(0xFF00999E),
width: 1.5,
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
clientName,
maxLines: 1, // ✅ SINGLE LINE
overflow: TextOverflow.ellipsis,
style: GoogleFonts.poppins(
fontSize: 13,
fontWeight: FontWeight.w500,
color: isSelected ? Colors.white : const Color(0xFF00999E),
),
),
const SizedBox(height: 4),
Text(
branchName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: GoogleFonts.poppins(
fontSize: 11,
color: isSelected ? Colors.white70 : Colors.black87,
),
),
],
),
),
),
);
}
}