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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -446,6 +446,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
try { try {
final response = await apiService.fetchEnquiryList( final response = await apiService.fetchEnquiryList(
managerId, managerId,
userId,
role, role,
fromDate: fromDt, fromDate: fromDt,
toDate: toDt, toDate: toDt,
@ -861,8 +862,18 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
child: DropdownSearch<Map<String, dynamic>>( child: DropdownSearch<Map<String, dynamic>>(
key: dropDownKeyInsurerEnqAsgn, key: dropDownKeyInsurerEnqAsgn,
selectedItem: selectedInsurerd.isNotEmpty ? selectedInsurerd : null, selectedItem: selectedInsurerd.isNotEmpty ? selectedInsurerd : null,
items: (filter, infiniteScrollProps) { // items: (filter, infiniteScrollProps) {
// return filteredInsurersData;
// },
items: (filter, infiniteScrollProps) async {
if (filter.isEmpty) {
return filteredInsurersData; return filteredInsurersData;
}
return filteredInsurersData.where((item) {
return item['name'].toString().toLowerCase().contains(
filter.toLowerCase(),
);
}).toList();
}, },
itemAsString: (val) => val['name'].toString(), // what to show itemAsString: (val) => val['name'].toString(), // what to show
@ -933,13 +944,14 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
popupProps: PopupProps.menu( popupProps: PopupProps.menu(
fit: FlexFit.loose, fit: FlexFit.loose,
constraints: BoxConstraints(maxHeight: 250), constraints: BoxConstraints(maxHeight: 200),
menuProps: MenuProps( menuProps: MenuProps(
backgroundColor: backgroundColor:
Colors.white, // 👈 sets dropdown background to white Colors.white, // 👈 sets dropdown background to white
), ),
showSearchBox: true, showSearchBox: true,
searchFieldProps: TextFieldProps( searchFieldProps: TextFieldProps(
autofocus: true,
decoration: InputDecoration( decoration: InputDecoration(
filled: true, filled: true,
fillColor: Colors.white, fillColor: Colors.white,
@ -1227,8 +1239,18 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
child: DropdownSearch<Map<String, dynamic>>( child: DropdownSearch<Map<String, dynamic>>(
key: dropDownKeyAgent, key: dropDownKeyAgent,
selectedItem: selectedAgntName.isNotEmpty ? selectedAgntName : null, selectedItem: selectedAgntName.isNotEmpty ? selectedAgntName : null,
items: (filter, infiniteScrollProps) { // items: (filter, infiniteScrollProps) {
// return filteredAgentData;
// },
items: (filter, infiniteScrollProps) async {
if (filter.isEmpty) {
return filteredAgentData; return filteredAgentData;
}
return filteredAgentData.where((item) {
return item['name'].toString().toLowerCase().contains(
filter.toLowerCase(),
);
}).toList();
}, },
itemAsString: (val) => val['name'].toString(), // what to show itemAsString: (val) => val['name'].toString(), // what to show
@ -2574,47 +2596,6 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ 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) ...[ if (_showFilterRow) ...[
DateFilterRow( DateFilterRow(
key: ValueKey(SelectedStatus ?? ''), key: ValueKey(SelectedStatus ?? ''),
@ -2661,9 +2642,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
ThemedSearchField( ThemedSearchField(
hintText: 'Search', hintText: 'Search',
backgroundColor: Color(0xFFFFFFFF), backgroundColor: Color(0xFFFFFFFF),
txtHeight: 30,
// backgroundColor: Colors.white, // backgroundColor: Colors.white,
onChanged: filterData, onChanged: filterData,
txtHeight: 30,
controller: _searchStaffController, controller: _searchStaffController,
txtwidth: ResponsiveLayout.isMobile(context) txtwidth: ResponsiveLayout.isMobile(context)
? MediaQuery.of(context).size.width * 0.7 ? MediaQuery.of(context).size.width * 0.7
@ -2707,30 +2689,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
), ),
SizedBox(height: 5), 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) ResponsiveLayout.isMobile(context)
? _buildDataTable(context) ? _buildDataTable(context)
: :
@ -2738,18 +2697,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
// child: // child:
Container( Container(
height: MediaQuery.of(context).size.height * 0.55, height: MediaQuery.of(context).size.height * 0.55,
decoration: BoxDecoration( decoration: BoxDecoration(color: Colors.white),
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
// ),
// ],
),
child: _buildDataTable(context), child: _buildDataTable(context),
), ),
// ), // ),
@ -2757,8 +2705,6 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
); );
} }
// Add this to your EnquiryStaffState class
// 1. Add group expansion state tracking // 1. Add group expansion state tracking
Map<String, bool> groupExpanded = { Map<String, bool> groupExpanded = {
'Awaiting Proposal': true, 'Awaiting Proposal': true,
@ -2776,7 +2722,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
'Policy Created': 'Policy Created', '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 { Map<String, List<Map<String, dynamic>>> get _groupedEnquiries {
final grouped = <String, List<Map<String, dynamic>>>{}; final grouped = <String, List<Map<String, dynamic>>>{};
@ -2814,7 +2760,6 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
return grouped; return grouped;
} }
// 3. Add method to get status icon and color
Map<String, dynamic> _getStatusConfig(String status) { Map<String, dynamic> _getStatusConfig(String status) {
switch (status) { switch (status) {
case 'Awaiting Proposal': 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 // 4. Build group header widget
Widget _buildGroupHeader(String status, int count) { Widget _buildGroupHeader(String status, int count) {
final config = _getStatusConfig(status); final config = _getStatusConfig(status);
@ -2844,20 +2813,6 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
}); });
}, },
child: Container( 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), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 8),
child: Row( child: Row(
children: [ children: [
@ -3143,43 +3098,27 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
final editing = isEditingRow[id] ?? false; final editing = isEditingRow[id] ?? false;
final controllers = rowControllers[id]; final controllers = rowControllers[id];
String status = item['status'] ?? '-';
Color bgColor = statusColors[status] ?? Color(0xFFF9FAFB);
Color borderColor = statusBorderColors[status] ?? Color(0xFFE2E8F0);
return DataRow( return DataRow(
cells: [ cells: [
DataCell( // DataCell(
SizedBox( // SizedBox(
width: 80, // width: 80,
child: Row( // child: Row(
children: [ // children: [
// Text(item['created_on'], style: _dataBold), // // Text(item['created_on'], style: _dataBold),
Text( // Text(
formatDateTimeForTable(item['created_on'], newLine: true), // formatDateTimeForTable(item['created_on'], newLine: true),
style: _dataBoldthm1, // 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,
),
],
),
),
),
// Assigned To // Assigned To
DataCell( DataCell(
SizedBox( SizedBox(
@ -3194,7 +3133,27 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
: '-', : '-',
style: _dataBold, 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 showDuration: const Duration(seconds: 2), // optional
child: Container( child: Container(
padding: EdgeInsets.all(4.0), padding: EdgeInsets.all(4.0),
margin: EdgeInsets.symmetric(vertical: 3), margin: EdgeInsets.symmetric(vertical: 3, horizontal: 2),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFF9FAFB), color: Color(0xFFF9FAFB),
border: Border.all(color: Color(0xFFE2E8F0)), border: Border.all(color: Color(0xFFE2E8F0)),
@ -3433,11 +3392,12 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
DataCell( DataCell(
SizedBox( SizedBox(
width: 80, width: 120,
child: Material( child: Material(
color: Colors.white, color: Colors.white,
child: InkWell( child: InkWell(
hoverColor: Color(0xFFEAF6F4), // hoverColor: Color(0xFFEAF6F4),
onTap: () async { onTap: () async {
var status = item['status']; var status = item['status'];
var enqId = item['id']; var enqId = item['id'];
@ -3456,12 +3416,27 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
message: 'Click to View or Process Enquiry', // message: 'Click to View or Process Enquiry', //
waitDuration: const Duration(milliseconds: 500), // optional waitDuration: const Duration(milliseconds: 500), // optional
showDuration: const Duration(seconds: 2), // optional showDuration: const Duration(seconds: 2), // optional
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( child: Text(
item['status'] ?? '-', item['status'] ?? '-',
style: _dataBold, style: GoogleFonts.inter(
fontSize: 11,
color: statusTextColors[status] ?? Colors.black,
fontWeight: FontWeight.w500,
),
// overflow: TextOverflow.clip, // // overflow: TextOverflow.clip, //
), ),
), ),
),
// child: Text(item['status'] ?? '-', style: _dataBold), // child: Text(item['status'] ?? '-', style: _dataBold),
), ),
), ),
@ -3474,9 +3449,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
// Add this helper method to generate DataColumns // Add this helper method to generate DataColumns
List<DataColumn> _buildDataColumns() { List<DataColumn> _buildDataColumns() {
return [ return [
DataColumn(label: Text('Received Date', style: _headerStyle)), // DataColumn(label: Text('Received Date', style: _headerStyle)),
DataColumn(label: Text('Partner *', style: _headerStyle)),
DataColumn(label: Text('Assigned To *', style: _headerStyle)), DataColumn(label: Text('Assigned To *', style: _headerStyle)),
DataColumn(label: Text('Partner *', style: _headerStyle)),
// const DataColumn(label: Text('Broker *', style: _headerStyle)), // const DataColumn(label: Text('Broker *', style: _headerStyle)),
DataColumn(label: Text('Insurer *', style: _headerStyle)), DataColumn(label: Text('Insurer *', style: _headerStyle)),
DataColumn(label: Text('Insured Name *', 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), padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row( child: Row(
children: [ children: [
_buildHeaderCell('Received Date', 120), // _buildHeaderCell('Received Date', 120),
_buildHeaderCell('Partner *', 80), _buildHeaderCell('Assigned To *', 130),
_buildHeaderCell('Assigned To *', 110), _buildHeaderCell('Partner *', 160),
// _buildHeaderCell('Broker *', 100), // _buildHeaderCell('Broker *', 100),
_buildHeaderCell('Insurer *', 90), _buildHeaderCell('Insurer *', 90),
_buildHeaderCell('Insured Name *', 120), _buildHeaderCell('Insured Name *', 120),

View File

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

View File

@ -332,10 +332,14 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.08), // color: Colors.black.withOpacity(0.08),
blurRadius: 4, color: Color(0xFF2E7D6E),
spreadRadius: 1, // color: Color(0xFFDCFCE7),
offset: const Offset(0, 2), // soft drop shadow 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( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text('Partner', style: _subLabelTimeStyle), Text('Partner *', style: _subLabelTimeStyle),
SizedBox(height: 5), SizedBox(height: 5),
SizedBox( SizedBox(
@ -379,8 +383,18 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
child: DropdownSearch<Map<String, dynamic>>( child: DropdownSearch<Map<String, dynamic>>(
key: dropDownKeyAgent, key: dropDownKeyAgent,
selectedItem: selectedAgntName.isNotEmpty ? selectedAgntName : null, selectedItem: selectedAgntName.isNotEmpty ? selectedAgntName : null,
items: (filter, infiniteScrollProps) { // items: (filter, infiniteScrollProps) {
// return filteredAgentData;
// },
items: (filter, infiniteScrollProps) async {
if (filter.isEmpty) {
return filteredAgentData; return filteredAgentData;
}
return filteredAgentData.where((item) {
return item['name'].toString().toLowerCase().contains(
filter.toLowerCase(),
);
}).toList();
}, },
itemAsString: (val) => val['name'].toString(), // what to show itemAsString: (val) => val['name'].toString(), // what to show
@ -458,6 +472,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
showSearchBox: true, showSearchBox: true,
searchFieldProps: TextFieldProps( searchFieldProps: TextFieldProps(
autofocus: true,
decoration: InputDecoration( decoration: InputDecoration(
filled: true, filled: true,
fillColor: Colors.white, fillColor: Colors.white,
@ -542,6 +557,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
hintText: 'Insured Name', hintText: 'Insured Name',
// errorText: fieldErrors['name'], // errorText: fieldErrors['name'],
borderColor: Color(0xFFE2E8F0), borderColor: Color(0xFFE2E8F0),
highlightColor: Color(0xFF50A398),
isdense: true, isdense: true,
validator: (value) => Validators.requiredField(value, "name"), validator: (value) => Validators.requiredField(value, "name"),
widthNone: true, widthNone: true,
@ -559,7 +575,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text('Insurer', style: _subLabelTimeStyle), Text('Insurer *', style: _subLabelTimeStyle),
SizedBox(height: 5), SizedBox(height: 5),
Container( Container(
@ -568,10 +584,20 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
child: DropdownSearch<Map<String, dynamic>>( child: DropdownSearch<Map<String, dynamic>>(
key: dropDownKeyInsurerEnqAsgn, key: dropDownKeyInsurerEnqAsgn,
selectedItem: selectedInsurerd.isNotEmpty ? selectedInsurerd : null, selectedItem: selectedInsurerd.isNotEmpty ? selectedInsurerd : null,
items: (filter, infiniteScrollProps) { // items: (filter, infiniteScrollProps) {
// return filteredInsurersData;
// },
// 👇 Enable async filtering based on user input
items: (filter, infiniteScrollProps) async {
if (filter.isEmpty) {
return filteredInsurersData; return filteredInsurersData;
}
return filteredInsurersData.where((item) {
return item['name'].toString().toLowerCase().contains(
filter.toLowerCase(),
);
}).toList();
}, },
itemAsString: (val) => val['name'].toString(), // what to show itemAsString: (val) => val['name'].toString(), // what to show
compareFn: (item, selectedItem) => compareFn: (item, selectedItem) =>
item['id'] == selectedItem['id'], // compare by id item['id'] == selectedItem['id'], // compare by id
@ -637,6 +663,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
popupProps: PopupProps.menu( popupProps: PopupProps.menu(
fit: FlexFit.loose, fit: FlexFit.loose,
searchDelay: Duration(milliseconds: 200),
constraints: BoxConstraints(maxHeight: 250), constraints: BoxConstraints(maxHeight: 250),
menuProps: MenuProps( menuProps: MenuProps(
backgroundColor: backgroundColor:
@ -644,12 +671,13 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
), ),
showSearchBox: true, showSearchBox: true,
searchFieldProps: TextFieldProps( searchFieldProps: TextFieldProps(
autofocus: true,
decoration: InputDecoration( decoration: InputDecoration(
filled: true, filled: true,
fillColor: Colors.white, fillColor: Colors.white,
hintText: "Search Insurer...", hintText: "Search Insurer...",
hintStyle: GoogleFonts.inter( hintStyle: GoogleFonts.inter(
fontSize: 12, fontSize: 11,
color: Colors.black, color: Colors.black,
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
@ -665,6 +693,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
), ),
), ),
), ),
itemBuilder: (context, item, isDisabled, isSelected) { itemBuilder: (context, item, isDisabled, isSelected) {
return Container( return Container(
// color: isSelected ? Colors.blue.withOpacity(0.1) : null, // color: isSelected ? Colors.blue.withOpacity(0.1) : null,
@ -700,7 +729,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text('Vehicle Number', style: _subLabelTimeStyle), Text('Vehicle Number *', style: _subLabelTimeStyle),
SizedBox(height: 5), SizedBox(height: 5),
SizedBox( SizedBox(
@ -709,12 +738,14 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
controller: controllers['regNo']!, controller: controllers['regNo']!,
hintText: 'Vehicle Number', hintText: 'Vehicle Number',
borderColor: Color(0xFFE2E8F0), borderColor: Color(0xFFE2E8F0),
highlightColor: Color(0xFF50A398),
isdense: true, isdense: true,
inputFormatters: [ inputFormatters: [
UpperCaseTextFormatter(), // 👈 custom formatter for uppercase UpperCaseTextFormatter(), // 👈 custom formatter for uppercase
FilteringTextInputFormatter.allow(RegExp(r'[A-Za-z0-9- ]')), 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, widthNone: true,
), ),
), ),
@ -735,7 +766,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text('Assigned To', style: _subLabelTimeStyle), Text('Assigned To *', style: _subLabelTimeStyle),
SizedBox(height: 5), SizedBox(height: 5),
SizedBox( SizedBox(
@ -746,8 +777,18 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
// selectedItem: selectedVehicle.isNotEmpty ? selectedVehicle : null, // selectedItem: selectedVehicle.isNotEmpty ? selectedVehicle : null,
selectedItem: selectedVehicle, selectedItem: selectedVehicle,
items: (filter, infiniteScrollProps) { // items: (filter, infiniteScrollProps) {
// return filteredStaffDataEnqAsgn;
// },
items: (filter, infiniteScrollProps) async {
if (filter.isEmpty) {
return filteredStaffDataEnqAsgn; return filteredStaffDataEnqAsgn;
}
return filteredStaffDataEnqAsgn.where((item) {
return item['name'].toString().toLowerCase().contains(
filter.toLowerCase(),
);
}).toList();
}, },
itemAsString: (val) => val['name'].toString(), itemAsString: (val) => val['name'].toString(),
@ -821,6 +862,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
), ),
showSearchBox: true, showSearchBox: true,
searchFieldProps: TextFieldProps( searchFieldProps: TextFieldProps(
autofocus: true,
decoration: InputDecoration( decoration: InputDecoration(
filled: true, filled: true,
fillColor: Colors.white, fillColor: Colors.white,
@ -926,8 +968,9 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
} }
final _subLabelTimeStyle = GoogleFonts.inter( final _subLabelTimeStyle = GoogleFonts.inter(
fontSize: 11, fontSize: 11.5,
fontWeight: FontWeight.w500, 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 selectedVehicleType;
dynamic selectedBrokerName; dynamic selectedBrokerName;
dynamic selectedAgentName;
dynamic selectedInsurer;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -99,6 +102,8 @@ class TabEnquiryStaffListState extends ConsumerState<TabEnquiryStaffList> {
selectedVehicleNum = data['enquiry']?['reg_no']; selectedVehicleNum = data['enquiry']?['reg_no'];
selectedVehicleType = data['enquiry']?['vehicle_type']; selectedVehicleType = data['enquiry']?['vehicle_type'];
selectedBrokerName = data['enquiry']?['broker_name']; selectedBrokerName = data['enquiry']?['broker_name'];
selectedAgentName = data['enquiry']?['agent_name'];
selectedInsurer = data['enquiry']?['insurer_short_name'];
print( print(
'loadQuotationTab 4s -$selectedBrokerName $selectedInsuredName - $selectedVehicleNum - $selectedVehicleType', 'loadQuotationTab 4s -$selectedBrokerName $selectedInsuredName - $selectedVehicleNum - $selectedVehicleType',
); );
@ -229,6 +234,8 @@ class TabEnquiryStaffListState extends ConsumerState<TabEnquiryStaffList> {
children: [ children: [
insured_name(context), insured_name(context),
vehcile_num(context), vehcile_num(context),
AgentName(context),
Insurer(context),
// vehcile_Type(context), // vehcile_Type(context),
// broker(context), // broker(context),
SizedBox.shrink(), SizedBox.shrink(),
@ -243,32 +250,51 @@ class TabEnquiryStaffListState extends ConsumerState<TabEnquiryStaffList> {
Row( Row(
children: List.generate(tabs.length, (index) { children: List.generate(tabs.length, (index) {
final isSelected = selectedIndex == index; final isSelected = selectedIndex == index;
return Padding( return Padding(
padding: const EdgeInsets.only(left: 10.0), padding: const EdgeInsets.symmetric(horizontal: 1.0),
child: ElevatedButton( child: InkWell(
style: ElevatedButton.styleFrom( onTap: () => setState(() => selectedIndex = index),
elevation: 2, child: Column(
backgroundColor: isSelected mainAxisSize: MainAxisSize.min,
? const Color(0xFF425B5B) children: [
: const Color(0xFFEDFFFC), // ---- TEXT ----
foregroundColor: isSelected ? Colors.white : Colors.black87, Text(
shape: RoundedRectangleBorder( tabs[index].title,
borderRadius: BorderRadius.circular(6), style: TextStyle(
), fontSize: 12,
padding: const EdgeInsets.symmetric( fontWeight: isSelected
horizontal: 24, ? FontWeight.w600
vertical: 12, : FontWeight.w400,
color: isSelected
? const Color(
0xFF2E7D6E,
) // Purple-ish like screenshot
: Colors.black87,
), ),
), ),
onPressed: () {
setState(() => selectedIndex = index); const SizedBox(height: 6),
},
child: Text(tabs[index].title), // ---- 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),
),
),
],
),
), ),
); );
}), }),
), ),
SizedBox(height: 10),
Expanded(child: tabs[selectedIndex].widget), 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) { Widget vehcile_Type(BuildContext context) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

View File

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

View File

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