Broker Include
This commit is contained in:
parent
6d7e6f24b9
commit
0b0a30f9d6
File diff suppressed because one or more lines are too long
@ -5,7 +5,7 @@ import 'package:nhance_partner/core/routing/routes.dart';
|
|||||||
import 'package:nhance_partner/presentation/screens/Enquiry/enquiryList.dart';
|
import 'package:nhance_partner/presentation/screens/Enquiry/enquiryList.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/Masters/PaymentMode/paymentList.dart';
|
import 'package:nhance_partner/presentation/screens/Masters/PaymentMode/paymentList.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/UserManagement/Profile/profile_web.dart';
|
import 'package:nhance_partner/presentation/screens/UserManagement/Profile/profile_web.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/dashboard/dashboard.dart';
|
import 'package:nhance_partner/presentation/screens/dashboard/dashboard_nw.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/payout/invoice_list.dart';
|
import 'package:nhance_partner/presentation/screens/payout/invoice_list.dart';
|
||||||
|
|
||||||
import '../../data/services/auth_service.dart';
|
import '../../data/services/auth_service.dart';
|
||||||
@ -21,6 +21,7 @@ import '../../presentation/screens/UserManagement/Agent/agentList.dart';
|
|||||||
import '../../presentation/screens/UserManagement/Profile/profile_mobile.dart';
|
import '../../presentation/screens/UserManagement/Profile/profile_mobile.dart';
|
||||||
import '../../presentation/screens/UserManagement/Staff/staff.dart';
|
import '../../presentation/screens/UserManagement/Staff/staff.dart';
|
||||||
import '../../presentation/screens/UserManagement/Staff/staffList.dart';
|
import '../../presentation/screens/UserManagement/Staff/staffList.dart';
|
||||||
|
import '../../presentation/screens/dashboard/dashboard.dart';
|
||||||
import '../../presentation/screens/handler/enquiryList.dart';
|
import '../../presentation/screens/handler/enquiryList.dart';
|
||||||
import '../../presentation/screens/handler/enquiryListOld.dart';
|
import '../../presentation/screens/handler/enquiryListOld.dart';
|
||||||
import '../../presentation/screens/home/home_screen.dart';
|
import '../../presentation/screens/home/home_screen.dart';
|
||||||
@ -53,7 +54,8 @@ final GoRouter appRouter = GoRouter(
|
|||||||
// ),
|
// ),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: AppRoutes.dashboard,
|
path: AppRoutes.dashboard,
|
||||||
builder: (context, state) => const DashboardScreen(),
|
// builder: (context, state) => const DashboardScreen(),
|
||||||
|
builder: (context, state) => const Dashboard(),
|
||||||
),
|
),
|
||||||
|
|
||||||
GoRoute(
|
GoRoute(
|
||||||
|
|||||||
@ -820,6 +820,28 @@ class ApiService {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<Map<String, dynamic>> deleteEnquiy(id, val) async {
|
||||||
|
final url = Uri.parse(
|
||||||
|
'${Env.apiUrl}/enquiry/updateEnquiryStatus?enquiry_id=$id&is_active=$val',
|
||||||
|
);
|
||||||
|
|
||||||
|
// final token = await getToken(); // Fetch token
|
||||||
|
|
||||||
|
if (_token == null) {
|
||||||
|
throw Exception('Token not found. Please log in.');
|
||||||
|
}
|
||||||
|
|
||||||
|
final headers = {
|
||||||
|
'Authorization': 'Bearer $_token',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'app-signature': Env.App_Signature,
|
||||||
|
// 'app-signature': 'nhance-partner-2025-signature-35468846JRhH551HK',
|
||||||
|
};
|
||||||
|
|
||||||
|
// final response = await _makePostRequestJson(url, data, headers);
|
||||||
|
final response = await _makeGetRequest(url, headers);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
//------------------------------------ Quotation ------------------------------------------------
|
//------------------------------------ Quotation ------------------------------------------------
|
||||||
|
|
||||||
Future<Map<String, dynamic>> fetchQuickQuotationList(int managerId) async {
|
Future<Map<String, dynamic>> fetchQuickQuotationList(int managerId) async {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import 'package:firebase_app_check/firebase_app_check.dart';
|
// import 'package:firebase_app_check/firebase_app_check.dart';
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@ -62,12 +62,12 @@ Future<void> main() async {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await Firebase.initializeApp();
|
// await Firebase.initializeApp();
|
||||||
await FirebaseAppCheck.instance.activate(
|
// await FirebaseAppCheck.instance.activate(
|
||||||
// webProvider: ReCaptchaV3Provider('recaptcha-v3-site-key'),
|
// // webProvider: ReCaptchaV3Provider('recaptcha-v3-site-key'),
|
||||||
androidProvider: AndroidProvider.playIntegrity,
|
// androidProvider: AndroidProvider.playIntegrity,
|
||||||
appleProvider: AppleProvider.appAttest,
|
// appleProvider: AppleProvider.appAttest,
|
||||||
);
|
// );
|
||||||
// FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
|
// FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
|
||||||
|
|
||||||
// FirebaseMessaging messaging = FirebaseMessaging.instance;
|
// FirebaseMessaging messaging = FirebaseMessaging.instance;
|
||||||
|
|||||||
@ -600,19 +600,20 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
data: staffQuotationsPendingList,
|
data: staffQuotationsPendingList,
|
||||||
stringFlag: "Proposal",
|
stringFlag: "Proposal",
|
||||||
role: role!,
|
role: role!,
|
||||||
|
onRefresh: refresh,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (role == 'handler') ...[
|
// if (role == 'handler') ...[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: UnassignedEnq(
|
child: UnassignedEnq(
|
||||||
key: UniqueKey(),
|
key: UniqueKey(),
|
||||||
title: "Unassigned Enquiries",
|
title: "Unassigned Enquiries",
|
||||||
role: role,
|
role: role!,
|
||||||
data: unAssignedEnqList,
|
data: unAssignedEnqList,
|
||||||
onRefresh: refresh,
|
onRefresh: refresh,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
// ],
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Row(
|
: Row(
|
||||||
@ -737,50 +738,40 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
|
||||||
|
|
||||||
// Container(
|
// const SizedBox(height: 5),
|
||||||
// child: DynamicHorizontalBarChart(
|
// if (role == 'manager')
|
||||||
// data: [
|
// SizedBox(
|
||||||
// {"label": "Jan", "value": 30},
|
// // ✅ replace Expanded
|
||||||
// {"label": "Feb", "value": 45},
|
// height: 350, // adjust height as needed
|
||||||
// {"label": "Mar", "value": 20},
|
// child: Row(
|
||||||
|
// children: [
|
||||||
|
// Expanded(
|
||||||
|
// child: UnassignedEnq(
|
||||||
|
// key: UniqueKey(),
|
||||||
|
// title: "Unassigned Enquiries",
|
||||||
|
// role: role!,
|
||||||
|
// data: unAssignedEnqList,
|
||||||
|
// onRefresh: refresh,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// SizedBox(width: 16),
|
||||||
|
// Expanded(
|
||||||
|
// child: Performance(
|
||||||
|
// title: "Performing Partner",
|
||||||
|
// data: agentsPerformanceList,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// SizedBox(width: 16),
|
||||||
|
// Expanded(
|
||||||
|
// child: Performance(
|
||||||
|
// title: "Non-Performing Partner",
|
||||||
|
// data: nonAgentsPerformanceList,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
// ],
|
// ],
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
const SizedBox(height: 5),
|
|
||||||
if (role == 'manager')
|
|
||||||
SizedBox(
|
|
||||||
// ✅ replace Expanded
|
|
||||||
height: 350, // adjust height as needed
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: UnassignedEnq(
|
|
||||||
key: UniqueKey(),
|
|
||||||
title: "Unassigned Enquiries",
|
|
||||||
role: role!,
|
|
||||||
data: unAssignedEnqList,
|
|
||||||
onRefresh: refresh,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 16),
|
|
||||||
Expanded(
|
|
||||||
child: Performance(
|
|
||||||
title: "Performing Partner",
|
|
||||||
data: agentsPerformanceList,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 16),
|
|
||||||
Expanded(
|
|
||||||
child: Performance(
|
|
||||||
title: "Non-Performing Partner",
|
|
||||||
data: nonAgentsPerformanceList,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1210,6 +1201,7 @@ class othersPendings extends StatelessWidget {
|
|||||||
final String stringFlag;
|
final String stringFlag;
|
||||||
String role;
|
String role;
|
||||||
final List<Map<String, dynamic>> data;
|
final List<Map<String, dynamic>> data;
|
||||||
|
final VoidCallback? onRefresh;
|
||||||
|
|
||||||
othersPendings({
|
othersPendings({
|
||||||
Key? key,
|
Key? key,
|
||||||
@ -1217,6 +1209,7 @@ class othersPendings extends StatelessWidget {
|
|||||||
required this.role,
|
required this.role,
|
||||||
required this.data,
|
required this.data,
|
||||||
required this.stringFlag,
|
required this.stringFlag,
|
||||||
|
required this.onRefresh,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -1228,12 +1221,33 @@ class othersPendings extends StatelessWidget {
|
|||||||
int totalPending = 0;
|
int totalPending = 0;
|
||||||
int totalInProgress = 0;
|
int totalInProgress = 0;
|
||||||
int totalCompleted = 0;
|
int totalCompleted = 0;
|
||||||
|
int totalPrevPending = 0;
|
||||||
|
int totalPendingAll = 0;
|
||||||
|
|
||||||
for (var row in data) {
|
for (var row in data) {
|
||||||
totalTodayAssigned += int.tryParse(row['today_assigned'] ?? '0') ?? 0;
|
totalTodayAssigned += int.tryParse(row['today_assigned'] ?? '0') ?? 0;
|
||||||
totalPending += int.tryParse(row['pending_assigned'] ?? '0') ?? 0;
|
totalPending += int.tryParse(row['today_pending'] ?? '0') ?? 0;
|
||||||
totalInProgress += int.tryParse(row['total_in_progress'] ?? '0') ?? 0;
|
totalInProgress += int.tryParse(row['today_in_progress'] ?? '0') ?? 0;
|
||||||
totalCompleted += int.tryParse(row['total_completed'] ?? '0') ?? 0;
|
totalCompleted += int.tryParse(row['today_completed'] ?? '0') ?? 0;
|
||||||
|
totalPrevPending += int.tryParse(row['total_completed'] ?? '0') ?? 0;
|
||||||
|
|
||||||
|
int totalPendingdata =
|
||||||
|
int.tryParse(row['total_pending']?.toString() ?? '0') ?? 0;
|
||||||
|
int todayAssigned =
|
||||||
|
int.tryParse(row['today_assigned']?.toString() ?? '0') ?? 0;
|
||||||
|
|
||||||
|
// totalTodayAssigned += todayAssigned;
|
||||||
|
totalPendingAll += totalPendingdata;
|
||||||
|
|
||||||
|
int staffPending = totalPendingdata - todayAssigned;
|
||||||
|
|
||||||
|
// totalPrevPending += staffPending;
|
||||||
|
|
||||||
|
final rowPrevPending =
|
||||||
|
(int.tryParse(row['total_pending'] ?? '0') ?? 0) -
|
||||||
|
(int.tryParse(row['today_assigned'] ?? '0') ?? 0);
|
||||||
|
|
||||||
|
totalPrevPending += rowPrevPending < 0 ? 0 : rowPrevPending;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
@ -1247,7 +1261,19 @@ class othersPendings extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Title
|
// Title
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
Text(title, style: _title),
|
Text(title, style: _title),
|
||||||
|
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
onRefresh!();
|
||||||
|
},
|
||||||
|
child: Icon(Icons.refresh, size: 18),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
|
|
||||||
// Header row
|
// Header row
|
||||||
@ -1345,6 +1371,14 @@ class othersPendings extends StatelessWidget {
|
|||||||
style: _headerStyle,
|
style: _headerStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
'Prev Pending',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
// Expanded(
|
// Expanded(
|
||||||
// flex: 2,
|
// flex: 2,
|
||||||
// child: Text(
|
// child: Text(
|
||||||
@ -1366,6 +1400,18 @@ class othersPendings extends StatelessWidget {
|
|||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final row = data[index];
|
final row = data[index];
|
||||||
|
|
||||||
|
final totalPending =
|
||||||
|
int.tryParse(row['total_pending']?.toString() ?? '0') ??
|
||||||
|
0;
|
||||||
|
final todayAssigned =
|
||||||
|
int.tryParse(row['today_assigned']?.toString() ?? '0') ??
|
||||||
|
0;
|
||||||
|
|
||||||
|
final staffPending = (totalPending - todayAssigned);
|
||||||
|
final safePending = staffPending < 0 ? 0 : staffPending;
|
||||||
|
|
||||||
|
// final staffPending = totalPending - todayAssigned;
|
||||||
|
|
||||||
final issuedCount = stringFlag == "Policies"
|
final issuedCount = stringFlag == "Policies"
|
||||||
? (row['total_policis_pending'] ?? 0).toString()
|
? (row['total_policis_pending'] ?? 0).toString()
|
||||||
: (row['total_quotation_pending'] ?? 0).toString();
|
: (row['total_quotation_pending'] ?? 0).toString();
|
||||||
@ -1396,8 +1442,8 @@ class othersPendings extends StatelessWidget {
|
|||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
row['staff_name'] ?? "",
|
row['staff_name'] ?? "",
|
||||||
|
textAlign: TextAlign.left,
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1416,7 +1462,8 @@ class othersPendings extends StatelessWidget {
|
|||||||
|
|
||||||
handleDashboardNavigation(
|
handleDashboardNavigation(
|
||||||
context,
|
context,
|
||||||
status: "Assigned",
|
status: '',
|
||||||
|
// status: "Assigned",
|
||||||
staffId: row['staff_id'] ?? '',
|
staffId: row['staff_id'] ?? '',
|
||||||
role: role,
|
role: role,
|
||||||
);
|
);
|
||||||
@ -1451,7 +1498,7 @@ class othersPendings extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
row['pending_assigned'] ?? "",
|
row['today_pending'] ?? "",
|
||||||
// row['total_approval_pending'] ?? "",
|
// row['total_approval_pending'] ?? "",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
@ -1481,7 +1528,7 @@ class othersPendings extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
|
|
||||||
child: Text(
|
child: Text(
|
||||||
row['total_in_progress'] ?? "",
|
row['today_in_progress'] ?? "",
|
||||||
// row['total_approval_pending'] ?? "",
|
// row['total_approval_pending'] ?? "",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
@ -1509,7 +1556,35 @@ class othersPendings extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
row['total_completed'] ?? "",
|
row['today_completed'] ?? "",
|
||||||
|
// row['total_approval_pending'] ?? "",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _tableDataStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Material(
|
||||||
|
color: Colors.white,
|
||||||
|
child: Center(
|
||||||
|
child: InkWell(
|
||||||
|
hoverColor: Color(0xFFEAF6F4),
|
||||||
|
onTap: () async {
|
||||||
|
print(
|
||||||
|
'Awaiting Approval : ${row['total_completed']} - ${row['staff_id']}',
|
||||||
|
);
|
||||||
|
handleDashboardNavigation(
|
||||||
|
context,
|
||||||
|
status: 'PrevPending',
|
||||||
|
staffId: row['staff_id'] ?? '',
|
||||||
|
role: role,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
safePending.toString() ?? "",
|
||||||
// row['total_approval_pending'] ?? "",
|
// row['total_approval_pending'] ?? "",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
@ -1585,6 +1660,14 @@ class othersPendings extends StatelessWidget {
|
|||||||
style: _headerStyle,
|
style: _headerStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
totalPrevPending.toString(),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
146
lib/presentation/screens/dashboard/dashboard_nw.dart
Normal file
146
lib/presentation/screens/dashboard/dashboard_nw.dart
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
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:intl/intl.dart';
|
||||||
|
import 'package:nhance_partner/presentation/screens/dashboard/tabs/bussiness.dart';
|
||||||
|
import 'package:nhance_partner/presentation/screens/dashboard/tabs/chart.dart';
|
||||||
|
import 'package:nhance_partner/presentation/screens/dashboard/tabs/live.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import '../../../core/responsive/responsive_builder.dart';
|
||||||
|
import '../../../core/routing/routes.dart';
|
||||||
|
import '../../../core/services/api_service.dart';
|
||||||
|
import '../../layouts/main_layout.dart';
|
||||||
|
import '../../providers/manager_provider.dart';
|
||||||
|
import '../../providers/quotation_staff_proivder.dart';
|
||||||
|
import '../../providers/userRoleProvider.dart';
|
||||||
|
import '../../themes/charts/barChart.dart';
|
||||||
|
import '../staff/Enquiry/tabs/tab.dart';
|
||||||
|
import '../staff/assignStaff.dart';
|
||||||
|
|
||||||
|
final enquiriesProvider = Provider<List<Map<String, String>>>((ref) {
|
||||||
|
return List.generate(5, (i) {
|
||||||
|
return {
|
||||||
|
"reg": "rrTN64V4387",
|
||||||
|
"Insurer": "rrNew India",
|
||||||
|
"date": "rr09/09/2025",
|
||||||
|
"time": "rr11:30 AM",
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
class Dashboard extends ConsumerStatefulWidget {
|
||||||
|
const Dashboard({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
ConsumerState<Dashboard> createState() => _DashboardState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DashboardState extends ConsumerState<Dashboard>
|
||||||
|
with SingleTickerProviderStateMixin {
|
||||||
|
late TabController _tabController;
|
||||||
|
|
||||||
|
// Dynamic items (4 values)
|
||||||
|
final List<String> tabs = ["Live", "Business", "Partner", "Productivity"];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_tabController = TabController(length: tabs.length, vsync: this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_tabController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
final List<Color> tabColors = [
|
||||||
|
Colors.amber.shade100, // Live
|
||||||
|
// Color(0XFFF1556C), // Business
|
||||||
|
// Color(0XFF02A8B5), // Business
|
||||||
|
Colors.blue.shade100, // Business
|
||||||
|
Colors.orange.shade100, // Partner
|
||||||
|
Colors.green.shade100, // Productivity
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MainLayout(
|
||||||
|
title: "Dashboard",
|
||||||
|
|
||||||
|
body: SafeArea(
|
||||||
|
child: Container(
|
||||||
|
// color: Colors.amber.shade100,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
// TabBar(
|
||||||
|
// padding: EdgeInsets.zero,
|
||||||
|
// controller: _tabController,
|
||||||
|
// isScrollable: false,
|
||||||
|
// indicatorColor: Colors.teal,
|
||||||
|
// labelColor: Colors.teal,
|
||||||
|
// unselectedLabelColor: Colors.grey,
|
||||||
|
// tabs: tabs.map((e) => Tab(text: e)).toList(),
|
||||||
|
// ),
|
||||||
|
Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: List.generate(tabs.length, (index) {
|
||||||
|
final isSelected = _tabController.index == index;
|
||||||
|
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
_tabController.animateTo(index);
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 2,
|
||||||
|
horizontal: 10,
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.only(left: 10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: isSelected ? Colors.teal : tabColors[index],
|
||||||
|
color: tabColors[index],
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
|
||||||
|
border: Border.all(
|
||||||
|
color: isSelected ? Colors.teal : tabColors[index],
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
tabs[index],
|
||||||
|
style: TextStyle(
|
||||||
|
// color: isSelected ? Colors.white : Colors.black87,
|
||||||
|
color: Colors.black87,
|
||||||
|
fontSize: 11,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
|
||||||
|
Expanded(
|
||||||
|
child: TabBarView(
|
||||||
|
controller: _tabController,
|
||||||
|
children: [
|
||||||
|
// Text('A'),
|
||||||
|
LiveDashboard(),
|
||||||
|
BussinessDashboard(),
|
||||||
|
// BarChartSample7(),
|
||||||
|
// ReportsPage(),
|
||||||
|
// UsersPage(),
|
||||||
|
// SettingsPage(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,6 +11,7 @@ import '../../layouts/main_layout.dart';
|
|||||||
import '../../providers/manager_provider.dart';
|
import '../../providers/manager_provider.dart';
|
||||||
import '../../providers/quotation_staff_proivder.dart';
|
import '../../providers/quotation_staff_proivder.dart';
|
||||||
import '../../providers/userRoleProvider.dart';
|
import '../../providers/userRoleProvider.dart';
|
||||||
|
import '../../themes/charts/barChart.dart';
|
||||||
import '../staff/Enquiry/tabs/tab.dart';
|
import '../staff/Enquiry/tabs/tab.dart';
|
||||||
import '../staff/assignStaff.dart';
|
import '../staff/assignStaff.dart';
|
||||||
|
|
||||||
@ -584,7 +585,7 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
? MediaQuery.of(context).size.height *
|
? MediaQuery.of(context).size.height *
|
||||||
0.69 //400
|
0.69 //400
|
||||||
: (role == 'manager')
|
: (role == 'manager')
|
||||||
? MediaQuery.of(context).size.height * 0.5
|
? MediaQuery.of(context).size.height * 0.85
|
||||||
: (role == 'staff' || role == 'handler')
|
: (role == 'staff' || role == 'handler')
|
||||||
? MediaQuery.of(context).size.height * 0.85
|
? MediaQuery.of(context).size.height * 0.85
|
||||||
: MediaQuery.of(context).size.height *
|
: MediaQuery.of(context).size.height *
|
||||||
@ -599,19 +600,20 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
data: staffQuotationsPendingList,
|
data: staffQuotationsPendingList,
|
||||||
stringFlag: "Proposal",
|
stringFlag: "Proposal",
|
||||||
role: role!,
|
role: role!,
|
||||||
|
onRefresh: refresh,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (role == 'handler') ...[
|
// if (role == 'handler') ...[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: UnassignedEnq(
|
child: UnassignedEnq(
|
||||||
key: UniqueKey(),
|
key: UniqueKey(),
|
||||||
title: "Unassigned Enquiries",
|
title: "Unassigned Enquiries",
|
||||||
role: role,
|
role: role!,
|
||||||
data: unAssignedEnqList,
|
data: unAssignedEnqList,
|
||||||
onRefresh: refresh,
|
onRefresh: refresh,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
// ],
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Row(
|
: Row(
|
||||||
@ -736,39 +738,40 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
|
||||||
if (role == 'manager')
|
// const SizedBox(height: 5),
|
||||||
SizedBox(
|
// if (role == 'manager')
|
||||||
// ✅ replace Expanded
|
// SizedBox(
|
||||||
height: 350, // adjust height as needed
|
// // ✅ replace Expanded
|
||||||
child: Row(
|
// height: 350, // adjust height as needed
|
||||||
children: [
|
// child: Row(
|
||||||
Expanded(
|
// children: [
|
||||||
child: UnassignedEnq(
|
// Expanded(
|
||||||
key: UniqueKey(),
|
// child: UnassignedEnq(
|
||||||
title: "Unassigned Enquiries",
|
// key: UniqueKey(),
|
||||||
role: role!,
|
// title: "Unassigned Enquiries",
|
||||||
data: unAssignedEnqList,
|
// role: role!,
|
||||||
onRefresh: refresh,
|
// data: unAssignedEnqList,
|
||||||
),
|
// onRefresh: refresh,
|
||||||
),
|
// ),
|
||||||
SizedBox(width: 16),
|
// ),
|
||||||
Expanded(
|
// SizedBox(width: 16),
|
||||||
child: Performance(
|
// Expanded(
|
||||||
title: "Performing Partner",
|
// child: Performance(
|
||||||
data: agentsPerformanceList,
|
// title: "Performing Partner",
|
||||||
),
|
// data: agentsPerformanceList,
|
||||||
),
|
// ),
|
||||||
SizedBox(width: 16),
|
// ),
|
||||||
Expanded(
|
// SizedBox(width: 16),
|
||||||
child: Performance(
|
// Expanded(
|
||||||
title: "Non-Performing Partner",
|
// child: Performance(
|
||||||
data: nonAgentsPerformanceList,
|
// title: "Non-Performing Partner",
|
||||||
),
|
// data: nonAgentsPerformanceList,
|
||||||
),
|
// ),
|
||||||
],
|
// ),
|
||||||
),
|
// ],
|
||||||
),
|
// ),
|
||||||
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1198,6 +1201,7 @@ class othersPendings extends StatelessWidget {
|
|||||||
final String stringFlag;
|
final String stringFlag;
|
||||||
String role;
|
String role;
|
||||||
final List<Map<String, dynamic>> data;
|
final List<Map<String, dynamic>> data;
|
||||||
|
final VoidCallback? onRefresh;
|
||||||
|
|
||||||
othersPendings({
|
othersPendings({
|
||||||
Key? key,
|
Key? key,
|
||||||
@ -1205,12 +1209,47 @@ class othersPendings extends StatelessWidget {
|
|||||||
required this.role,
|
required this.role,
|
||||||
required this.data,
|
required this.data,
|
||||||
required this.stringFlag,
|
required this.stringFlag,
|
||||||
|
required this.onRefresh,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
print(' Data: $data');
|
print(' Data: $data');
|
||||||
|
|
||||||
|
// Compute totals
|
||||||
|
int totalTodayAssigned = 0;
|
||||||
|
int totalPending = 0;
|
||||||
|
int totalInProgress = 0;
|
||||||
|
int totalCompleted = 0;
|
||||||
|
int totalPrevPending = 0;
|
||||||
|
int totalPendingAll = 0;
|
||||||
|
|
||||||
|
for (var row in data) {
|
||||||
|
totalTodayAssigned += int.tryParse(row['today_assigned'] ?? '0') ?? 0;
|
||||||
|
totalPending += int.tryParse(row['today_pending'] ?? '0') ?? 0;
|
||||||
|
totalInProgress += int.tryParse(row['today_in_progress'] ?? '0') ?? 0;
|
||||||
|
totalCompleted += int.tryParse(row['today_completed'] ?? '0') ?? 0;
|
||||||
|
totalPrevPending += int.tryParse(row['total_completed'] ?? '0') ?? 0;
|
||||||
|
|
||||||
|
int totalPendingdata =
|
||||||
|
int.tryParse(row['total_pending']?.toString() ?? '0') ?? 0;
|
||||||
|
int todayAssigned =
|
||||||
|
int.tryParse(row['today_assigned']?.toString() ?? '0') ?? 0;
|
||||||
|
|
||||||
|
totalTodayAssigned += todayAssigned;
|
||||||
|
totalPendingAll += totalPendingdata;
|
||||||
|
|
||||||
|
int staffPending = totalPendingdata - todayAssigned;
|
||||||
|
|
||||||
|
// totalPrevPending += staffPending;
|
||||||
|
|
||||||
|
final rowPrevPending =
|
||||||
|
(int.tryParse(row['total_pending'] ?? '0') ?? 0) -
|
||||||
|
(int.tryParse(row['today_assigned'] ?? '0') ?? 0);
|
||||||
|
|
||||||
|
totalPrevPending += rowPrevPending < 0 ? 0 : rowPrevPending;
|
||||||
|
}
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
// color: const Color(0xFFEAF6F4),
|
// color: const Color(0xFFEAF6F4),
|
||||||
@ -1222,7 +1261,19 @@ class othersPendings extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Title
|
// Title
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
Text(title, style: _title),
|
Text(title, style: _title),
|
||||||
|
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
onRefresh!();
|
||||||
|
},
|
||||||
|
child: Icon(Icons.refresh, size: 18),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
|
|
||||||
// Header row
|
// Header row
|
||||||
@ -1320,6 +1371,14 @@ class othersPendings extends StatelessWidget {
|
|||||||
style: _headerStyle,
|
style: _headerStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
'Prev Pending',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
// Expanded(
|
// Expanded(
|
||||||
// flex: 2,
|
// flex: 2,
|
||||||
// child: Text(
|
// child: Text(
|
||||||
@ -1341,6 +1400,18 @@ class othersPendings extends StatelessWidget {
|
|||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final row = data[index];
|
final row = data[index];
|
||||||
|
|
||||||
|
final totalPending =
|
||||||
|
int.tryParse(row['total_pending']?.toString() ?? '0') ??
|
||||||
|
0;
|
||||||
|
final todayAssigned =
|
||||||
|
int.tryParse(row['today_assigned']?.toString() ?? '0') ??
|
||||||
|
0;
|
||||||
|
|
||||||
|
final staffPending = (totalPending - todayAssigned);
|
||||||
|
final safePending = staffPending < 0 ? 0 : staffPending;
|
||||||
|
|
||||||
|
// final staffPending = totalPending - todayAssigned;
|
||||||
|
|
||||||
final issuedCount = stringFlag == "Policies"
|
final issuedCount = stringFlag == "Policies"
|
||||||
? (row['total_policis_pending'] ?? 0).toString()
|
? (row['total_policis_pending'] ?? 0).toString()
|
||||||
: (row['total_quotation_pending'] ?? 0).toString();
|
: (row['total_quotation_pending'] ?? 0).toString();
|
||||||
@ -1350,9 +1421,9 @@ class othersPendings extends StatelessWidget {
|
|||||||
: row['total_premium_value'];
|
: row['total_premium_value'];
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.symmetric(vertical: 5),
|
margin: const EdgeInsets.symmetric(vertical: 3),
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
vertical: 5,
|
vertical: 4,
|
||||||
horizontal: 12,
|
horizontal: 12,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -1367,25 +1438,6 @@ class othersPendings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
// Expanded(
|
|
||||||
// flex: 1,
|
|
||||||
// child: Text(
|
|
||||||
// (index + 1).toString(),
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// style: _tableDataStyle,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// if (role == 'manager') ...[
|
|
||||||
// Expanded(
|
|
||||||
// flex: 2,
|
|
||||||
// child: Text(
|
|
||||||
// row['handler_name'] ?? "",
|
|
||||||
//
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// style: _tableDataStyle,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -1396,44 +1448,6 @@ class othersPendings extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Expanded(
|
|
||||||
// flex: 2,
|
|
||||||
// child: Text(
|
|
||||||
// row['total_assigned'] ?? "",
|
|
||||||
// // row['total_approval_pending'] ?? "",
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// style: _tableDataStyle,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Expanded(
|
|
||||||
// flex: 2,
|
|
||||||
// child: Material(
|
|
||||||
// color: Colors.white,
|
|
||||||
// child: Center(
|
|
||||||
// child: InkWell(
|
|
||||||
// hoverColor: Color(0xFFEAF6F4),
|
|
||||||
// onTap: () {
|
|
||||||
// print(
|
|
||||||
// 'total_assigned : ${row['total_assigned']}',
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// handleDashboardNavigation(
|
|
||||||
// context,
|
|
||||||
// status: "Assigned",
|
|
||||||
// staffId: row['staff_id'] ?? '',
|
|
||||||
// role: role,
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// child: Text(
|
|
||||||
// row['total_assigned'] ?? "",
|
|
||||||
// // row['total_approval_pending'] ?? "",
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// style: _tableDataStyle,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: Material(
|
child: Material(
|
||||||
@ -1483,7 +1497,7 @@ class othersPendings extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
row['pending_assigned'] ?? "",
|
row['today_pending'] ?? "",
|
||||||
// row['total_approval_pending'] ?? "",
|
// row['total_approval_pending'] ?? "",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
@ -1513,7 +1527,7 @@ class othersPendings extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
|
|
||||||
child: Text(
|
child: Text(
|
||||||
row['total_in_progress'] ?? "",
|
row['today_in_progress'] ?? "",
|
||||||
// row['total_approval_pending'] ?? "",
|
// row['total_approval_pending'] ?? "",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
@ -1541,7 +1555,35 @@ class othersPendings extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
row['total_completed'] ?? "",
|
row['today_completed'] ?? "",
|
||||||
|
// row['total_approval_pending'] ?? "",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _tableDataStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Material(
|
||||||
|
color: Colors.white,
|
||||||
|
child: Center(
|
||||||
|
child: InkWell(
|
||||||
|
hoverColor: Color(0xFFEAF6F4),
|
||||||
|
onTap: () async {
|
||||||
|
print(
|
||||||
|
'Awaiting Approval : ${row['total_completed']} - ${row['staff_id']}',
|
||||||
|
);
|
||||||
|
handleDashboardNavigation(
|
||||||
|
context,
|
||||||
|
status: 'PrevPending',
|
||||||
|
staffId: row['staff_id'] ?? '',
|
||||||
|
role: role,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
safePending.toString() ?? "",
|
||||||
// row['total_approval_pending'] ?? "",
|
// row['total_approval_pending'] ?? "",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
@ -1566,6 +1608,60 @@ class othersPendings extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
// Header row
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF1F5F9),
|
||||||
|
// color: Color(0xFFE3F9F8),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
"Total",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
totalTodayAssigned.toString(),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
totalPending.toString(),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
totalInProgress.toString(),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Text(
|
||||||
|
totalPrevPending.toString(),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: _headerStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
48
lib/presentation/screens/dashboard/tabs/bussiness.dart
Normal file
48
lib/presentation/screens/dashboard/tabs/bussiness.dart
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/src/widgets/framework.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
|
import '../../../themes/charts/barChart.dart';
|
||||||
|
|
||||||
|
class BussinessDashboard extends ConsumerStatefulWidget {
|
||||||
|
const BussinessDashboard({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
ConsumerState<BussinessDashboard> createState() => _BussinessDashboardState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BussinessDashboardState extends ConsumerState<BussinessDashboard> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.all(10),
|
||||||
|
// color: Colors.white,
|
||||||
|
// color: Colors.amber.shade100,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text('Product Wise', style: _headerStyle2),
|
||||||
|
// BarChart(
|
||||||
|
// dataList: [
|
||||||
|
// _BarData(Colors.blue, 10, 8),
|
||||||
|
// _BarData(Colors.orange, 12, 10),
|
||||||
|
// _BarData(Colors.green, 8, 5),
|
||||||
|
// ],
|
||||||
|
// labels: ["A", "B", "C"],
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final _headerStyle2 = GoogleFonts.poppins(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
);
|
||||||
242
lib/presentation/screens/dashboard/tabs/chart.dart
Normal file
242
lib/presentation/screens/dashboard/tabs/chart.dart
Normal file
@ -0,0 +1,242 @@
|
|||||||
|
import 'dart:math' as math;
|
||||||
|
|
||||||
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../themes/charts/appChartColors.dart';
|
||||||
|
|
||||||
|
class BarChartSample7 extends StatefulWidget {
|
||||||
|
BarChartSample7({super.key});
|
||||||
|
|
||||||
|
final shadowColor = const Color(0xFFCCCCCC);
|
||||||
|
final dataList = [
|
||||||
|
_BarData(AppColors.contentColorYellow, 18, 18),
|
||||||
|
_BarData(AppColors.contentColorGreen, 17, 8),
|
||||||
|
_BarData(AppColors.contentColorOrange, 10, 15),
|
||||||
|
_BarData(AppColors.contentColorPink, 2.5, 5),
|
||||||
|
_BarData(AppColors.contentColorBlue, 2, 2.5),
|
||||||
|
_BarData(AppColors.contentColorRed, 2, 2),
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<BarChartSample7> createState() => _BarChartSample7State();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BarChartSample7State extends State<BarChartSample7> {
|
||||||
|
BarChartGroupData generateBarGroup(
|
||||||
|
int x,
|
||||||
|
Color color,
|
||||||
|
double value,
|
||||||
|
double shadowValue,
|
||||||
|
) {
|
||||||
|
return BarChartGroupData(
|
||||||
|
x: x,
|
||||||
|
barRods: [
|
||||||
|
BarChartRodData(toY: value, color: color, width: 6),
|
||||||
|
BarChartRodData(toY: shadowValue, color: widget.shadowColor, width: 6),
|
||||||
|
],
|
||||||
|
showingTooltipIndicators: touchedGroupIndex == x ? [0] : [],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
int touchedGroupIndex = -1;
|
||||||
|
|
||||||
|
int rotationTurns = 1;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(24),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(child: Container()),
|
||||||
|
const Text(
|
||||||
|
'Horizontal Bar Chart',
|
||||||
|
style: TextStyle(color: AppColors.mainTextColor1, fontSize: 20),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: Tooltip(
|
||||||
|
message: 'Rotate the chart 90 degrees (cw)',
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
rotationTurns += 1;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: RotatedBox(
|
||||||
|
quarterTurns: rotationTurns - 1,
|
||||||
|
child: const Icon(Icons.rotate_90_degrees_cw),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 18),
|
||||||
|
AspectRatio(
|
||||||
|
aspectRatio: 1.4,
|
||||||
|
child: BarChart(
|
||||||
|
BarChartData(
|
||||||
|
alignment: BarChartAlignment.spaceBetween,
|
||||||
|
rotationQuarterTurns: rotationTurns,
|
||||||
|
borderData: FlBorderData(
|
||||||
|
show: true,
|
||||||
|
border: Border.symmetric(
|
||||||
|
horizontal: BorderSide(
|
||||||
|
color: AppColors.borderColor.withValues(alpha: 0.2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
titlesData: FlTitlesData(
|
||||||
|
show: true,
|
||||||
|
leftTitles: const AxisTitles(
|
||||||
|
drawBelowEverything: true,
|
||||||
|
sideTitles: SideTitles(showTitles: true, reservedSize: 30),
|
||||||
|
),
|
||||||
|
bottomTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
reservedSize: 50,
|
||||||
|
getTitlesWidget: (value, meta) {
|
||||||
|
final index = value.toInt();
|
||||||
|
return SideTitleWidget(
|
||||||
|
meta: meta,
|
||||||
|
child: Text('data'),
|
||||||
|
// child: _IconWidget(
|
||||||
|
// color: widget.dataList[index].color,
|
||||||
|
// isSelected: touchedGroupIndex == index,
|
||||||
|
// ),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// rightTitles: const AxisTitles(),
|
||||||
|
// topTitles: const AxisTitles(),
|
||||||
|
),
|
||||||
|
gridData: FlGridData(
|
||||||
|
show: true,
|
||||||
|
drawVerticalLine: false,
|
||||||
|
getDrawingHorizontalLine: (value) => FlLine(
|
||||||
|
color: AppColors.borderColor.withValues(alpha: 0.2),
|
||||||
|
strokeWidth: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
barGroups: widget.dataList.asMap().entries.map((e) {
|
||||||
|
final index = e.key;
|
||||||
|
final data = e.value;
|
||||||
|
return generateBarGroup(
|
||||||
|
index,
|
||||||
|
data.color,
|
||||||
|
data.value,
|
||||||
|
data.shadowValue,
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
maxY: 20,
|
||||||
|
barTouchData: BarTouchData(
|
||||||
|
enabled: true,
|
||||||
|
handleBuiltInTouches: false,
|
||||||
|
touchTooltipData: BarTouchTooltipData(
|
||||||
|
getTooltipColor: (group) => Colors.transparent,
|
||||||
|
tooltipMargin: 0,
|
||||||
|
getTooltipItem:
|
||||||
|
(
|
||||||
|
BarChartGroupData group,
|
||||||
|
int groupIndex,
|
||||||
|
BarChartRodData rod,
|
||||||
|
int rodIndex,
|
||||||
|
) {
|
||||||
|
return BarTooltipItem(
|
||||||
|
rod.toY.toString(),
|
||||||
|
TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: rod.color,
|
||||||
|
fontSize: 18,
|
||||||
|
shadows: const [
|
||||||
|
Shadow(color: Colors.black26, blurRadius: 12),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
touchCallback: (event, response) {
|
||||||
|
if (event.isInterestedForInteractions &&
|
||||||
|
response != null &&
|
||||||
|
response.spot != null) {
|
||||||
|
setState(() {
|
||||||
|
touchedGroupIndex = response.spot!.touchedBarGroupIndex;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
touchedGroupIndex = -1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BarData {
|
||||||
|
const _BarData(this.color, this.value, this.shadowValue);
|
||||||
|
|
||||||
|
final Color color;
|
||||||
|
final double value;
|
||||||
|
final double shadowValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
class _IconWidget extends ImplicitlyAnimatedWidget {
|
||||||
|
const _IconWidget({required this.color, required this.isSelected})
|
||||||
|
: super(duration: const Duration(milliseconds: 300));
|
||||||
|
final Color color;
|
||||||
|
final bool isSelected;
|
||||||
|
|
||||||
|
@override
|
||||||
|
ImplicitlyAnimatedWidgetState<ImplicitlyAnimatedWidget> createState() =>
|
||||||
|
_IconWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _IconWidgetState extends AnimatedWidgetBaseState<_IconWidget> {
|
||||||
|
Tween<double>? _rotationTween;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final rotation = math.pi * 4 * _rotationTween!.evaluate(animation);
|
||||||
|
final scale = 1 + _rotationTween!.evaluate(animation) * 0.5;
|
||||||
|
return Transform(
|
||||||
|
transform: Matrix4.identity()..scale(0.8),
|
||||||
|
// transform: Matrix4.rotationZ(rotation)..scaled(scale, scale, scale),
|
||||||
|
// transform: Matrix4.rotationZ(rotation)..scale(scale, scale, scale),
|
||||||
|
origin: const Offset(14, 14),
|
||||||
|
child: Icon(
|
||||||
|
widget.isSelected ? Icons.face_retouching_natural : Icons.face,
|
||||||
|
color: widget.color,
|
||||||
|
size: 28,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void forEachTween(TweenVisitor<dynamic> visitor) {
|
||||||
|
_rotationTween =
|
||||||
|
visitor(
|
||||||
|
_rotationTween,
|
||||||
|
widget.isSelected ? 1.0 : 0.0,
|
||||||
|
(dynamic value) => Tween<double>(
|
||||||
|
begin: value as double,
|
||||||
|
end: widget.isSelected ? 1.0 : 0.0,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
as Tween<double>?;
|
||||||
|
}
|
||||||
|
}
|
||||||
2261
lib/presentation/screens/dashboard/tabs/live.dart
Normal file
2261
lib/presentation/screens/dashboard/tabs/live.dart
Normal file
File diff suppressed because it is too large
Load Diff
@ -2413,6 +2413,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInlineTST> {
|
|||||||
print("Enquiry saved successfully");
|
print("Enquiry saved successfully");
|
||||||
// RESET FORM
|
// RESET FORM
|
||||||
raiseEnqKey.currentState?.resetFormFields();
|
raiseEnqKey.currentState?.resetFormFields();
|
||||||
|
getStaffDetailsForEnquiryAssignment(userId);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
@ -10,7 +10,7 @@ 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:google_fonts/google_fonts.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/dashboard/dashboard.dart';
|
import 'package:nhance_partner/presentation/screens/dashboard/dashboard_nw.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/staff/Enquiry/quotationPopUpAccptReject.dart';
|
import 'package:nhance_partner/presentation/screens/staff/Enquiry/quotationPopUpAccptReject.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/staff/Enquiry/raise_enq_form.dart';
|
import 'package:nhance_partner/presentation/screens/staff/Enquiry/raise_enq_form.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/staff/Enquiry/staff_policy.dart';
|
import 'package:nhance_partner/presentation/screens/staff/Enquiry/staff_policy.dart';
|
||||||
|
|||||||
@ -10,7 +10,7 @@ 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:google_fonts/google_fonts.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/dashboard/dashboard.dart';
|
import 'package:nhance_partner/presentation/screens/dashboard/dashboard_nw.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/staff/Enquiry/quotationPopUpAccptReject.dart';
|
import 'package:nhance_partner/presentation/screens/staff/Enquiry/quotationPopUpAccptReject.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/staff/Enquiry/raise_enq_form.dart';
|
import 'package:nhance_partner/presentation/screens/staff/Enquiry/raise_enq_form.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/staff/Enquiry/staff_policy.dart';
|
import 'package:nhance_partner/presentation/screens/staff/Enquiry/staff_policy.dart';
|
||||||
@ -96,6 +96,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
'remarks',
|
'remarks',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
String formRebuildKey = UniqueKey().toString();
|
||||||
|
|
||||||
Map<int, bool> isEditingRow = {};
|
Map<int, bool> isEditingRow = {};
|
||||||
Map<int, Map<String, TextEditingController>> rowControllers = {};
|
Map<int, Map<String, TextEditingController>> rowControllers = {};
|
||||||
|
|
||||||
@ -206,8 +208,9 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
String? selectedBroker;
|
String? selectedBroker;
|
||||||
|
|
||||||
final ScrollController _horizontalScrollController = ScrollController();
|
final ScrollController _horizontalScrollController = ScrollController();
|
||||||
late Timer timer;
|
// late Timer timer;
|
||||||
|
Timer? timer;
|
||||||
|
int selectedSeconds = 30;
|
||||||
bool isActionable = false;
|
bool isActionable = false;
|
||||||
|
|
||||||
//---------------------- Assign Staff Ends -------------------------------- //
|
//---------------------- Assign Staff Ends -------------------------------- //
|
||||||
@ -218,12 +221,14 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
apiService = ApiService();
|
apiService = ApiService();
|
||||||
timer = Timer.periodic(Duration(seconds: 10), (Timer t) => callRefresh());
|
// timer = Timer.periodic(Duration(seconds: 10), (Timer t) => callRefresh()); //static
|
||||||
|
|
||||||
|
startTimer();
|
||||||
for (String field in tabHeader) {
|
for (String field in tabHeader) {
|
||||||
controllers[field] = TextEditingController();
|
controllers[field] = TextEditingController();
|
||||||
}
|
}
|
||||||
_initializeToken();
|
_initializeToken();
|
||||||
|
loadPreferences();
|
||||||
Future.microtask(() async {
|
Future.microtask(() async {
|
||||||
// final id = ref.read(managerIdProvider);
|
// final id = ref.read(managerIdProvider);
|
||||||
roleId = ref.read(userRoleProvider);
|
roleId = ref.read(userRoleProvider);
|
||||||
@ -280,16 +285,53 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
getPaymentMode();
|
getPaymentMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> loadPreferences() async {
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
|
setState(() {
|
||||||
|
isActionable = prefs.getBool('isActionable') ?? false;
|
||||||
|
selectedSeconds = prefs.getInt('selectedSeconds') ?? 30;
|
||||||
|
|
||||||
|
_showFilterRow = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
startTimer(); // restart timer using stored value
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> resetPreferences() async {
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
|
await prefs.remove('isActionable');
|
||||||
|
await prefs.remove('selectedSeconds');
|
||||||
|
|
||||||
|
setState(() {
|
||||||
|
// isActionable = false; // default
|
||||||
|
selectedSeconds = 30; // default
|
||||||
|
});
|
||||||
|
|
||||||
|
startTimer(); // restart timer with default value
|
||||||
|
|
||||||
|
print("Storage cleared & reset completed");
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> _initializeToken() async {
|
Future<void> _initializeToken() async {
|
||||||
_token = await AuthService.getToken();
|
_token = await AuthService.getToken();
|
||||||
print("APISERTOKEN - $_token");
|
print("APISERTOKEN - $_token");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void startTimer() {
|
||||||
|
timer?.cancel(); // stop existing timer
|
||||||
|
|
||||||
|
timer = Timer.periodic(Duration(seconds: selectedSeconds), (Timer t) {
|
||||||
|
callRefresh();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void callRefresh() {
|
void callRefresh() {
|
||||||
print('Call Refresh');
|
print('Call Refresh');
|
||||||
if (!isActionable) {
|
if (!isActionable) {
|
||||||
print('Call Refresh isActionable');
|
print('Call Refresh isActionable');
|
||||||
refrshfilterDateRange();
|
autoRefrshfilterDateRange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,6 +363,26 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> autoRefrshfilterDateRange() async {
|
||||||
|
print('autorefrshfilterDateRange');
|
||||||
|
// setState(() async {
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
|
// _formKey.currentState?.reset();
|
||||||
|
|
||||||
|
final int parsedManagerId = int.tryParse(managerId.toString()) ?? 0;
|
||||||
|
print('autorefrshfilterDateRange 1');
|
||||||
|
getStaffList(
|
||||||
|
// managerId,
|
||||||
|
parsedManagerId,
|
||||||
|
roleId,
|
||||||
|
SelectedStatus: SelectedStatus ?? '',
|
||||||
|
SelectedStaffId: SelectedStaffId ?? '',
|
||||||
|
);
|
||||||
|
_searchStaffController.clear();
|
||||||
|
print('refrshfilterDateRange 2');
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> refrshfilterDateRange() async {
|
Future<void> refrshfilterDateRange() async {
|
||||||
print('refrshfilterDateRange');
|
print('refrshfilterDateRange');
|
||||||
// setState(() async {
|
// setState(() async {
|
||||||
@ -526,7 +588,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
String SelectedStatus = '',
|
String SelectedStatus = '',
|
||||||
String SelectedStaffId = '',
|
String SelectedStaffId = '',
|
||||||
}) async {
|
}) async {
|
||||||
print('A72 => Fns called => $managerId | $role');
|
print('DAJJshA72 => Fns called => $managerId | $role');
|
||||||
setState(() {
|
setState(() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
@ -538,13 +600,40 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
final toDateVal = controllers['endDate']?.text ?? '';
|
final toDateVal = controllers['endDate']?.text ?? '';
|
||||||
final dateFormat = DateFormat('dd-MM-yyyy');
|
final dateFormat = DateFormat('dd-MM-yyyy');
|
||||||
|
|
||||||
if (dashboardKey != 'fromDashboard' &&
|
if (dashboardKey == 'fromDashboard' && SelectedStatus == "PrevPending") {
|
||||||
|
// For PREV PENDING → set date range until yesterday
|
||||||
|
final today = DateTime.now();
|
||||||
|
|
||||||
|
// Change to dd-MM-yyyy
|
||||||
|
final dateFormat = DateFormat('dd-MM-yyyy');
|
||||||
|
|
||||||
|
final yesterday = today.subtract(Duration(days: 1));
|
||||||
|
|
||||||
|
fromDt = dateFormat.format(yesterday.subtract(Duration(days: 15)));
|
||||||
|
toDt = dateFormat.format(yesterday);
|
||||||
|
|
||||||
|
print('PrevPending FROM TO - $fromDt - $toDt');
|
||||||
|
} else if (dashboardKey == 'fromDashboard' &&
|
||||||
|
SelectedStatus != "PrevPending" &&
|
||||||
|
SelectedStatus != '') {
|
||||||
|
// For PREV PENDING → set date range until yesterday
|
||||||
|
final today = DateTime.now();
|
||||||
|
|
||||||
|
// Change to dd-MM-yyyy
|
||||||
|
final dateFormat = DateFormat('dd-MM-yyyy');
|
||||||
|
|
||||||
|
fromDt = dateFormat.format(today);
|
||||||
|
toDt = dateFormat.format(today);
|
||||||
|
|
||||||
|
print('PrevPending FROM TO - $fromDt - $toDt');
|
||||||
|
} else if (dashboardKey != 'fromDashboard' &&
|
||||||
fromDateVal == '' &&
|
fromDateVal == '' &&
|
||||||
toDateVal == '') {
|
toDateVal == '') {
|
||||||
print("ENQ LIST PAGE");
|
print("ENQ LIST PAGE");
|
||||||
|
|
||||||
final today = DateTime.now();
|
final today = DateTime.now();
|
||||||
fromDt = dateFormat.format(today.subtract(Duration(days: 15)));
|
fromDt = dateFormat.format(today.subtract(Duration(days: 15)));
|
||||||
|
// fromDt = dateFormat.format(today);
|
||||||
toDt = dateFormat.format(today);
|
toDt = dateFormat.format(today);
|
||||||
|
|
||||||
print('Enq FROM TO - $fromDt - $toDt');
|
print('Enq FROM TO - $fromDt - $toDt');
|
||||||
@ -560,7 +649,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
role,
|
role,
|
||||||
fromDate: fromDt,
|
fromDate: fromDt,
|
||||||
toDate: toDt,
|
toDate: toDt,
|
||||||
selectedStatus: SelectedStatus != null ? SelectedStatus : '',
|
selectedStatus:
|
||||||
|
(SelectedStatus != '' && SelectedStatus != 'PrevPending')
|
||||||
|
? SelectedStatus
|
||||||
|
: '',
|
||||||
selectedStaffId: SelectedStaffId ?? '',
|
selectedStaffId: SelectedStaffId ?? '',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -627,18 +719,27 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
return (item['agent_name'] ?? '-').toLowerCase().contains(
|
return (item['agent_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
|
(item['agent_code'] ?? '-').toLowerCase().contains(
|
||||||
|
query.toLowerCase(),
|
||||||
|
) ||
|
||||||
(item['reg_no'] ?? '-').toLowerCase().contains(
|
(item['reg_no'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['insurer_name'] ?? '-').toLowerCase().contains(
|
(item['insurer_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
|
(item['enquiry_status'] ?? '-').toLowerCase().contains(
|
||||||
|
query.toLowerCase(),
|
||||||
|
) ||
|
||||||
(item['assigned_to_name'] ?? '-').toLowerCase().contains(
|
(item['assigned_to_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
(item['insured_name'] ?? '-').toLowerCase().contains(
|
(item['insured_name'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
|
(item['insurer_short_name'] ?? '-').toLowerCase().contains(
|
||||||
|
query.toLowerCase(),
|
||||||
|
) ||
|
||||||
(item['premium_amount'] ?? '-').toLowerCase().contains(
|
(item['premium_amount'] ?? '-').toLowerCase().contains(
|
||||||
query.toLowerCase(),
|
query.toLowerCase(),
|
||||||
) ||
|
) ||
|
||||||
@ -716,6 +817,18 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
();
|
();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> handleDeleteEnq(Map<String, dynamic> item) async {
|
||||||
|
final id = int.tryParse(item['id'].toString()) ?? 0;
|
||||||
|
idPrimary = item['id'];
|
||||||
|
|
||||||
|
print("handleDeleteEnq - $idPrimary");
|
||||||
|
final res = await apiService.deleteEnquiy(id, 0);
|
||||||
|
|
||||||
|
if (res['status'] == 'success') {
|
||||||
|
autoRefrshfilterDateRange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void handleEdit(Map<String, dynamic> item) {
|
void handleEdit(Map<String, dynamic> item) {
|
||||||
print("handleEdit");
|
print("handleEdit");
|
||||||
|
|
||||||
@ -745,6 +858,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
|
|
||||||
selectedInsurer = item['insurer_id'];
|
selectedInsurer = item['insurer_id'];
|
||||||
selectedStaff = item['assigned_to'];
|
selectedStaff = item['assigned_to'];
|
||||||
|
selectedBroker = item['broker_id'];
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -983,9 +1097,24 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
horizontal: 8,
|
horizontal: 8,
|
||||||
vertical: 3,
|
vertical: 3,
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
item['name'].toString(),
|
item['name'].toString(),
|
||||||
style: GoogleFonts.inter(fontSize: 12, color: Colors.black),
|
style: GoogleFonts.inter(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"(${item['today_assigned']} / ${item['total_pending']})",
|
||||||
|
style: GoogleFonts.poppins(
|
||||||
|
fontSize: 10,
|
||||||
|
color: Colors.blueGrey.shade200,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -1177,7 +1306,12 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
(item) => item['id'].toString() == selectedBroker,
|
(item) => item['id'].toString() == selectedBroker,
|
||||||
orElse: () => {},
|
orElse: () => {},
|
||||||
);
|
);
|
||||||
return SizedBox(
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text('Broker', style: _subLabelTimeStyle),
|
||||||
|
SizedBox(height: 5),
|
||||||
|
SizedBox(
|
||||||
height: 30,
|
height: 30,
|
||||||
width: MediaQuery.of(context).size.width * 0.07,
|
width: MediaQuery.of(context).size.width * 0.07,
|
||||||
child: DropdownSearch<Map<String, dynamic>>(
|
child: DropdownSearch<Map<String, dynamic>>(
|
||||||
@ -1214,7 +1348,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(
|
child: Text(
|
||||||
selectedItem != null ? selectedItem['name'].toString() : "",
|
selectedItem != null ? selectedItem['name'].toString() : "",
|
||||||
style: GoogleFonts.poppins(fontSize: 11, color: Colors.black),
|
style: GoogleFonts.poppins(
|
||||||
|
fontSize: 11,
|
||||||
|
color: Color(0XFF6366F1),
|
||||||
|
),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
softWrap: false,
|
softWrap: false,
|
||||||
@ -1226,15 +1363,22 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
label: "Select Broker",
|
label: "Select Broker",
|
||||||
).copyWith(
|
).copyWith(
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white, // 👈 makes the dropdown input white
|
fillColor:
|
||||||
|
Colors.white, // 👈 makes the dropdown input white
|
||||||
isDense: true,
|
isDense: true,
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
borderSide: const BorderSide(color: Colors.black, width: 0.1),
|
borderSide: const BorderSide(
|
||||||
|
color: Color(0XFF6366F1),
|
||||||
|
width: 0.1,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
borderSide: const BorderSide(color: Colors.black, width: 0.1),
|
borderSide: const BorderSide(
|
||||||
|
color: Color(0XFF6366F1),
|
||||||
|
width: 0.5,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
contentPadding: EdgeInsets.symmetric(
|
contentPadding: EdgeInsets.symmetric(
|
||||||
horizontal: 8,
|
horizontal: 8,
|
||||||
@ -1252,15 +1396,21 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
),
|
),
|
||||||
showSearchBox: true,
|
showSearchBox: true,
|
||||||
searchFieldProps: TextFieldProps(
|
searchFieldProps: TextFieldProps(
|
||||||
|
autofocus: true,
|
||||||
style: GoogleFonts.inter(fontSize: 11, color: Colors.black),
|
style: GoogleFonts.inter(fontSize: 11, color: Colors.black),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
contentPadding: EdgeInsets.all(1),
|
contentPadding: EdgeInsets.all(1),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
hintText: "Search Broker...",
|
hintText: "Search Broker...",
|
||||||
hintStyle: GoogleFonts.inter(fontSize: 12, color: Colors.black),
|
hintStyle: GoogleFonts.inter(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.white), // 👈 Normal border
|
borderSide: BorderSide(
|
||||||
|
color: Colors.white,
|
||||||
|
), // 👈 Normal border
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
@ -1274,7 +1424,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
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,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 8,
|
||||||
|
vertical: 3,
|
||||||
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
item['name'].toString(),
|
item['name'].toString(),
|
||||||
style: GoogleFonts.inter(fontSize: 12, color: Colors.black),
|
style: GoogleFonts.inter(fontSize: 12, color: Colors.black),
|
||||||
@ -1294,6 +1447,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1582,7 +1737,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
SizedBox(height: 5),
|
SizedBox(height: 5),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: MediaQuery.of(context).size.width * 0.08,
|
width: MediaQuery.of(context).size.width * 0.08,
|
||||||
child: ThemedFormInlineField(
|
child: ThemedFormField(
|
||||||
controller: controllers['regNo']!,
|
controller: controllers['regNo']!,
|
||||||
hintText: 'Vehicle Number',
|
hintText: 'Vehicle Number',
|
||||||
borderColor: Color(0XFF6366F1),
|
borderColor: Color(0XFF6366F1),
|
||||||
@ -1593,7 +1748,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
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.requiredVechileNum(value, "regNo"),
|
||||||
widthNone: true,
|
// widthNone: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -2425,6 +2580,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
buildSelectStaffMem(context),
|
buildSelectStaffMem(context),
|
||||||
buildAgentName(context, fromHeader: false),
|
buildAgentName(context, fromHeader: false),
|
||||||
buildInsurer(context),
|
buildInsurer(context),
|
||||||
|
buildBroker(context),
|
||||||
buildInsuredName(context),
|
buildInsuredName(context),
|
||||||
buildVehicleNumber(context),
|
buildVehicleNumber(context),
|
||||||
|
|
||||||
@ -2537,7 +2693,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
splashRadius: 14, // ripple radius
|
splashRadius: 14, // ripple radius
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
isActionable = false;
|
// isActionable = false;
|
||||||
bool isOpen = rowExpanded[id] ?? false;
|
bool isOpen = rowExpanded[id] ?? false;
|
||||||
|
|
||||||
rowExpanded.clear(); // close all
|
rowExpanded.clear(); // close all
|
||||||
@ -2866,6 +3022,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
docUploadedFile = null;
|
docUploadedFile = null;
|
||||||
});
|
});
|
||||||
refrshfilterDateRange();
|
refrshfilterDateRange();
|
||||||
|
setState(() {});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2911,7 +3068,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
Container(
|
Container(
|
||||||
// height: MediaQuery.of(context).size.height*0.
|
// height: MediaQuery.of(context).size.height*0.
|
||||||
child: RaiseEnqForm(
|
child: RaiseEnqForm(
|
||||||
key: raiseEnqKey,
|
// key: raiseEnqKey,
|
||||||
|
key: ValueKey(formRebuildKey),
|
||||||
onSubmit: (dataSet) async {
|
onSubmit: (dataSet) async {
|
||||||
print('Check checking dataSet $dataSet');
|
print('Check checking dataSet $dataSet');
|
||||||
try {
|
try {
|
||||||
@ -2919,6 +3077,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
print("Enquiry saved successfully");
|
print("Enquiry saved successfully");
|
||||||
// RESET FORM
|
// RESET FORM
|
||||||
raiseEnqKey.currentState?.resetFormFields();
|
raiseEnqKey.currentState?.resetFormFields();
|
||||||
|
// REBUILD THE ENTIRE FORM
|
||||||
|
setState(() {
|
||||||
|
formRebuildKey = UniqueKey().toString();
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -3038,9 +3200,9 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
print("Dialog closed");
|
print("Dialog closed");
|
||||||
print("Dialog result: $result");
|
print("Dialog result: $result");
|
||||||
if (result) {
|
if (result) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
isActionable = false;
|
// isActionable = false;
|
||||||
});
|
// });
|
||||||
refrshfilterDateRange();
|
refrshfilterDateRange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3101,17 +3263,119 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
|
SizedBox(width: 10),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(color: Color(0xFFE2E8F0), width: 1),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
// color: Colors.yellow.shade50,
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
isActionable ? "OFF" : "ON",
|
||||||
|
style: GoogleFonts.poppins(
|
||||||
|
fontSize: 10,
|
||||||
|
color: !isActionable ? Colors.green : Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
width: 30,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
child: Transform.scale(
|
||||||
|
scale: 0.4,
|
||||||
|
child: Switch(
|
||||||
|
value: !isActionable,
|
||||||
|
onChanged: (v) async {
|
||||||
|
bool newValue = !v;
|
||||||
|
setState(() => isActionable = newValue);
|
||||||
|
|
||||||
|
final prefs =
|
||||||
|
await SharedPreferences.getInstance();
|
||||||
|
await prefs.setBool(
|
||||||
|
'isActionable',
|
||||||
|
newValue,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Tooltip(
|
||||||
|
message: 'Set AutoRefresh Timer',
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 5),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: Colors.white,
|
||||||
|
// borderRadius: BorderRadius.circular(30),
|
||||||
|
border: Border(
|
||||||
|
left: BorderSide(
|
||||||
|
color: Color(0xFFE2E8F0),
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
|
// right: BorderSide(
|
||||||
|
// color: Color(0xFFE2E8F0),
|
||||||
|
// width: 2,
|
||||||
|
// ),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
height: 30,
|
||||||
|
child: DropdownButton<int>(
|
||||||
|
value: selectedSeconds,
|
||||||
|
underline: SizedBox(),
|
||||||
|
items: [30, 45, 60].map((e) {
|
||||||
|
return DropdownMenuItem(
|
||||||
|
value: e,
|
||||||
|
child: Text(
|
||||||
|
"$e sec",
|
||||||
|
style: GoogleFonts.poppins(fontSize: 11),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
onChanged: (value) async {
|
||||||
|
setState(() {
|
||||||
|
selectedSeconds = value!;
|
||||||
|
startTimer(); // restart timer with new value
|
||||||
|
});
|
||||||
|
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
await prefs.setInt('selectedSeconds', value!);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
//
|
||||||
|
// InkWell(
|
||||||
|
// onTap: () {
|
||||||
|
// resetPreferences();
|
||||||
|
// },
|
||||||
|
// child: Icon(Icons.refresh, size: 18),
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10),
|
||||||
MouseRegion(
|
MouseRegion(
|
||||||
onEnter: (_) {
|
onEnter: (_) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
isActionable = true;
|
// isActionable = true;
|
||||||
});
|
// });
|
||||||
},
|
},
|
||||||
onExit: (_) {
|
onExit: (_) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
// isActionable = false;
|
// // isActionable = false;
|
||||||
isActionable = _searchStaffController.text.isNotEmpty;
|
// isActionable = _searchStaffController.text.isNotEmpty;
|
||||||
});
|
// });
|
||||||
},
|
},
|
||||||
child: ThemedSearchField(
|
child: ThemedSearchField(
|
||||||
hintText: 'Search',
|
hintText: 'Search',
|
||||||
@ -3725,6 +3989,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
|
|
||||||
// Insurer Name
|
// Insurer Name
|
||||||
DataCell(
|
DataCell(
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 60,
|
width: 60,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -3732,6 +4000,17 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
style: _dataBoldthm2,
|
style: _dataBoldthm2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Tooltip(
|
||||||
|
message: 'Broker : ${item['broker_name']}',
|
||||||
|
child: Text(
|
||||||
|
item['broker_name'] != null
|
||||||
|
? _truncateText(item['broker_name'], 8)
|
||||||
|
: '-',
|
||||||
|
style: _dataBoldthm4,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
DataCell(
|
DataCell(
|
||||||
@ -3820,7 +4099,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
|
|
||||||
DataCell(
|
DataCell(
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 70.0,
|
width: 80.0,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Tooltip(
|
Tooltip(
|
||||||
@ -3874,13 +4153,13 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
tooltip: "Edit",
|
tooltip: "Edit",
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
isActionable = false;
|
// isActionable = false;
|
||||||
bool isOpen = rowExpanded[id] ?? false;
|
bool isOpen = rowExpanded[id] ?? false;
|
||||||
|
|
||||||
rowExpanded.clear(); // close all
|
rowExpanded.clear(); // close all
|
||||||
|
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
isActionable = true;
|
// isActionable = true;
|
||||||
rowExpanded[id] =
|
rowExpanded[id] =
|
||||||
true; // open only if previously closed
|
true; // open only if previously closed
|
||||||
}
|
}
|
||||||
@ -3943,6 +4222,28 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
if (item['enquiry_status'] != 'Completed') ...[
|
||||||
|
IconButton(
|
||||||
|
padding: EdgeInsets.zero, // remove outer padding
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
// reduce clickable area
|
||||||
|
minWidth: 24,
|
||||||
|
minHeight: 24,
|
||||||
|
),
|
||||||
|
icon: Icon(
|
||||||
|
Icons.delete,
|
||||||
|
color: Colors.red.shade400,
|
||||||
|
size: 15,
|
||||||
|
),
|
||||||
|
|
||||||
|
tooltip: "Delete Enquiry",
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {});
|
||||||
|
handleDeleteEnq(item);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -4556,7 +4857,73 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
((item['enquiry_status'] == 'Assigned') &&
|
((item['enquiry_status'] == 'Assigned') &&
|
||||||
(item['quotation_id'] == null)))
|
(item['quotation_id'] == null)))
|
||||||
? Text('-')
|
? Text('-')
|
||||||
: ThemedUploadField(
|
: Row(
|
||||||
|
children: [
|
||||||
|
if ((((item['enquiry_status'] == 'Completed') &&
|
||||||
|
(item['quotation_id'] != null)))) ...[
|
||||||
|
// Text(item['policy_pdf_file_name']),
|
||||||
|
Tooltip(
|
||||||
|
message: 'Download Policy File',
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => apiService.downloadFile(
|
||||||
|
apiUrl:
|
||||||
|
'api/policy/downloadPolicyFile?policy_id=${item["policy_id"]}&file_type=policy_pdf',
|
||||||
|
apiId: item["policy_id"],
|
||||||
|
localFile: null,
|
||||||
|
fileName: item['policy_pdf_file_name'],
|
||||||
|
),
|
||||||
|
|
||||||
|
child: Icon(
|
||||||
|
Icons.file_download,
|
||||||
|
size: 14,
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
|
||||||
|
Builder(
|
||||||
|
builder: (buttonContext) => Material(
|
||||||
|
color: Colors.white,
|
||||||
|
child: InkWell(
|
||||||
|
// hoverColor: Color(0xFFEAF6F4),
|
||||||
|
onTap: () async {
|
||||||
|
// ✅ Get overlay and button position RELATIVE to InkWell
|
||||||
|
final RenderBox button =
|
||||||
|
buttonContext.findRenderObject() as RenderBox;
|
||||||
|
final RenderBox overlay =
|
||||||
|
Overlay.of(
|
||||||
|
buttonContext,
|
||||||
|
).context.findRenderObject()
|
||||||
|
as RenderBox;
|
||||||
|
|
||||||
|
final Offset position = button.localToGlobal(
|
||||||
|
Offset.zero,
|
||||||
|
ancestor: overlay,
|
||||||
|
);
|
||||||
|
|
||||||
|
await showMenu(
|
||||||
|
context: buttonContext,
|
||||||
|
position: RelativeRect.fromLTRB(
|
||||||
|
position.dx,
|
||||||
|
position.dy + button.size.height,
|
||||||
|
overlay.size.width,
|
||||||
|
// overlay.size.width - position.dx,
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
items: [
|
||||||
|
PopupMenuItem(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Upload Policy PDF',
|
||||||
|
style: _dataBold,
|
||||||
|
),
|
||||||
|
SizedBox(height: 10),
|
||||||
|
ThemedUploadField(
|
||||||
// key: ValueKey(selectedFileNames),
|
// key: ValueKey(selectedFileNames),
|
||||||
// hintText: item['policy_pdf_file_name'] ?? "Upload Document",
|
// hintText: item['policy_pdf_file_name'] ?? "Upload Document",
|
||||||
hintText:
|
hintText:
|
||||||
@ -4569,24 +4936,34 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
padVertical: 5,
|
padVertical: 5,
|
||||||
fontSZ: 11,
|
fontSZ: 11,
|
||||||
borderCirculr: 5,
|
borderCirculr: 5,
|
||||||
txtwidth: ResponsiveLayout.isMobile(context)
|
txtwidth:
|
||||||
|
ResponsiveLayout.isMobile(context)
|
||||||
? null
|
? null
|
||||||
: MediaQuery.of(context).size.width * 0.18,
|
: MediaQuery.of(
|
||||||
|
context,
|
||||||
|
).size.width *
|
||||||
|
0.18,
|
||||||
borderColor: Color(0xFFE2E8F0),
|
borderColor: Color(0xFFE2E8F0),
|
||||||
|
|
||||||
// highlightColor: Color(0xFF50A398),
|
// highlightColor: Color(0xFF50A398),
|
||||||
// backgroundColor: Color(0xFFEDF6F5),
|
// backgroundColor: Color(0xFFEDF6F5),
|
||||||
onFileSelected: (fileName, file) async {
|
onFileSelected: (fileName, file) async {
|
||||||
print("Picked file: $fileName (${file.size} bytes)");
|
print(
|
||||||
|
"Picked file: $fileName (${file.size} bytes)",
|
||||||
|
);
|
||||||
|
|
||||||
if (lastPickedFile == fileName) {
|
if (lastPickedFile == fileName) {
|
||||||
print("❌ Cancel clicked. Ignoring old file.");
|
print(
|
||||||
|
"❌ Cancel clicked. Ignoring old file.",
|
||||||
|
);
|
||||||
setState(() {
|
setState(() {
|
||||||
print('Clear Fields');
|
print('Clear Fields');
|
||||||
selectedFileNames = null; // clears the field
|
selectedFileNames =
|
||||||
|
null; // clears the field
|
||||||
docUploadedFile = null;
|
docUploadedFile = null;
|
||||||
print('Clear Fields - 1');
|
print('Clear Fields - 1');
|
||||||
});
|
});
|
||||||
|
// Navigator.of(context).pop();
|
||||||
// refrshfilterDateRange();
|
// refrshfilterDateRange();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -4603,45 +4980,87 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
fileName == null ||
|
fileName == null ||
|
||||||
fileName.isEmpty ||
|
fileName.isEmpty ||
|
||||||
file.size == 0) {
|
file.size == 0) {
|
||||||
print("❌ File selection canceled. No upload.");
|
print(
|
||||||
|
"❌ File selection canceled. No upload.",
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
print("Picked file: $fileName (${file.size} bytes)");
|
print(
|
||||||
|
"Picked file: $fileName (${file.size} bytes)",
|
||||||
|
);
|
||||||
|
|
||||||
if (!fileName.toLowerCase().endsWith('.pdf')) {
|
if (!fileName
|
||||||
|
.toLowerCase()
|
||||||
|
.endsWith('.pdf')) {
|
||||||
ToastHelper.showErrorToast(
|
ToastHelper.showErrorToast(
|
||||||
context,
|
context,
|
||||||
'Only PDF files are allowed.',
|
'Only PDF files are allowed.',
|
||||||
);
|
);
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(
|
||||||
|
context,
|
||||||
|
).showSnackBar(
|
||||||
const SnackBar(
|
const SnackBar(
|
||||||
content: Text('Only PDF files are allowed.'),
|
content: Text(
|
||||||
|
'Only PDF files are allowed.',
|
||||||
|
),
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return; // Stop here
|
return; // Stop here
|
||||||
}
|
}
|
||||||
|
|
||||||
print("Picked file: $fileName (${file.size} bytes)");
|
print(
|
||||||
|
"Picked file: $fileName (${file.size} bytes)",
|
||||||
|
);
|
||||||
setState(() {
|
setState(() {
|
||||||
docUploadedFile = file;
|
docUploadedFile = file;
|
||||||
});
|
});
|
||||||
await uploadPolicyPDF(
|
await uploadPolicyPDF(
|
||||||
file: docUploadedFile,
|
file: docUploadedFile,
|
||||||
data: {
|
data: {
|
||||||
"quotation_id": item["quotation_id"],
|
"quotation_id":
|
||||||
|
item["quotation_id"],
|
||||||
"manager_id": managerId,
|
"manager_id": managerId,
|
||||||
"created_by": userId,
|
"created_by": userId,
|
||||||
"updated_by": userId,
|
"updated_by": userId,
|
||||||
"id": item["policy_id"], // ONLY while updating
|
"id":
|
||||||
|
item["policy_id"], // ONLY while updating
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Navigator.of(context).pop();
|
||||||
// if (selectedBrokerName == 'Nhance') {
|
// if (selectedBrokerName == 'Nhance') {
|
||||||
// handleUploadPolicy();
|
// handleUploadPolicy();
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
color: Colors.white,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Tooltip(
|
||||||
|
message:
|
||||||
|
'Click and Upload Policy PDF', // what appears on hover/long press
|
||||||
|
waitDuration: const Duration(
|
||||||
|
milliseconds: 500,
|
||||||
|
), // optional
|
||||||
|
showDuration: const Duration(
|
||||||
|
seconds: 2,
|
||||||
|
), // optional
|
||||||
|
child: Icon(
|
||||||
|
Icons.file_upload_outlined,
|
||||||
|
size: 15,
|
||||||
|
color: Colors.green,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@ -192,6 +192,8 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
|
|||||||
|
|
||||||
// 3. Reset form validation
|
// 3. Reset form validation
|
||||||
_formKey.currentState?.reset();
|
_formKey.currentState?.reset();
|
||||||
|
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getVehicleType() async {
|
Future<void> getVehicleType() async {
|
||||||
@ -365,6 +367,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
|
|||||||
// color: Color(0xFFFCFCFC),
|
// color: Color(0xFFFCFCFC),
|
||||||
// margin: const EdgeInsets.symmetric(vertical: 8),
|
// margin: const EdgeInsets.symmetric(vertical: 8),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 25),
|
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 25),
|
||||||
|
height: MediaQuery.of(context).size.height * 0.16,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
// color: Colors.amber,
|
// color: Colors.amber,
|
||||||
@ -387,7 +390,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
|
|||||||
key: _formKey,
|
key: _formKey,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
buildAgentName(context, fromHeader: true),
|
buildAgentName(context, fromHeader: true),
|
||||||
if (roleId != 'staff') ...[buildSelectStaffMem(context)],
|
if (roleId != 'staff') ...[buildSelectStaffMem(context)],
|
||||||
@ -398,6 +401,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
|
|||||||
// buildInsuredName(context, fromHeader: true),
|
// buildInsuredName(context, fromHeader: true),
|
||||||
buildVehicleNumber(context),
|
buildVehicleNumber(context),
|
||||||
Row(
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
buildRefresh(context),
|
buildRefresh(context),
|
||||||
SizedBox(width: 5),
|
SizedBox(width: 5),
|
||||||
@ -952,9 +956,25 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
|
|||||||
horizontal: 8,
|
horizontal: 8,
|
||||||
vertical: 3,
|
vertical: 3,
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
item['name'].toString(),
|
item['name'].toString(),
|
||||||
style: GoogleFonts.inter(fontSize: 12, color: Colors.black),
|
style: GoogleFonts.inter(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Text(
|
||||||
|
"(${item['today_assigned']} / ${item['total_pending']})",
|
||||||
|
style: GoogleFonts.poppins(
|
||||||
|
fontSize: 10,
|
||||||
|
color: Colors.blueGrey.shade200,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
25
lib/presentation/themes/charts/appChartColors.dart
Normal file
25
lib/presentation/themes/charts/appChartColors.dart
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AppColors {
|
||||||
|
static const Color primary = contentColorCyan;
|
||||||
|
static const Color menuBackground = Color(0xFF090912);
|
||||||
|
static const Color itemsBackground = Color(0xFF1B2339);
|
||||||
|
static const Color pageBackground = Color(0xFF282E45);
|
||||||
|
static const Color mainTextColor1 = Colors.white;
|
||||||
|
static const Color mainTextColor2 = Colors.white70;
|
||||||
|
static const Color mainTextColor3 = Colors.white38;
|
||||||
|
static const Color mainGridLineColor = Colors.white10;
|
||||||
|
static const Color borderColor = Colors.white54;
|
||||||
|
static const Color gridLinesColor = Color(0x11FFFFFF);
|
||||||
|
|
||||||
|
static const Color contentColorBlack = Colors.black;
|
||||||
|
static const Color contentColorWhite = Colors.white;
|
||||||
|
static const Color contentColorBlue = Color(0xFF2196F3);
|
||||||
|
static const Color contentColorYellow = Color(0xFFFFC300);
|
||||||
|
static const Color contentColorOrange = Color(0xFFFF683B);
|
||||||
|
static const Color contentColorGreen = Color(0xFF3BFF49);
|
||||||
|
static const Color contentColorPurple = Color(0xFF6E1BFF);
|
||||||
|
static const Color contentColorPink = Color(0xFFFF3AF2);
|
||||||
|
static const Color contentColorRed = Color(0xFFE80054);
|
||||||
|
static const Color contentColorCyan = Color(0xFF50E4FF);
|
||||||
|
}
|
||||||
@ -1,87 +1,136 @@
|
|||||||
// import 'package:fl_chart/fl_chart.dart';
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
// import 'package:flutter/material.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
//
|
import 'package:flutter/material.dart';
|
||||||
// class DynamicHorizontalBarChart extends StatelessWidget {
|
|
||||||
// final List<Map<String, dynamic>> data;
|
import 'appChartColors.dart';
|
||||||
// // Example:
|
|
||||||
// // [
|
class BarChart extends StatefulWidget {
|
||||||
// // {"label": "Apple", "value": 35},
|
final List<_BarData>? dataList;
|
||||||
// // {"label": "Banana", "value": 20},
|
final List<String>? labels;
|
||||||
// // {"label": "Orange", "value": 15},
|
final String title;
|
||||||
// // ]
|
final double maxY;
|
||||||
//
|
final int initialRotation;
|
||||||
// const DynamicHorizontalBarChart({super.key, required this.data});
|
|
||||||
//
|
const BarChart(
|
||||||
// @override
|
BarChartData barChartData, {
|
||||||
// Widget build(BuildContext context) {
|
super.key,
|
||||||
// double maxValue = data
|
this.dataList,
|
||||||
// .map((e) => e["value"] as double)
|
this.labels,
|
||||||
// .reduce((a, b) => a > b ? a : b);
|
this.title = "Horizontal Bar Chart",
|
||||||
//
|
this.maxY = 20,
|
||||||
// return SizedBox(
|
this.initialRotation = 1,
|
||||||
// height: data.length * 50,
|
});
|
||||||
// child: BarChart(
|
|
||||||
// BarChartData(
|
final shadowColor = const Color(0xFFCCCCCC);
|
||||||
// maxY: maxValue + 10,
|
|
||||||
// barTouchData: BarTouchData(enabled: false),
|
@override
|
||||||
//
|
State<BarChart> createState() => _BarChartState();
|
||||||
// titlesData: FlTitlesData(
|
}
|
||||||
// leftTitles: AxisTitles(
|
|
||||||
// sideTitles: SideTitles(
|
class _BarChartState extends State<BarChart> {
|
||||||
// showTitles: true,
|
int touchedGroupIndex = -1;
|
||||||
// reservedSize: 100,
|
late int rotationTurns;
|
||||||
// getTitlesWidget: (value, meta) {
|
|
||||||
// int index = value.toInt();
|
@override
|
||||||
// if (index < data.length) {
|
void initState() {
|
||||||
// return Text(
|
super.initState();
|
||||||
// data[index]["label"],
|
rotationTurns = widget.initialRotation;
|
||||||
// style: const TextStyle(fontSize: 12),
|
}
|
||||||
// );
|
|
||||||
// }
|
BarChartGroupData generateBarGroup(
|
||||||
// return Container();
|
int x,
|
||||||
// },
|
Color color,
|
||||||
// ),
|
double value,
|
||||||
// ),
|
double shadowValue,
|
||||||
// rightTitles: AxisTitles(),
|
) {
|
||||||
// topTitles: AxisTitles(),
|
return BarChartGroupData(
|
||||||
// bottomTitles: AxisTitles(),
|
x: x,
|
||||||
// ),
|
barRods: [
|
||||||
//
|
BarChartRodData(toY: value, color: color, width: 6),
|
||||||
// gridData: FlGridData(show: false),
|
BarChartRodData(toY: shadowValue, color: widget.shadowColor, width: 6),
|
||||||
// borderData: FlBorderData(show: false),
|
],
|
||||||
//
|
showingTooltipIndicators: touchedGroupIndex == x ? [0] : [],
|
||||||
// barGroups: List.generate(data.length, (index) {
|
);
|
||||||
// final item = data[index];
|
}
|
||||||
// final double value = item["value"] * 1.0;
|
|
||||||
//
|
@override
|
||||||
// return BarChartGroupData(
|
Widget build(BuildContext context) {
|
||||||
// x: index,
|
return Padding(
|
||||||
// barRods: [
|
padding: const EdgeInsets.all(24),
|
||||||
// BarChartRodData(
|
child: Column(
|
||||||
// toY: value,
|
children: [
|
||||||
// width: 25,
|
Row(
|
||||||
// color: Colors.teal,
|
children: [
|
||||||
// borderRadius: BorderRadius.circular(5),
|
const Spacer(),
|
||||||
//
|
Text(
|
||||||
// // 🟩 LABEL INSIDE THE BAR
|
widget.title,
|
||||||
// rodStackItems: [
|
style: const TextStyle(
|
||||||
// BarChartRodStackItem(
|
color: AppColors.mainTextColor1,
|
||||||
// 0,
|
fontSize: 20,
|
||||||
// value,
|
),
|
||||||
// Colors.transparent,
|
),
|
||||||
// // BorderSide(),
|
Spacer(),
|
||||||
// // StackItemLabel(
|
IconButton(
|
||||||
// // label: "${value.toInt()}",
|
onPressed: () {
|
||||||
// // labelStyle: const TextStyle(color: Colors.white),
|
setState(() => rotationTurns += 1);
|
||||||
// // ),
|
},
|
||||||
// ),
|
icon: RotatedBox(
|
||||||
// ],
|
quarterTurns: rotationTurns - 1,
|
||||||
// ),
|
child: const Icon(Icons.rotate_90_degrees_cw),
|
||||||
// ],
|
),
|
||||||
// );
|
),
|
||||||
// }),
|
],
|
||||||
// ),
|
),
|
||||||
// ),
|
const SizedBox(height: 18),
|
||||||
// );
|
AspectRatio(
|
||||||
// }
|
aspectRatio: 1.4,
|
||||||
// }
|
child: BarChart(
|
||||||
|
BarChartData(
|
||||||
|
alignment: BarChartAlignment.spaceBetween,
|
||||||
|
rotationQuarterTurns: rotationTurns,
|
||||||
|
borderData: FlBorderData(show: false),
|
||||||
|
titlesData: FlTitlesData(
|
||||||
|
bottomTitles: AxisTitles(
|
||||||
|
sideTitles: SideTitles(
|
||||||
|
showTitles: true,
|
||||||
|
getTitlesWidget: (value, meta) {
|
||||||
|
final i = value.toInt();
|
||||||
|
if (i >= widget.labels!.length) return const SizedBox();
|
||||||
|
return SideTitleWidget(
|
||||||
|
meta: meta,
|
||||||
|
child: Text(widget.labels![i]),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
leftTitles: const AxisTitles(),
|
||||||
|
),
|
||||||
|
gridData: const FlGridData(show: false),
|
||||||
|
barGroups: widget.dataList?.asMap().entries.map((e) {
|
||||||
|
final index = e.key;
|
||||||
|
final data = e.value;
|
||||||
|
return generateBarGroup(
|
||||||
|
index,
|
||||||
|
data.color,
|
||||||
|
data.value,
|
||||||
|
data.shadowValue,
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
maxY: widget.maxY,
|
||||||
|
),
|
||||||
|
// dataList: [],
|
||||||
|
// labels: [],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BarData {
|
||||||
|
final Color color;
|
||||||
|
final double value;
|
||||||
|
final double shadowValue;
|
||||||
|
const _BarData(this.color, this.value, this.shadowValue);
|
||||||
|
}
|
||||||
|
|||||||
@ -200,7 +200,7 @@ class _DateFilterRowState extends ConsumerState<DateFilterRow> {
|
|||||||
message: 'Filter',
|
message: 'Filter',
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.filter_alt_outlined,
|
Icons.search_rounded,
|
||||||
size: 18,
|
size: 18,
|
||||||
color: const Color(0xFF94A3B8),
|
color: const Color(0xFF94A3B8),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import Foundation
|
|||||||
|
|
||||||
import connectivity_plus
|
import connectivity_plus
|
||||||
import file_picker
|
import file_picker
|
||||||
import firebase_app_check
|
|
||||||
import firebase_auth
|
import firebase_auth
|
||||||
import firebase_core
|
import firebase_core
|
||||||
import firebase_messaging
|
import firebase_messaging
|
||||||
@ -23,7 +22,6 @@ import url_launcher_macos
|
|||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
|
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
|
||||||
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
|
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
|
||||||
FLTFirebaseAppCheckPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAppCheckPlugin"))
|
|
||||||
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
|
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
|
||||||
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
|
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
|
||||||
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
|
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
|
||||||
|
|||||||
48
pubspec.lock
48
pubspec.lock
@ -13,10 +13,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: _flutterfire_internals
|
name: _flutterfire_internals
|
||||||
sha256: "948f7d74f41dd6f2d563ea9f4c21d7ea764f8e047d2b24138974c19c24d37eb6"
|
sha256: "8a1f5f3020ef2a74fb93f7ab3ef127a8feea33a7a2276279113660784ee7516a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.61"
|
version: "1.3.64"
|
||||||
analyzer:
|
analyzer:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -297,30 +297,6 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.3.3"
|
version: "10.3.3"
|
||||||
firebase_app_check:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: firebase_app_check
|
|
||||||
sha256: "3bf5d9c9043723ae12c09b2a012ca5f32653a1bc30a0a9818983766ea06d72a8"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.4.0+1"
|
|
||||||
firebase_app_check_platform_interface:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: firebase_app_check_platform_interface
|
|
||||||
sha256: bdda519aa487be605a53093ececa564d48afadd1a1d018520ce45d00415ac03d
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.2.0+1"
|
|
||||||
firebase_app_check_web:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: firebase_app_check_web
|
|
||||||
sha256: ab7b57c95faf266e2d5cd9fc57cda54d1fdfbc2c429c09b095830d4186f25920
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "0.2.0+16"
|
|
||||||
firebase_auth:
|
firebase_auth:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -349,26 +325,26 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: firebase_core
|
name: firebase_core
|
||||||
sha256: "967dae9a65f69377beb9f4ab292ea63ce5befa1ce24682cab1b69ca4b7a46927"
|
sha256: "1f2dfd9f535d81f8b06d7a50ecda6eac1e6922191ed42e09ca2c84bd2288927c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.1.0"
|
version: "4.2.1"
|
||||||
firebase_core_platform_interface:
|
firebase_core_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_core_platform_interface
|
name: firebase_core_platform_interface
|
||||||
sha256: "5dbc900677dcbe5873d22ad7fbd64b047750124f1f9b7ebe2a33b9ddccc838eb"
|
sha256: cccb4f572325dc14904c02fcc7db6323ad62ba02536833dddb5c02cac7341c64
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.0"
|
version: "6.0.2"
|
||||||
firebase_core_web:
|
firebase_core_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: firebase_core_web
|
name: firebase_core_web
|
||||||
sha256: f7ee08febc1c4451588ce58ffcf28edaee857e9a196fee88b85deb889990094a
|
sha256: ff18fabb0ad0ed3595d2f2c85007ecc794aadecdff5b3bb1460b7ee47cded398
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.3.0"
|
||||||
firebase_messaging:
|
firebase_messaging:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -401,6 +377,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.1"
|
version: "1.1.1"
|
||||||
|
fl_chart:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: fl_chart
|
||||||
|
sha256: "5276944c6ffc975ae796569a826c38a62d2abcf264e26b88fa6f482e107f4237"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.70.2"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|||||||
@ -58,7 +58,6 @@ dependencies:
|
|||||||
google_sign_in: ^7.1.1
|
google_sign_in: ^7.1.1
|
||||||
firebase_core: ^4.1.0
|
firebase_core: ^4.1.0
|
||||||
firebase_auth: ^6.0.2
|
firebase_auth: ^6.0.2
|
||||||
firebase_app_check: ^0.4.0+1
|
|
||||||
package_info_plus: ^8.3.1
|
package_info_plus: ^8.3.1
|
||||||
flutter_lints: ^6.0.0
|
flutter_lints: ^6.0.0
|
||||||
easy_loading_button: ^0.4.0
|
easy_loading_button: ^0.4.0
|
||||||
@ -69,6 +68,8 @@ dependencies:
|
|||||||
dropdown_search: ^6.0.2
|
dropdown_search: ^6.0.2
|
||||||
file_picker: ^10.3.3
|
file_picker: ^10.3.3
|
||||||
fluttertoast: ^9.0.0
|
fluttertoast: ^9.0.0
|
||||||
|
fl_chart: ^0.70.0
|
||||||
|
|
||||||
# fl_chart: ^1.1.0
|
# fl_chart: ^1.1.0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user