ui_changes

This commit is contained in:
venbaittech 2025-11-20 10:55:58 +05:30
parent eb721cd164
commit 9930a6b77b
18 changed files with 558 additions and 378 deletions

File diff suppressed because one or more lines are too long

View File

@ -585,6 +585,7 @@ class ApiService {
}
Future<Map<String, dynamic>> fetchEnquiryList(
int managerid,
int id,
String role, {
String? fromDate,
@ -614,9 +615,17 @@ class ApiService {
// final url = Uri.parse(
// '${Env.apiUrl}enquiry/enquiryList?$query&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}',
// );
final url = Uri.parse(
'${Env.apiUrl}enquiry/enquiryList?$query&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}&status=$selectedStatus&staff_id=$selectedStaffId',
);
final url;
if (role == 'staff') {
url = Uri.parse(
'${Env.apiUrl}enquiry/enquiryList?$query&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}&status=$selectedStatus',
);
} else {
url = Uri.parse(
'${Env.apiUrl}enquiry/enquiryList?$query&from_date=${fromDate ?? ''}&to_date=${toDate ?? ''}&status=$selectedStatus&staff_id=$selectedStaffId',
);
}
final headers = {
'Authorization': 'Bearer $_token' ?? '',

View File

@ -168,7 +168,8 @@ class _AppHeaderState extends ConsumerState<AppHeader> {
final roleId = ref.watch(userRoleProvider);
return AppBar(
backgroundColor: const Color(0xFFD6F6F4),
// backgroundColor: const Color(0xFFD6F6F4),
backgroundColor: const Color(0xFFE3F9F8),
elevation: 0,
automaticallyImplyLeading: false,
titleSpacing: 24,
@ -185,17 +186,19 @@ class _AppHeaderState extends ConsumerState<AppHeader> {
Spacer(),
// Dashboard
_buildMenuItem(
icon: Icons.dashboard,
label: "Dashboard",
onTap: () async {
_hidePopup();
await _clearDashboardFilters();
context.go(AppRoutes.dashboard);
},
),
if (roleId != 'staff') ...[
_buildMenuItem(
icon: Icons.dashboard,
label: "Dashboard",
onTap: () async {
_hidePopup();
await _clearDashboardFilters();
context.go(AppRoutes.dashboard);
},
),
const SizedBox(width: 15),
const SizedBox(width: 15),
],
// Enquiry
_buildMenuItem(

View File

@ -148,8 +148,9 @@ class MainLayoutState extends ConsumerState<MainLayout> {
Expanded(
child: Container(
padding: const EdgeInsets.all(16.0),
color: Color(0xFFFCFDFD),
// color: Color(0xFFFCFDFD),
// color: Color(0xffF8FAFB),
color: Color(0xfff8fafc),
// color: Colors.white,
child: Column(children: [Expanded(child: widget.body)]),
),

View File

@ -214,6 +214,7 @@ class EnquiryListState extends ConsumerState<EnquiryList> {
try {
final response = await apiService.fetchEnquiryList(
managerId,
userId,
role,
fromDate: fromDt,
toDate: toDt,

View File

@ -368,7 +368,7 @@ class StaffState extends ConsumerState<Staff> {
Text(
"Staff",
style: TextStyle(
fontSize: 18,
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
@ -385,7 +385,8 @@ class StaffState extends ConsumerState<Staff> {
padding: EdgeInsets.symmetric(horizontal: 14.0, vertical: 20.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.0),
color: Color(0xFFEDF6F5),
color: Colors.white,
// color: Color(0xFFEDF6F5),
),
child: Column(
children: [

View File

@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:nhance_partner/presentation/providers/userRoleProvider.dart';
import '../../../../core/routing/routes.dart';
@ -193,67 +194,64 @@ class StaffListState extends ConsumerState<StaffList> {
return MainLayout(
title: "Staff",
body: Container(
// padding: EdgeInsets.all(8.0),
// margin: EdgeInsets.all(10.0),
// color: Colors.yellow.shade50,
width: MediaQuery.of(context).size.width,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
// height: 30,
// color: Colors.red.shade50,
width: MediaQuery.of(context).size.width,
child: GestureDetector(
onTap: () {
context.go(AppRoutes.dashboard);
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
// Icon(
// Icons.arrow_left_sharp,
// size: 35,
// color: Color(0xFF425B5B),
// ),
Tooltip(
message: 'Back',
child: IconButton(
icon: const Icon(
Icons.arrow_left_sharp,
size: 25,
color: Color(0xFF425B5B),
),
onPressed: () {
context.go(AppRoutes.dashboard);
},
splashRadius: 18,
hoverColor: Colors.black12,
padding: const EdgeInsets.all(4),
constraints: const BoxConstraints(),
),
),
const SizedBox(width: 5), // spacing between icon and text
Text(
"Staff",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
],
),
),
),
SizedBox(height: 10),
// Container(
// // height: 30,
// // color: Colors.red.shade50,
// width: MediaQuery.of(context).size.width,
// child: GestureDetector(
// onTap: () {
// context.go(AppRoutes.dashboard);
// },
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// // Icon(
// // Icons.arrow_left_sharp,
// // size: 35,
// // color: Color(0xFF425B5B),
// // ),
// // Tooltip(
// // message: 'Back',
// // child: IconButton(
// // icon: const Icon(
// // Icons.arrow_left_sharp,
// // size: 25,
// // color: Color(0xFF425B5B),
// // ),
// // onPressed: () {
// // context.go(AppRoutes.dashboard);
// // },
// // splashRadius: 18,
// // hoverColor: Colors.black12,
// // padding: const EdgeInsets.all(4),
// // constraints: const BoxConstraints(),
// // ),
// // ),
// // const SizedBox(width: 15), // spacing between icon and text
//
// ],
// ),
// ),
// ),
//
// SizedBox(height: 5),
Expanded(
child: Container(
// color: Colors.green,
// color: Colors.green.shade50,
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(8.0),
// padding: EdgeInsets.all(8.0),
child: Column(
children: [
Container(
@ -263,15 +261,25 @@ class StaffListState extends ConsumerState<StaffList> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"Staff",
style: GoogleFonts.inter(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
Spacer(),
ThemedSearchField(
hintText: 'Search',
backgroundColor: Color(0xFFF6F8F8),
// backgroundColor: Color(0xFFF6F8F8),
backgroundColor: Color(0xFFFFFFFF),
txtHeight: 30,
onChanged: filterData,
controller: _searchStaffController,
txtwidth: MediaQuery.of(context).size.width * 0.2,
),
Spacer(),
SizedBox(width: 5),
ExportBtn(
sheetName: "Staff",
@ -304,24 +312,31 @@ class StaffListState extends ConsumerState<StaffList> {
context.go('/staff/create');
},
child: Container(
padding: EdgeInsets.all(8.0),
padding: EdgeInsets.all(6.5),
decoration: BoxDecoration(
color: Color(0xFF425B5B),
color: const Color(0xFF2E7D6E),
borderRadius: BorderRadius.circular(8.0),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Create New Staff',
style: TextStyle(
// Text(
// 'Create New Staff',
// style: GoogleFonts.inter(
// color: Colors.white,
// fontWeight: FontWeight.w500,
// fontSize: 11,
// ),
// ),
// SizedBox(width: 10),
Tooltip(
message: 'Create Staff',
child: Icon(
Icons.add,
color: Colors.white,
fontWeight: FontWeight.w600,
fontSize: 14,
size: 18,
),
),
SizedBox(width: 10),
Icon(Icons.add, color: Colors.white),
],
),
),
@ -332,14 +347,16 @@ class StaffListState extends ConsumerState<StaffList> {
SizedBox(height: 10),
Container(
decoration: BoxDecoration(
color: Color(0xFFEDF6F5),
color: Color(0xFFF1F5F9),
// color: Color(0xFFEDF6F5),
borderRadius: BorderRadius.circular(6),
),
padding: const EdgeInsets.symmetric(
vertical: 12,
vertical: 10,
horizontal: 16,
),
child: const Row(
child: Row(
children: [
Expanded(
flex: 1,
@ -440,7 +457,7 @@ class StaffListState extends ConsumerState<StaffList> {
Widget _buildDataRow(Map<String, dynamic> item, sno) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 16),
padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 16),
// margin: const EdgeInsets.only(top: 10),
decoration: BoxDecoration(
color: Colors.white,
@ -472,7 +489,7 @@ class StaffListState extends ConsumerState<StaffList> {
Container(
// color: Colors.yellow.shade50,
child: Transform.scale(
scale: 0.6, // reduce size (0.70.9 works well)
scale: 0.4, // reduce size (0.70.9 works well)
child: Switch(
value: item['is_active'] == "1",
onChanged: (val) {
@ -486,8 +503,10 @@ class StaffListState extends ConsumerState<StaffList> {
);
print("Response - $response");
},
activeColor: Color(0xFF425B5B), // thumb when active
activeTrackColor: Color(0xFFB2D8D3), // track when active
activeColor: Color(0xFF2E7D6E), // thumb when active
// activeColor: Color(0xFF425B5B), // thumb when active
activeTrackColor: Color(0xFFDCFCE7), // track when active
// activeTrackColor: Color(0xFFB2D8D3), // track when active
inactiveThumbColor:
Colors.grey.shade400, // thumb when inactive
inactiveTrackColor:
@ -522,7 +541,7 @@ class StaffListState extends ConsumerState<StaffList> {
child: IconButton(
icon: Image.asset(
"assets/miscellaneous/Edit.png",
height: 15,
height: 12,
width: 15,
),
onPressed: () {
@ -587,21 +606,23 @@ class StaffListState extends ConsumerState<StaffList> {
);
}
static final _dataBold = TextStyle(
fontSize: 14,
static final _dataBold = GoogleFonts.inter(
fontSize: 12,
fontWeight: FontWeight.w400,
color: Color(0xFF000000),
);
static final _dataSub = TextStyle(
static final _dataSub = GoogleFonts.inter(
fontSize: 10,
fontWeight: FontWeight.w300,
color: Color(0xFF585757),
);
static const _headerStyle = TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
static final _headerStyle = GoogleFonts.inter(
color: Color(0XFF1e293b),
fontSize: 12,
fontWeight: FontWeight.w600,
);
}

View File

@ -545,6 +545,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
today: policiesIssuedToday ?? '',
month: policiesIssuedMonth ?? '',
year: policiesIssuedYear ?? '',
colorDark: Color(0xFF059669),
imagePath:
"assets/dashboard/Policy issue icon.png",
),
@ -556,6 +557,8 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
today: premiumValueToday ?? '',
month: premiumValueMonth ?? '',
year: premiumValueYear ?? '',
colorDark: Color(0XFF1d4ed8),
// colorDark: Color(0xff2563eb),
imagePath: "assets/dashboard/Premium value.png",
),
),
@ -566,13 +569,14 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
today: earningsToday ?? '',
month: earningsMonth ?? '',
year: earningsYear ?? '',
colorDark: Color(0xff8b5cf6),
imagePath: "assets/dashboard/Earnings.png",
),
),
],
),
const SizedBox(height: 10),
const SizedBox(height: 5),
SizedBox(
// replace Expanded
height: (role == 'agent')
@ -731,7 +735,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
],
),
),
const SizedBox(height: 10),
const SizedBox(height: 5),
if (role == 'manager')
SizedBox(
// replace Expanded
@ -840,7 +844,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
child: Text(
title,
style: GoogleFonts.inter(
fontSize: 14,
fontSize: 11,
fontWeight: FontWeight.bold,
color: isSelected ? const Color(0xFF425B5B) : Colors.white,
),
@ -857,6 +861,7 @@ class StatCard extends StatelessWidget {
final String month;
final String year;
final String? imagePath;
final Color? colorDark;
const StatCard({
super.key,
@ -865,36 +870,55 @@ class StatCard extends StatelessWidget {
required this.month,
required this.year,
this.imagePath,
this.colorDark,
});
@override
Widget build(BuildContext context) {
return Card(
color: Color(0xFFEAF6F4),
color: Colors.white,
// color: Color(0xFFF1F9F8),
// color: Color(0xFFEAF6F4),
elevation: 1,
shadowColor: colorDark ?? null,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(16.0),
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
children: [
Image.asset(imagePath!, width: 28, height: 28),
Container(
padding: EdgeInsets.all(4.0),
height: 28,
width: 28,
decoration: BoxDecoration(
color: colorDark ?? Colors.grey,
borderRadius: BorderRadius.circular(15),
),
child: Image.asset(
imagePath!,
width: 18,
height: 18,
// color: colorDark ?? Colors.grey,
color: Colors.white,
),
),
const SizedBox(width: 8),
Text(
title,
style: GoogleFonts.inter(
fontSize: 16,
fontSize: 12,
fontWeight: FontWeight.w700,
color: Color(0xFF425B5B),
),
),
],
),
Divider(),
const SizedBox(height: 15),
Divider(thickness: 0.1, color: colorDark ?? Colors.grey),
const SizedBox(height: 5),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -904,7 +928,7 @@ class StatCard extends StatelessWidget {
textAlign: TextAlign.center,
style: GoogleFonts.inter(
fontWeight: FontWeight.bold,
fontSize: 16,
fontSize: 12,
),
),
),
@ -914,7 +938,7 @@ class StatCard extends StatelessWidget {
textAlign: TextAlign.center,
style: GoogleFonts.inter(
fontWeight: FontWeight.bold,
fontSize: 16,
fontSize: 12,
),
),
),
@ -924,7 +948,7 @@ class StatCard extends StatelessWidget {
textAlign: TextAlign.center,
style: GoogleFonts.inter(
fontWeight: FontWeight.bold,
fontSize: 16,
fontSize: 12,
),
),
),
@ -1182,8 +1206,9 @@ class othersPendings extends StatelessWidget {
print(' Data: $data');
return Card(
color: const Color(0xFFEAF6F4),
elevation: 0,
color: Colors.white,
// color: const Color(0xFFEAF6F4),
elevation: 1,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(12.0),
@ -1196,9 +1221,10 @@ class othersPendings extends StatelessWidget {
// Header row
Container(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
decoration: BoxDecoration(
color: const Color(0xFF3E5B56),
color: Color(0xFFE3F9F8),
// color: const Color(0xFF3E5B56),
borderRadius: BorderRadius.circular(10),
),
child: Row(
@ -1300,7 +1326,13 @@ class othersPendings extends StatelessWidget {
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
border: Border(
bottom: BorderSide(
color: Colors.blueGrey.shade100,
width: 0.3,
),
),
// borderRadius: BorderRadius.circular(10),
),
child: Row(
children: [
@ -1346,25 +1378,28 @@ class othersPendings extends StatelessWidget {
flex: 2,
child: Material(
color: Colors.white,
child: InkWell(
hoverColor: Color(0xFFEAF6F4),
onTap: () {
print(
'Awaiting Proposal : ${row['awaiting_quotation']}',
);
child: Center(
child: InkWell(
// hoverColor: Color(0xFFEAF6F4),
onTap: () {
print(
'Awaiting Proposal : ${row['awaiting_quotation']}',
);
handleDashboardNavigation(
context,
status: "Awaiting Proposal",
staffId: row['staff_id'] ?? '',
role: role,
);
},
child: Text(
row['awaiting_quotation'] ?? "",
// row['total_approval_pending'] ?? "",
textAlign: TextAlign.center,
style: _tableDataStyle,
handleDashboardNavigation(
context,
status: "Awaiting Proposal",
staffId: row['staff_id'] ?? '',
role: role,
);
},
child: Text(
row['awaiting_quotation'] ?? "",
// row['total_approval_pending'] ?? "",
textAlign: TextAlign.center,
style: _tableDataStyle,
),
),
),
),
@ -1373,24 +1408,26 @@ class othersPendings extends StatelessWidget {
flex: 2,
child: Material(
color: Colors.white,
child: InkWell(
hoverColor: Color(0xFFEAF6F4),
onTap: () async {
print(
'Awaiting Approval : ${row['pending_quotation_approval']} - ${row['staff_id']}',
);
handleDashboardNavigation(
context,
status: "Proposal Created",
staffId: row['staff_id'] ?? '',
role: role,
);
},
child: Text(
row['pending_quotation_approval'] ?? "",
// row['total_approval_pending'] ?? "",
textAlign: TextAlign.center,
style: _tableDataStyle,
child: Center(
child: InkWell(
hoverColor: Color(0xFFEAF6F4),
onTap: () async {
print(
'Awaiting Approval : ${row['pending_quotation_approval']} - ${row['staff_id']}',
);
handleDashboardNavigation(
context,
status: "Proposal Created",
staffId: row['staff_id'] ?? '',
role: role,
);
},
child: Text(
row['pending_quotation_approval'] ?? "",
// row['total_approval_pending'] ?? "",
textAlign: TextAlign.center,
style: _tableDataStyle,
),
),
),
),
@ -1399,25 +1436,27 @@ class othersPendings extends StatelessWidget {
flex: 2,
child: Material(
color: Colors.white,
child: InkWell(
hoverColor: Color(0xFFEAF6F4),
onTap: () {
print(
'Awaiting Policy : ${row['awaiting_policy']}',
);
child: Center(
child: InkWell(
hoverColor: Color(0xFFEAF6F4),
onTap: () {
print(
'Awaiting Policy : ${row['awaiting_policy']}',
);
handleDashboardNavigation(
context,
status: "Proposal Accepted",
staffId: row['staff_id'] ?? '',
role: role,
);
},
child: Text(
row['awaiting_policy'] ?? "",
// row['total_approval_pending'] ?? "",
textAlign: TextAlign.center,
style: _tableDataStyle,
handleDashboardNavigation(
context,
status: "Proposal Accepted",
staffId: row['staff_id'] ?? '',
role: role,
);
},
child: Text(
row['awaiting_policy'] ?? "",
// row['total_approval_pending'] ?? "",
textAlign: TextAlign.center,
style: _tableDataStyle,
),
),
),
),
@ -1461,8 +1500,9 @@ class awaitingApproval extends StatelessWidget {
print(' Data: $data');
return Card(
color: const Color(0xFFEAF6F4),
elevation: 0,
color: Colors.white,
// color: const Color(0xFFEAF6F4),
elevation: 1,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(12.0),
@ -1475,9 +1515,10 @@ class awaitingApproval extends StatelessWidget {
// Header row
Container(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
decoration: BoxDecoration(
color: const Color(0xFF3E5B56),
// color: const Color(0xFF3E5B56),
color: Color(0xFFE3F9F8),
borderRadius: BorderRadius.circular(10),
),
child: Row(
@ -1545,7 +1586,13 @@ class awaitingApproval extends StatelessWidget {
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
border: Border(
bottom: BorderSide(
color: Colors.blueGrey.shade100,
width: 0.3,
),
),
// borderRadius: BorderRadius.circular(10),
),
child: Row(
children: [
@ -1612,8 +1659,9 @@ class Performance extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Card(
color: const Color(0xFFEAF6F4),
elevation: 0,
// color: const Color(0xFFEAF6F4),
color: Colors.white,
elevation: 1,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(12.0),
@ -1626,9 +1674,10 @@ class Performance extends StatelessWidget {
// Header row
Container(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
decoration: BoxDecoration(
color: const Color(0xFF3E5B56),
color: Color(0xFFE3F9F8),
// color: const Color(0xFF3E5B56),
borderRadius: BorderRadius.circular(10),
),
child: Row(
@ -1684,7 +1733,13 @@ class Performance extends StatelessWidget {
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
border: Border(
bottom: BorderSide(
color: Colors.blueGrey.shade100,
width: 0.3,
),
),
// borderRadius: BorderRadius.circular(10),
),
child: Row(
children: [
@ -1720,7 +1775,7 @@ class Performance extends StatelessWidget {
: (row['status']?.toString() ?? ""),
textAlign: TextAlign.center,
style: GoogleFonts.inter(
fontSize: 14,
fontSize: 11,
fontWeight: FontWeight.w500,
color: title == "Performing Partners"
? Colors.black
@ -1761,8 +1816,9 @@ class UnassignedEnq extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Card(
color: const Color(0xFFEAF6F4),
elevation: 0,
color: Colors.white,
// color: const Color(0xFFEAF6F4),
elevation: 1,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(12.0),
@ -1775,9 +1831,10 @@ class UnassignedEnq extends StatelessWidget {
// Header row
Container(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 12),
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
decoration: BoxDecoration(
color: const Color(0xFF3E5B56),
// color: const Color(0xFF3E5B56),
color: Color(0xFFE3F9F8),
borderRadius: BorderRadius.circular(10),
),
child: Row(
@ -1798,14 +1855,14 @@ class UnassignedEnq extends StatelessWidget {
),
Expanded(
child: Text(
"Partner Name",
"Partner",
// textAlign: TextAlign.center,
style: _headerStyle,
),
),
Expanded(
child: Text(
"Vehicle Number",
"Reg.No.",
// textAlign: TextAlign.center,
style: _headerStyle,
),
@ -1886,7 +1943,13 @@ class UnassignedEnq extends StatelessWidget {
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
border: Border(
bottom: BorderSide(
color: Colors.blueGrey.shade100,
width: 0.3,
),
),
// borderRadius: BorderRadius.circular(10),
),
child: Row(
children: [
@ -1964,28 +2027,28 @@ Future<void> handleDashboardNavigation(
final _headerStyle = GoogleFonts.inter(
fontWeight: FontWeight.w600,
fontSize: 14,
color: Colors.white,
fontSize: 11.5,
color: Colors.black,
);
final _title = GoogleFonts.inter(
fontWeight: FontWeight.bold,
fontSize: 16,
fontSize: 11.5,
// color: Colors.red,
color: const Color(0xff425B5B),
);
final _tableDataStyle = GoogleFonts.inter(
fontSize: 14,
fontSize: 11,
fontWeight: FontWeight.w500,
);
final _tableDataTimeStyle = GoogleFonts.inter(
fontSize: 12,
fontSize: 10,
fontWeight: FontWeight.w400,
);
final topHeaderStyle = GoogleFonts.inter(
fontSize: 12,
fontSize: 11,
color: Colors.black,
fontWeight: FontWeight.w500,
);

View File

@ -435,6 +435,7 @@ class EnquiryHandlerState extends ConsumerState<EnquiryListHandler> {
try {
final response = await apiService.fetchEnquiryList(
managerId,
userId,
role,
fromDate: fromDt,
toDate: toDt,

View File

@ -214,6 +214,7 @@ class EnquiryHandlerState extends ConsumerState<EnquiryListInline> {
try {
final response = await apiService.fetchEnquiryList(
managerId,
userId,
role,
fromDate: fromDt,
toDate: toDt,

View File

@ -338,7 +338,11 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
print('managerId -- $managerId');
final userRole = ref.watch(userRoleProvider);
print('userRole -- $userRole');
context.go(AppRoutes.dashboard);
if (userRole == 'staff') {
context.go(AppRoutes.enquiryForStaff);
} else {
context.go(AppRoutes.dashboard);
}
} else {
ToastHelper.showErrorToast(context, data['message'] ?? 'Invalid OTP');
}

View File

@ -435,6 +435,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
try {
final response = await apiService.fetchEnquiryList(
managerId,
userId,
role,
fromDate: fromDt,
toDate: toDt,

View File

@ -446,6 +446,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
try {
final response = await apiService.fetchEnquiryList(
managerId,
userId,
role,
fromDate: fromDt,
toDate: toDt,
@ -861,8 +862,18 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
child: DropdownSearch<Map<String, dynamic>>(
key: dropDownKeyInsurerEnqAsgn,
selectedItem: selectedInsurerd.isNotEmpty ? selectedInsurerd : null,
items: (filter, infiniteScrollProps) {
return filteredInsurersData;
// items: (filter, infiniteScrollProps) {
// return filteredInsurersData;
// },
items: (filter, infiniteScrollProps) async {
if (filter.isEmpty) {
return filteredInsurersData;
}
return filteredInsurersData.where((item) {
return item['name'].toString().toLowerCase().contains(
filter.toLowerCase(),
);
}).toList();
},
itemAsString: (val) => val['name'].toString(), // what to show
@ -933,13 +944,14 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
popupProps: PopupProps.menu(
fit: FlexFit.loose,
constraints: BoxConstraints(maxHeight: 250),
constraints: BoxConstraints(maxHeight: 200),
menuProps: MenuProps(
backgroundColor:
Colors.white, // 👈 sets dropdown background to white
),
showSearchBox: true,
searchFieldProps: TextFieldProps(
autofocus: true,
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
@ -1227,8 +1239,18 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
child: DropdownSearch<Map<String, dynamic>>(
key: dropDownKeyAgent,
selectedItem: selectedAgntName.isNotEmpty ? selectedAgntName : null,
items: (filter, infiniteScrollProps) {
return filteredAgentData;
// items: (filter, infiniteScrollProps) {
// return filteredAgentData;
// },
items: (filter, infiniteScrollProps) async {
if (filter.isEmpty) {
return filteredAgentData;
}
return filteredAgentData.where((item) {
return item['name'].toString().toLowerCase().contains(
filter.toLowerCase(),
);
}).toList();
},
itemAsString: (val) => val['name'].toString(), // what to show
@ -2574,47 +2596,6 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end,
children: [
// Container(
// // height: 30,
// // width: MediaQuery.of(context).size.width,
// child: GestureDetector(
// onTap: () {
// context.go(AppRoutes.dashboard);
// },
// child: Row(
// // crossAxisAlignment: CrossAxisAlignment.center,
// // mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Tooltip(
// message: 'Back',
// child: IconButton(
// icon: const Icon(Icons.arrow_left_sharp, size: 25),
// onPressed: () async {
// context.go(AppRoutes.dashboard);
// final prefs = await SharedPreferences.getInstance();
// await prefs.remove('dashboardKeyProvider');
// await prefs.remove('dashboardStatusProvider');
// await prefs.remove('dashboardStaffIdProvider');
// },
// splashRadius: 18,
// padding: const EdgeInsets.all(4),
// hoverColor: Colors.black12,
// constraints: const BoxConstraints(),
// ),
// ),
// const SizedBox(width: 5), // spacing between icon and text
// Text(
// "Enquiries",
// style: TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.w600,
// ),
// ),
// ],
// ),
// ),
// ),
// Spacer(),
if (_showFilterRow) ...[
DateFilterRow(
key: ValueKey(SelectedStatus ?? ''),
@ -2661,9 +2642,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
ThemedSearchField(
hintText: 'Search',
backgroundColor: Color(0xFFFFFFFF),
txtHeight: 30,
// backgroundColor: Colors.white,
onChanged: filterData,
txtHeight: 30,
controller: _searchStaffController,
txtwidth: ResponsiveLayout.isMobile(context)
? MediaQuery.of(context).size.width * 0.7
@ -2707,30 +2689,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
),
SizedBox(height: 5),
// SingleChildScrollView(
// scrollDirection: Axis.horizontal,
// child: Container(
// width: MediaQuery.of(context).size.width,
// // width: double.infinity,
// // height: 40,
// decoration: BoxDecoration(
// color: Colors.white,
// boxShadow: [
// BoxShadow(
// color: Colors.black.withOpacity(0.08),
// blurRadius: 8,
// spreadRadius: 1,
// offset: const Offset(0, 2), // soft drop shadow
// ),
// ],
// ),
// // color: Colors.white,
//
// // color: Color(0xFFE8F5F3),
// // color: Color(0xFFE8F5F3),
// child: _buildTableHeader(isDesktop),
// ),
// ),
ResponsiveLayout.isMobile(context)
? _buildDataTable(context)
:
@ -2738,18 +2697,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
// child:
Container(
height: MediaQuery.of(context).size.height * 0.55,
decoration: BoxDecoration(
color: Colors.white,
// border: Border.all(color: Colors.grey, width: 0.1),
// boxShadow: [
// BoxShadow(
// color: Colors.black.withOpacity(0.08),
// blurRadius: 8,
// spreadRadius: 1,
// offset: const Offset(0, 2), // soft drop shadow
// ),
// ],
),
decoration: BoxDecoration(color: Colors.white),
child: _buildDataTable(context),
),
// ),
@ -2757,8 +2705,6 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
);
}
// Add this to your EnquiryStaffState class
// 1. Add group expansion state tracking
Map<String, bool> groupExpanded = {
'Awaiting Proposal': true,
@ -2776,7 +2722,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
'Policy Created': 'Policy Created',
};
// 2. Add method to group enquiries by status
// Add group enquiries by status
Map<String, List<Map<String, dynamic>>> get _groupedEnquiries {
final grouped = <String, List<Map<String, dynamic>>>{};
@ -2814,7 +2760,6 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
return grouped;
}
// 3. Add method to get status icon and color
Map<String, dynamic> _getStatusConfig(String status) {
switch (status) {
case 'Awaiting Proposal':
@ -2832,6 +2777,30 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
}
}
final Map<String, Color> statusColors = {
'Awaiting Proposal': const Color(0xFFEFF6FF), // Blue 50
'Proposal Created': const Color(0xFFF0F9FF), // Cyan 50
'Proposal Accepted': const Color(0xFFF0FDF4), // Green 50
'Proposal Rejected': const Color(0xFFFEF9C3), // Yellow 50
'Policy Created': const Color(0xFFEDE9FE), // Purple 50 (generated)
};
final Map<String, Color> statusBorderColors = {
'Awaiting Proposal': const Color(0xFFDBEAFE), // Blue 100
'Proposal Created': const Color(0xFFBAE6FD), // Cyan 100
'Proposal Accepted': const Color(0xFFDCFCE7), // Green 100
'Proposal Rejected': const Color(0xFFFEF3C7), // Yellow 100
'Policy Created': const Color(0xFFD8B4FE), // Purple 200
};
final Map<String, Color> statusTextColors = {
'Awaiting Proposal': const Color(0xFF1D4ED8), // Blue 700
'Proposal Created': const Color(0xFF0369A1), // Cyan 700
'Proposal Accepted': const Color(0xFF15803D), // Green 700
'Proposal Rejected': const Color(0xFFB45309), // Amber 700
'Policy Created': const Color(0xFF6B21A8), // Purple 700
};
// 4. Build group header widget
Widget _buildGroupHeader(String status, int count) {
final config = _getStatusConfig(status);
@ -2844,20 +2813,6 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
});
},
child: Container(
decoration: BoxDecoration(
// color: Colors.grey.shade50,
// color: Color(0xFFF0F7F6),
// color: Colors.grey.shade100,
// border: Border.all(color: Colors.grey.shade200, width: 1.6),
// border: Border(
// bottom: BorderSide(
// width: 0.1,
// color: Colors.grey.shade50,
// // color: Color(0xffE0E7E6),
// ),
// ),
),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 8),
child: Row(
children: [
@ -3143,43 +3098,27 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
final editing = isEditingRow[id] ?? false;
final controllers = rowControllers[id];
String status = item['status'] ?? '-';
Color bgColor = statusColors[status] ?? Color(0xFFF9FAFB);
Color borderColor = statusBorderColors[status] ?? Color(0xFFE2E8F0);
return DataRow(
cells: [
DataCell(
SizedBox(
width: 80,
child: Row(
children: [
// Text(item['created_on'], style: _dataBold),
Text(
formatDateTimeForTable(item['created_on'], newLine: true),
style: _dataBoldthm1,
),
],
),
),
),
// Agent Name
DataCell(
SizedBox(
width: 70,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(item['agent_code'] ?? '-', style: _dataBold),
Text(
item['agent_name'] != null
? _truncateText(item['agent_name'], 10)
: '-',
style: _tableDataTimeStyle,
),
],
),
),
),
// DataCell(
// SizedBox(
// width: 80,
// child: Row(
// children: [
// // Text(item['created_on'], style: _dataBold),
// Text(
// formatDateTimeForTable(item['created_on'], newLine: true),
// style: _dataBoldthm1,
// ),
// ],
// ),
// ),
// ),
// Assigned To
DataCell(
SizedBox(
@ -3194,7 +3133,27 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
: '-',
style: _dataBold,
),
Text(_formatDate(item['updated_on']), style: _dataBoldthm4),
// Text(_formatDate(item['updated_on']), style: _dataBoldthm4),
],
),
),
),
// Agent Name
DataCell(
SizedBox(
width: 150,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(item['agent_code'] ?? '-', style: _dataBold),
Text(
item['agent_name'] != null
? _truncateText(item['agent_name'], 20)
: '-',
style: _tableDataTimeStyle,
),
],
),
),
@ -3279,7 +3238,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
showDuration: const Duration(seconds: 2), // optional
child: Container(
padding: EdgeInsets.all(4.0),
margin: EdgeInsets.symmetric(vertical: 3),
margin: EdgeInsets.symmetric(vertical: 3, horizontal: 2),
decoration: BoxDecoration(
color: Color(0xFFF9FAFB),
border: Border.all(color: Color(0xFFE2E8F0)),
@ -3433,11 +3392,12 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
DataCell(
SizedBox(
width: 80,
width: 120,
child: Material(
color: Colors.white,
child: InkWell(
hoverColor: Color(0xFFEAF6F4),
// hoverColor: Color(0xFFEAF6F4),
onTap: () async {
var status = item['status'];
var enqId = item['id'];
@ -3456,10 +3416,25 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
message: 'Click to View or Process Enquiry', //
waitDuration: const Duration(milliseconds: 500), // optional
showDuration: const Duration(seconds: 2), // optional
child: Text(
item['status'] ?? '-',
style: _dataBold,
// overflow: TextOverflow.clip, //
child: Container(
padding: EdgeInsets.all(4.0),
margin: EdgeInsets.symmetric(vertical: 3),
decoration: BoxDecoration(
// color: Color(0xFFF9FAFB),
// border: Border.all(color: Color(0xFFE2E8F0)),
color: bgColor,
border: Border.all(color: borderColor),
borderRadius: BorderRadius.circular(5),
),
child: Text(
item['status'] ?? '-',
style: GoogleFonts.inter(
fontSize: 11,
color: statusTextColors[status] ?? Colors.black,
fontWeight: FontWeight.w500,
),
// overflow: TextOverflow.clip, //
),
),
),
// child: Text(item['status'] ?? '-', style: _dataBold),
@ -3474,9 +3449,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
// Add this helper method to generate DataColumns
List<DataColumn> _buildDataColumns() {
return [
DataColumn(label: Text('Received Date', style: _headerStyle)),
DataColumn(label: Text('Partner *', style: _headerStyle)),
// DataColumn(label: Text('Received Date', style: _headerStyle)),
DataColumn(label: Text('Assigned To *', style: _headerStyle)),
DataColumn(label: Text('Partner *', style: _headerStyle)),
// const DataColumn(label: Text('Broker *', style: _headerStyle)),
DataColumn(label: Text('Insurer *', style: _headerStyle)),
DataColumn(label: Text('Insured Name *', style: _headerStyle)),
@ -3496,9 +3472,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
_buildHeaderCell('Received Date', 120),
_buildHeaderCell('Partner *', 80),
_buildHeaderCell('Assigned To *', 110),
// _buildHeaderCell('Received Date', 120),
_buildHeaderCell('Assigned To *', 130),
_buildHeaderCell('Partner *', 160),
// _buildHeaderCell('Broker *', 100),
_buildHeaderCell('Insurer *', 90),
_buildHeaderCell('Insured Name *', 120),

View File

@ -433,6 +433,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
try {
final response = await apiService.fetchEnquiryList(
managerId,
userId,
role,
fromDate: fromDt,
toDate: toDt,

View File

@ -332,10 +332,14 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.08),
blurRadius: 4,
spreadRadius: 1,
offset: const Offset(0, 2), // soft drop shadow
// color: Colors.black.withOpacity(0.08),
color: Color(0xFF2E7D6E),
// color: Color(0xFFDCFCE7),
blurRadius: 0,
spreadRadius: 0.1,
// blurRadius: 0.1,
// spreadRadius: 1,
offset: const Offset(0, 0.5), // soft drop shadow
),
],
),
@ -367,7 +371,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Partner', style: _subLabelTimeStyle),
Text('Partner *', style: _subLabelTimeStyle),
SizedBox(height: 5),
SizedBox(
@ -379,8 +383,18 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
child: DropdownSearch<Map<String, dynamic>>(
key: dropDownKeyAgent,
selectedItem: selectedAgntName.isNotEmpty ? selectedAgntName : null,
items: (filter, infiniteScrollProps) {
return filteredAgentData;
// items: (filter, infiniteScrollProps) {
// return filteredAgentData;
// },
items: (filter, infiniteScrollProps) async {
if (filter.isEmpty) {
return filteredAgentData;
}
return filteredAgentData.where((item) {
return item['name'].toString().toLowerCase().contains(
filter.toLowerCase(),
);
}).toList();
},
itemAsString: (val) => val['name'].toString(), // what to show
@ -458,6 +472,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
showSearchBox: true,
searchFieldProps: TextFieldProps(
autofocus: true,
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
@ -542,6 +557,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
hintText: 'Insured Name',
// errorText: fieldErrors['name'],
borderColor: Color(0xFFE2E8F0),
highlightColor: Color(0xFF50A398),
isdense: true,
validator: (value) => Validators.requiredField(value, "name"),
widthNone: true,
@ -559,7 +575,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Insurer', style: _subLabelTimeStyle),
Text('Insurer *', style: _subLabelTimeStyle),
SizedBox(height: 5),
Container(
@ -568,10 +584,20 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
child: DropdownSearch<Map<String, dynamic>>(
key: dropDownKeyInsurerEnqAsgn,
selectedItem: selectedInsurerd.isNotEmpty ? selectedInsurerd : null,
items: (filter, infiniteScrollProps) {
return filteredInsurersData;
// items: (filter, infiniteScrollProps) {
// return filteredInsurersData;
// },
// 👇 Enable async filtering based on user input
items: (filter, infiniteScrollProps) async {
if (filter.isEmpty) {
return filteredInsurersData;
}
return filteredInsurersData.where((item) {
return item['name'].toString().toLowerCase().contains(
filter.toLowerCase(),
);
}).toList();
},
itemAsString: (val) => val['name'].toString(), // what to show
compareFn: (item, selectedItem) =>
item['id'] == selectedItem['id'], // compare by id
@ -637,6 +663,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
popupProps: PopupProps.menu(
fit: FlexFit.loose,
searchDelay: Duration(milliseconds: 200),
constraints: BoxConstraints(maxHeight: 250),
menuProps: MenuProps(
backgroundColor:
@ -644,12 +671,13 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
),
showSearchBox: true,
searchFieldProps: TextFieldProps(
autofocus: true,
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
hintText: "Search Insurer...",
hintStyle: GoogleFonts.inter(
fontSize: 12,
fontSize: 11,
color: Colors.black,
),
enabledBorder: OutlineInputBorder(
@ -665,6 +693,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
),
),
),
itemBuilder: (context, item, isDisabled, isSelected) {
return Container(
// color: isSelected ? Colors.blue.withOpacity(0.1) : null,
@ -700,7 +729,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Vehicle Number', style: _subLabelTimeStyle),
Text('Vehicle Number *', style: _subLabelTimeStyle),
SizedBox(height: 5),
SizedBox(
@ -709,12 +738,14 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
controller: controllers['regNo']!,
hintText: 'Vehicle Number',
borderColor: Color(0xFFE2E8F0),
highlightColor: Color(0xFF50A398),
isdense: true,
inputFormatters: [
UpperCaseTextFormatter(), // 👈 custom formatter for uppercase
FilteringTextInputFormatter.allow(RegExp(r'[A-Za-z0-9- ]')),
],
validator: (value) => Validators.requiredVechileNum(value, "regNo"),
validator: (value) => Validators.requiredField(value, "regNo"),
// validator: (value) => Validators.requiredVechileNum(value, "regNo"),
widthNone: true,
),
),
@ -735,7 +766,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Assigned To', style: _subLabelTimeStyle),
Text('Assigned To *', style: _subLabelTimeStyle),
SizedBox(height: 5),
SizedBox(
@ -746,8 +777,18 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
// selectedItem: selectedVehicle.isNotEmpty ? selectedVehicle : null,
selectedItem: selectedVehicle,
items: (filter, infiniteScrollProps) {
return filteredStaffDataEnqAsgn;
// items: (filter, infiniteScrollProps) {
// return filteredStaffDataEnqAsgn;
// },
items: (filter, infiniteScrollProps) async {
if (filter.isEmpty) {
return filteredStaffDataEnqAsgn;
}
return filteredStaffDataEnqAsgn.where((item) {
return item['name'].toString().toLowerCase().contains(
filter.toLowerCase(),
);
}).toList();
},
itemAsString: (val) => val['name'].toString(),
@ -821,6 +862,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
),
showSearchBox: true,
searchFieldProps: TextFieldProps(
autofocus: true,
decoration: InputDecoration(
filled: true,
fillColor: Colors.white,
@ -926,8 +968,9 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
}
final _subLabelTimeStyle = GoogleFonts.inter(
fontSize: 11,
fontSize: 11.5,
fontWeight: FontWeight.w500,
color: Color(0xFF1E293B),
color: Color(0xFF2E7D6E),
// color: Color(0xFF1E293B),
);
}

View File

@ -41,6 +41,9 @@ class TabEnquiryStaffListState extends ConsumerState<TabEnquiryStaffList> {
dynamic selectedVehicleType;
dynamic selectedBrokerName;
dynamic selectedAgentName;
dynamic selectedInsurer;
@override
void initState() {
super.initState();
@ -99,6 +102,8 @@ class TabEnquiryStaffListState extends ConsumerState<TabEnquiryStaffList> {
selectedVehicleNum = data['enquiry']?['reg_no'];
selectedVehicleType = data['enquiry']?['vehicle_type'];
selectedBrokerName = data['enquiry']?['broker_name'];
selectedAgentName = data['enquiry']?['agent_name'];
selectedInsurer = data['enquiry']?['insurer_short_name'];
print(
'loadQuotationTab 4s -$selectedBrokerName $selectedInsuredName - $selectedVehicleNum - $selectedVehicleType',
);
@ -229,6 +234,8 @@ class TabEnquiryStaffListState extends ConsumerState<TabEnquiryStaffList> {
children: [
insured_name(context),
vehcile_num(context),
AgentName(context),
Insurer(context),
// vehcile_Type(context),
// broker(context),
SizedBox.shrink(),
@ -243,32 +250,51 @@ class TabEnquiryStaffListState extends ConsumerState<TabEnquiryStaffList> {
Row(
children: List.generate(tabs.length, (index) {
final isSelected = selectedIndex == index;
return Padding(
padding: const EdgeInsets.only(left: 10.0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
elevation: 2,
backgroundColor: isSelected
? const Color(0xFF425B5B)
: const Color(0xFFEDFFFC),
foregroundColor: isSelected ? Colors.white : Colors.black87,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 12,
),
padding: const EdgeInsets.symmetric(horizontal: 1.0),
child: InkWell(
onTap: () => setState(() => selectedIndex = index),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// ---- TEXT ----
Text(
tabs[index].title,
style: TextStyle(
fontSize: 12,
fontWeight: isSelected
? FontWeight.w600
: FontWeight.w400,
color: isSelected
? const Color(
0xFF2E7D6E,
) // Purple-ish like screenshot
: Colors.black87,
),
),
const SizedBox(height: 6),
// ---- UNDERLINE INDICATOR ----
AnimatedContainer(
duration: Duration(milliseconds: 250),
curve: Curves.easeInOut,
height: 3,
width: isSelected ? 80 : 0,
decoration: BoxDecoration(
color: const Color(
0xFF2E7D6E,
), // underline color from screenshot
borderRadius: BorderRadius.circular(50),
),
),
],
),
onPressed: () {
setState(() => selectedIndex = index);
},
child: Text(tabs[index].title),
),
);
}),
),
SizedBox(height: 10),
Expanded(child: tabs[selectedIndex].widget),
],
);
@ -312,6 +338,28 @@ class TabEnquiryStaffListState extends ConsumerState<TabEnquiryStaffList> {
);
}
Widget AgentName(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('AgentName', style: _textStyle),
SizedBox(height: 10),
Text(selectedAgentName ?? '', style: _textDataStyle),
],
);
}
Widget Insurer(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Insurer', style: _textStyle),
SizedBox(height: 10),
Text(selectedInsurer ?? '', style: _textDataStyle),
],
);
}
Widget vehcile_Type(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,

View File

@ -74,6 +74,7 @@ class ThemedSearchField extends HookWidget {
color: const Color(0xFF94A3B8),
fontSize: (txtHeight ?? 45) <= 45 ? 12 : 14,
),
// suffixIconConstraints: const BoxConstraints(
// maxWidth: 25 + 16 + 10,
// maxHeight: 25 + (8 * 2),

View File

@ -20,6 +20,7 @@ class ThemedFormInlineField extends HookWidget {
this.backgroundColor,
this.textColr,
this.borderColor,
this.highlightColor,
this.errorBorderColor,
this.errorTextColor,
this.readOnly = false, // new
@ -42,6 +43,7 @@ class ThemedFormInlineField extends HookWidget {
final Color? borderColor;
final Color? errorBorderColor;
final Color? errorTextColor;
final Color? highlightColor;
final Color? textColr;
final double? txtwidth;
final bool readOnly;
@ -120,12 +122,14 @@ class ThemedFormInlineField extends HookWidget {
? OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
// borderSide: BorderSide(color: Color(0xFF50A398)),
borderSide: BorderSide(color: borderColor ?? Color(0xFFFFFFFF)),
borderSide: BorderSide(
color: highlightColor ?? borderColor ?? Color(0xFF50A398),
),
)
: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(
color: borderColor ?? Color(0xFF50A398),
color: highlightColor ?? borderColor ?? Color(0xFF50A398),
width: 2,
),
),