Commit 7210793a authored by Sai Srinivas's avatar Sai Srinivas
Browse files

17-09

parent 185e0896
...@@ -5,8 +5,8 @@ class OrganizationStructureScreen extends StatelessWidget { ...@@ -5,8 +5,8 @@ class OrganizationStructureScreen extends StatelessWidget {
Department( Department(
name: "Engineering", name: "Engineering",
teams: [ teams: [
Team(name: "Mobile Team", members: ["Mohit", "Srinivas", ]), Team(name: "Mobile Team", members: ["Mohit", "Srinivas"]),
Team(name: "Backend Team", members: ["Dheeraj", "Satya","Sneha"]), Team(name: "Backend Team", members: ["Dheeraj", "Satya", "Sneha"]),
], ],
), ),
Department( Department(
...@@ -25,6 +25,8 @@ class OrganizationStructureScreen extends StatelessWidget { ...@@ -25,6 +25,8 @@ class OrganizationStructureScreen extends StatelessWidget {
), ),
]; ];
const OrganizationStructureScreen({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
...@@ -40,34 +42,45 @@ class OrganizationStructureScreen extends StatelessWidget { ...@@ -40,34 +42,45 @@ class OrganizationStructureScreen extends StatelessWidget {
child: ExpansionTile( child: ExpansionTile(
title: Text( title: Text(
"${dept.name} not ready", "${dept.name} not ready",
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold), style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
), ),
children: dept.teams.map((team) { children:
return Padding( dept.teams.map((team) {
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), return Padding(
child: Column( padding: const EdgeInsets.symmetric(
crossAxisAlignment: CrossAxisAlignment.start, horizontal: 16,
children: [ vertical: 8,
Text(
team.name,
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
),
const SizedBox(height: 4),
Wrap(
spacing: 8,
children: team.members.map((member) {
return Chip(
label: Text(member),
backgroundColor: Colors.blue.shade50,
);
}).toList(),
), ),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
team.name,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 4),
Wrap(
spacing: 8,
children:
team.members.map((member) {
return Chip(
label: Text(member),
backgroundColor: Colors.blue.shade50,
);
}).toList(),
),
const SizedBox(height: 8), const SizedBox(height: 8),
], ],
), ),
); );
}).toList(), }).toList(),
), ),
); );
}, },
......
...@@ -8,7 +8,7 @@ import '../../Notifiers/hrmProvider/rewardListProvider.dart'; ...@@ -8,7 +8,7 @@ import '../../Notifiers/hrmProvider/rewardListProvider.dart';
import '../../Utils/app_colors.dart'; import '../../Utils/app_colors.dart';
class RewardListScreen extends StatefulWidget { class RewardListScreen extends StatefulWidget {
const RewardListScreen({Key? key}) : super(key: key); const RewardListScreen({super.key});
@override @override
State<RewardListScreen> createState() => _RewardListScreenState(); State<RewardListScreen> createState() => _RewardListScreenState();
...@@ -20,287 +20,294 @@ class _RewardListScreenState extends State<RewardListScreen> { ...@@ -20,287 +20,294 @@ class _RewardListScreenState extends State<RewardListScreen> {
return SafeArea( return SafeArea(
top: false, top: false,
child: ChangeNotifierProvider( child: ChangeNotifierProvider(
create: (_) => create: (_) => RewardListProvider()..fetchRewardList(context),
RewardListProvider()..fetchRewardList(context), child: Consumer<RewardListProvider>(
child: Consumer<RewardListProvider>( builder: (context, provider, child) {
builder: (context, provider, child) { return Scaffold(
return Scaffold( appBar: AppBar(
appBar: AppBar( automaticallyImplyLeading: false,
automaticallyImplyLeading: false, backgroundColor: Colors.white,
backgroundColor: Colors.white, title: Row(
title: Row( children: [
children: [ InkResponse(
InkResponse( onTap: () => Navigator.pop(context, true),
onTap: () => Navigator.pop(context, true), child: SvgPicture.asset(
child: SvgPicture.asset( "assets/svg/appbar_back_button.svg",
"assets/svg/appbar_back_button.svg", height: 25,
height: 25, ),
),
),
const SizedBox(width: 10),
Text(
"Reward List",
style: TextStyle(
fontSize: 18,
fontFamily: "Plus Jakarta Sans",
fontWeight: FontWeight.w600,
color: AppColors.semi_black,
),
),
],
), ),
// actions: [ const SizedBox(width: 10),
// InkResponse( Text(
// onTap: () { "Reward List",
// Navigator.push( style: TextStyle(
// context, fontSize: 18,
// MaterialPageRoute( fontFamily: "Plus Jakarta Sans",
// builder: (context) => RewardSearchScreen(), fontWeight: FontWeight.w600,
// settings: const RouteSettings( color: AppColors.semi_black,
// name: 'AddLiveAttendanceScreen', ),
// ), ),
// ), ],
// ).then((_) { ),
// }); // actions: [
// }, // InkResponse(
// child: SvgPicture.asset( // onTap: () {
// "assets/svg/search_ic.svg", // Navigator.push(
// height: 25, // context,
// ), // MaterialPageRoute(
// ), // builder: (context) => RewardSearchScreen(),
// const SizedBox(width: 20), // settings: const RouteSettings(
// ], // name: 'AddLiveAttendanceScreen',
), // ),
// ),
backgroundColor: Color(0xFFF6F6F8), // ).then((_) {
body: Builder( // });
builder: (context) { // },
if (provider.isLoading) { // child: SvgPicture.asset(
return const Center(child: CircularProgressIndicator( // "assets/svg/search_ic.svg",
color: Colors.blue,)); // height: 25,
} // ),
if (provider.errorMessage != null) { // ),
return Center(child: Text(provider.errorMessage!)); // const SizedBox(width: 20),
} // ],
if (provider.response == null) { ),
return const Center(child: Text("No details found"));
}
final rewardDetail = provider.response!;
final rewardResponse = provider.response!;
final rewards = rewardResponse.rewardsList; // main list object
final achieved = rewardResponse.achievedAmount ?? "0";
final disbursed = rewardResponse.disbursedAmount ?? "0";
final balance = rewardResponse.balanceAmount ?? "0";
return SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: Column(
children: [
/// --- Top Summary Cards --- backgroundColor: Color(0xFFF6F6F8),
Stack( body: Builder(
builder: (context) {
if (provider.isLoading) {
return const Center(
child: CircularProgressIndicator(color: Colors.blue),
);
}
if (provider.errorMessage != null) {
return Center(child: Text(provider.errorMessage!));
}
if (provider.response == null) {
return const Center(child: Text("No details found"));
}
final rewardDetail = provider.response!;
final rewardResponse = provider.response!;
final rewards =
rewardResponse.rewardsList; // main list object
final achieved = rewardResponse.achievedAmount ?? "0";
final disbursed = rewardResponse.disbursedAmount ?? "0";
final balance = rewardResponse.balanceAmount ?? "0";
return SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: Column(
children: [
/// --- Top Summary Cards ---
Stack(
children: [
Container(
height: 110,
width: double.infinity,
padding: const EdgeInsets.all(18),
decoration: BoxDecoration(
color: const Color(0xffd9ffd6),
borderRadius: BorderRadius.circular(18),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Text(
height: 110, "₹$achieved", // Achieved Amount from response
width: double.infinity, style: const TextStyle(
padding: const EdgeInsets.all(18), fontSize: 20,
decoration: BoxDecoration( color: Color(0xff0D9C00),
color: const Color(0xffd9ffd6), fontStyle: FontStyle.normal,
borderRadius: BorderRadius.circular(18), fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 10),
const Text(
"Achievement Amount",
style: TextStyle(
fontSize: 14,
color: Color(0xff2D2D2D),
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
), ),
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, ],
mainAxisAlignment: MainAxisAlignment.center, ),
),
// Positioned SVG Icon
Positioned(
bottom: 8,
right: 12,
child: Container(
height: 42,
width: 42,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: const Color(0xA0FFFFFF), // icon bg
),
child: Center(
child: SvgPicture.asset(
height: 25,
width: 25,
"assets/svg/hrm/achievement_ic.svg",
fit: BoxFit.contain,
),
),
),
),
],
),
const SizedBox(height: 12),
Row(
children: [
Expanded(
child: Container(
height: 110,
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: const Color(0xffe8ddff),
borderRadius: BorderRadius.circular(16),
),
child: Stack(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"₹${achieved}", // Achieved Amount from response "₹$disbursed", // Disbursed Amount
style: const TextStyle( style: const TextStyle(
fontSize: 20, fontSize: 20,
color: Color(0xff0D9C00), color: Color(0xff493272),
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 8),
const Text( const Text(
"Achievement Amount", "Disbursed \nAmount",
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xff2D2D2D), color: Color(0xff2D2D2D),
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
), ),
], ],
), ),
), Positioned(
bottom: 2,
// Positioned SVG Icon right: 2,
Positioned( child: Container(
bottom: 8, height: 42,
right: 12, width: 42,
child: Container( decoration: BoxDecoration(
height: 42, shape: BoxShape.circle,
width: 42, color: const Color(
decoration: BoxDecoration( 0xA0FFFFFF,
shape: BoxShape.circle, ), // icon bg
color: const Color(0xA0FFFFFF), // icon bg ),
), child: Center(
child: Center( child: SvgPicture.asset(
child: SvgPicture.asset( height: 25,
height: 25, width: 25,
width: 25, "assets/svg/hrm/location_ic.svg",
"assets/svg/hrm/achievement_ic.svg", fit: BoxFit.contain,
fit: BoxFit.contain, ),
), ),
), ),
), ),
), ],
], ),
), ),
const SizedBox(height: 12), ),
const SizedBox(width: 12),
Row( Expanded(
children: [ child: Container(
Expanded( height: 110,
child: Container( padding: const EdgeInsets.all(16),
height: 110, decoration: BoxDecoration(
padding: const EdgeInsets.all(16), color: const Color(0xfffffbc3),
decoration: BoxDecoration( borderRadius: BorderRadius.circular(16),
color: const Color(0xffe8ddff), ),
borderRadius: BorderRadius.circular(16), child: Stack(
), children: [
child: Stack( Column(
children: [ crossAxisAlignment:
Column( CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Text(
Text( "₹$balance", // Balance Amount
"₹${disbursed}", // Disbursed Amount style: const TextStyle(
style: const TextStyle( fontSize: 18,
fontSize: 20, color: Color(0xff605C00),
color: Color(0xff493272),
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 8),
const Text(
"Disbursed \nAmount",
style: TextStyle(
fontSize: 14,
color: Color(0xff2D2D2D),
fontWeight: FontWeight.w400,
),
),
],
), ),
Positioned( ),
bottom: 2, const SizedBox(height: 8),
right: 2, const Text(
child: Container( "Balance \nAmount",
height: 42, style: TextStyle(
width: 42, fontSize: 14,
decoration: BoxDecoration( color: Color(0xff2D2D2D),
shape: BoxShape.circle, fontWeight: FontWeight.w400,
color: const Color(0xA0FFFFFF), // icon bg
),
child: Center(
child: SvgPicture.asset(
height: 25,
width: 25,
"assets/svg/hrm/location_ic.svg",
fit: BoxFit.contain,
),
),
),
), ),
], ),
), ],
), ),
), Positioned(
const SizedBox(width: 12), bottom: 2,
Expanded( right: 2,
child: Container( child: Container(
height: 110, height: 42,
padding: const EdgeInsets.all(16), width: 42,
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color(0xfffffbc3), shape: BoxShape.circle,
borderRadius: BorderRadius.circular(16), color: const Color(
), 0xA0FFFFFF,
child: Stack( ), // icon bg
children: [ ),
Column( child: Center(
crossAxisAlignment: CrossAxisAlignment.start, child: SvgPicture.asset(
children: [ height: 25,
Text( width: 25,
"₹${balance}", // Balance Amount "assets/svg/hrm/ballance_ic.svg",
style: const TextStyle( fit: BoxFit.contain,
fontSize: 18,
color: Color(0xff605C00),
),
),
const SizedBox(height: 8),
const Text(
"Balance \nAmount",
style: TextStyle(
fontSize: 14,
color: Color(0xff2D2D2D),
fontWeight: FontWeight.w400,
),
),
],
),
Positioned(
bottom: 2,
right: 2,
child: Container(
height: 42,
width: 42,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: const Color(0xA0FFFFFF), // icon bg
),
child: Center(
child: SvgPicture.asset(
height: 25,
width: 25,
"assets/svg/hrm/ballance_ic.svg",
fit: BoxFit.contain,
),
),
),
), ),
], ),
), ),
), ),
), ],
], ),
), ),
),
],
),
const SizedBox(height: 20), const SizedBox(height: 20),
/// --- Reward List Card --- /// --- Reward List Card ---
if (rewards != null) if (rewards != null)
_rewardListCard( _rewardListCard(
title: rewards.description ?? "-", // rewardsList fields title:
dateTime: rewards.dateTime ?? "-", rewards.description ??
achieved: achieved, "-", // rewardsList fields
disbursed: disbursed, dateTime: rewards.dateTime ?? "-",
balance: balance, achieved: achieved,
enteredBy: rewards.enteredBy ?? "-", disbursed: disbursed,
) balance: balance,
else enteredBy: rewards.enteredBy ?? "-",
const Text("No rewards available"), )
], else
), const Text("No rewards available"),
); ],
} ),
), );
); },
} ),
) );
},
),
), ),
); );
} }
/// Reusable Reward Card Function /// Reusable Reward Card Function
...@@ -350,31 +357,31 @@ class _RewardListScreenState extends State<RewardListScreen> { ...@@ -350,31 +357,31 @@ class _RewardListScreenState extends State<RewardListScreen> {
Text( Text(
title, title,
style: const TextStyle( style: const TextStyle(
fontSize: 14.5, fontSize: 14.5,
color: Color(0xff2D2D2D), color: Color(0xff2D2D2D),
fontFamily: "Plus Jakarta Sans", fontFamily: "Plus Jakarta Sans",
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400), fontWeight: FontWeight.w400,
),
), ),
Text( Text(
dateTime, dateTime,
style: const TextStyle( style: const TextStyle(
fontSize: 12.5, fontSize: 12.5,
color: Color(0xff818181), color: Color(0xff818181),
fontFamily: "Plus Jakarta Sans", fontFamily: "Plus Jakarta Sans",
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400), fontWeight: FontWeight.w400,
),
), ),
], ],
), ),
), ),
], ],
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
/// Amount Details /// Amount Details
Padding( Padding(
padding: const EdgeInsets.all(2.0), padding: const EdgeInsets.all(2.0),
...@@ -382,10 +389,7 @@ class _RewardListScreenState extends State<RewardListScreen> { ...@@ -382,10 +389,7 @@ class _RewardListScreenState extends State<RewardListScreen> {
children: [ children: [
const Text( const Text(
"Amount Details", "Amount Details",
style: TextStyle( style: TextStyle(fontSize: 14, fontFamily: "JakartaSemiBold"),
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
Expanded( Expanded(
...@@ -415,10 +419,7 @@ class _RewardListScreenState extends State<RewardListScreen> { ...@@ -415,10 +419,7 @@ class _RewardListScreenState extends State<RewardListScreen> {
children: [ children: [
const Text( const Text(
"Employee Details", "Employee Details",
style: TextStyle( style: TextStyle(fontSize: 14, fontFamily: "JakartaSemiBold"),
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
Expanded( Expanded(
...@@ -447,19 +448,18 @@ class _RewardListScreenState extends State<RewardListScreen> { ...@@ -447,19 +448,18 @@ class _RewardListScreenState extends State<RewardListScreen> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text(key, style: TextStyle( Text(
fontFamily: "JakartaRegular", key,
fontSize: 14, style: TextStyle(
color: AppColors.semi_black, fontFamily: "JakartaRegular",
), fontSize: 14,
color: AppColors.semi_black,
),
), ),
Text( Text(
value, value,
style: const TextStyle( style: const TextStyle(fontSize: 14, color: Color(0xFF818181)),
fontSize: 14,
color: Color(0xFF818181),
),
), ),
], ],
), ),
......
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import '../../Utils/app_colors.dart';
class RewardSearchScreen extends StatefulWidget { class RewardSearchScreen extends StatefulWidget {
const RewardSearchScreen({super.key}); const RewardSearchScreen({super.key});
...@@ -42,11 +40,17 @@ class _RewardSearchScreenState extends State<RewardSearchScreen> { ...@@ -42,11 +40,17 @@ class _RewardSearchScreenState extends State<RewardSearchScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final filteredAccounts = final filteredAccounts =
accounts.where((e) => e.toLowerCase().contains(query.toLowerCase())).toList(); accounts
.where((e) => e.toLowerCase().contains(query.toLowerCase()))
.toList();
final filteredInquiries = final filteredInquiries =
inquiries.where((e) => e.toLowerCase().contains(query.toLowerCase())).toList(); inquiries
.where((e) => e.toLowerCase().contains(query.toLowerCase()))
.toList();
final filteredLeads = final filteredLeads =
leads.where((e) => e.toLowerCase().contains(query.toLowerCase())).toList(); leads
.where((e) => e.toLowerCase().contains(query.toLowerCase()))
.toList();
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
...@@ -94,8 +98,10 @@ class _RewardSearchScreenState extends State<RewardSearchScreen> { ...@@ -94,8 +98,10 @@ class _RewardSearchScreenState extends State<RewardSearchScreen> {
prefixIcon: const Icon(Icons.search, color: Colors.black54), prefixIcon: const Icon(Icons.search, color: Colors.black54),
filled: true, filled: true,
fillColor: const Color(0xffFFFFFF), fillColor: const Color(0xffFFFFFF),
contentPadding: contentPadding: const EdgeInsets.symmetric(
const EdgeInsets.symmetric(horizontal: 16, vertical: 12), horizontal: 16,
vertical: 12,
),
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none, borderSide: BorderSide.none,
...@@ -159,52 +165,60 @@ class _RewardSearchScreenState extends State<RewardSearchScreen> { ...@@ -159,52 +165,60 @@ class _RewardSearchScreenState extends State<RewardSearchScreen> {
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Column( Column(
children: items children:
.map((e) => Container( items
margin: const EdgeInsets.only(bottom: 12), .map(
padding: const EdgeInsets.symmetric( (e) => Container(
horizontal: 12, vertical: 12), margin: const EdgeInsets.only(bottom: 12),
decoration: BoxDecoration( padding: const EdgeInsets.symmetric(
color: Colors.white, horizontal: 12,
borderRadius: BorderRadius.circular(12), vertical: 12,
boxShadow: [ ),
BoxShadow( decoration: BoxDecoration(
color: Colors.grey.withOpacity(0.1), color: Colors.white,
blurRadius: 5, borderRadius: BorderRadius.circular(12),
offset: const Offset(0, 3), boxShadow: [
) BoxShadow(
], color: Colors.grey.withOpacity(0.1),
), blurRadius: 5,
child: Row( offset: const Offset(0, 3),
children: [ ),
Container( ],
height: 32, ),
width: 32, child: Row(
decoration: BoxDecoration( children: [
color: const Color(0xffE8F3FF), Container(
borderRadius: BorderRadius.circular(8), height: 32,
), width: 32,
child: const Icon(Icons.search, decoration: BoxDecoration(
color: Color(0xff0066FF), size: 20), color: const Color(0xffE8F3FF),
), borderRadius: BorderRadius.circular(8),
const SizedBox(width: 10), ),
Expanded( child: const Icon(
child: Text( Icons.search,
e, color: Color(0xff0066FF),
style: const TextStyle( size: 20,
fontSize: 14, ),
fontFamily: "Plus Jakarta Sans", ),
fontWeight: FontWeight.w400, const SizedBox(width: 10),
color: Color(0xff2D2D2D), Expanded(
child: Text(
e,
style: const TextStyle(
fontSize: 14,
fontFamily: "Plus Jakarta Sans",
fontWeight: FontWeight.w400,
color: Color(0xff2D2D2D),
),
overflow: TextOverflow.ellipsis,
),
),
],
),
), ),
overflow: TextOverflow.ellipsis, )
), .toList(),
), ),
],
),
))
.toList(),
)
], ],
); );
} }
......
...@@ -7,23 +7,25 @@ import '../../Notifiers/hrmProvider/tourExpensesDetailsProvider.dart'; ...@@ -7,23 +7,25 @@ import '../../Notifiers/hrmProvider/tourExpensesDetailsProvider.dart';
import '../../Utils/app_colors.dart'; import '../../Utils/app_colors.dart';
import '../finance/FileViewer.dart'; import '../finance/FileViewer.dart';
class TourExpensesDetailsScreen extends StatefulWidget { class TourExpensesDetailsScreen extends StatefulWidget {
final String tourBillId; final String tourBillId;
const TourExpensesDetailsScreen({Key? key, required this.tourBillId}) const TourExpensesDetailsScreen({super.key, required this.tourBillId});
: super(key: key);
@override @override
State<TourExpensesDetailsScreen> createState() => _TourExpensesDetailsScreenState(); State<TourExpensesDetailsScreen> createState() =>
_TourExpensesDetailsScreenState();
} }
class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SafeArea( return SafeArea(
top: false, top: false,
child: ChangeNotifierProvider( child: ChangeNotifierProvider(
create: (_) => TourExpensesDetailsProvider() create:
..fetchTourExpensesDetails(context, widget.tourBillId), (_) =>
TourExpensesDetailsProvider()
..fetchTourExpensesDetails(context, widget.tourBillId),
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
...@@ -71,8 +73,9 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -71,8 +73,9 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
if (response == null) { if (response == null) {
return const Center(child: Text("No data available")); return const Center(child: Text("No data available"));
} }
debugPrint("==================requestDetails: ${widget.tourBillId}"); debugPrint(
"==================requestDetails: ${widget.tourBillId}",
);
return SingleChildScrollView( return SingleChildScrollView(
child: Column( child: Column(
...@@ -82,29 +85,68 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -82,29 +85,68 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
_expenseHeaderCard( _expenseHeaderCard(
title: response.requestDetails?.placeOfVisit ?? "Tour", title: response.requestDetails?.placeOfVisit ?? "Tour",
date: response.requestDetails?.appliedDate ?? "-", date: response.requestDetails?.appliedDate ?? "-",
status: (response.requestDetails?.approvalStatus?.isNotEmpty ?? false) status:
? response.requestDetails!.approvalStatus! (response
: "No Status", .requestDetails
?.approvalStatus
?.isNotEmpty ??
false)
? response.requestDetails!.approvalStatus!
: "No Status",
details: [ details: [
{"key": "Employee", "value": response.requestDetails!.employeeName!}, {
{"key": "Approved By TL", "value": response.requestDetails!.tlApprovedBy!}, "key": "Employee",
{"key": "TL Approval Amount", "value": response.requestDetails!.tlApprovedAmount!}, "value": response.requestDetails!.employeeName!,
{"key": "TL Remarks", "value": response.requestDetails!.tlRemarks!}, },
{"key": "Approved By HR", "value": response.requestDetails!.hrApprovedBy!}, {
{"key": "HR Approval Amount", "value": response.requestDetails!.hrApprovedAmount!}, "key": "Approved By TL",
{"key": "TL Remarks", "value": response.requestDetails!.tlRemarks!}, "value": response.requestDetails!.tlApprovedBy!,
{"key": "Total Approved Amount", "value": response.requestDetails?.approvedAmount ?? "-"}, },
{"key": "Total Balance Amount", "value": response.requestDetails!.appliedAmount!}, {
{"key": "Type", "value": response.requestDetails!.type!}, "key": "TL Approval Amount",
"value": response.requestDetails!.tlApprovedAmount!,
},
{
"key": "TL Remarks",
"value": response.requestDetails!.tlRemarks!,
},
{
"key": "Approved By HR",
"value": response.requestDetails!.hrApprovedBy!,
},
{
"key": "HR Approval Amount",
"value": response.requestDetails!.hrApprovedAmount!,
},
{
"key": "TL Remarks",
"value": response.requestDetails!.tlRemarks!,
},
{
"key": "Total Approved Amount",
"value":
response.requestDetails?.approvedAmount ?? "-",
},
{
"key": "Total Balance Amount",
"value": response.requestDetails!.appliedAmount!,
},
{
"key": "Type",
"value": response.requestDetails!.type!,
},
], ],
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
/// Tour Expense Card (Main Summary) /// Tour Expense Card (Main Summary)
if (response.requestDetails != null && response.tourExpenses != null) ...[ if (response.requestDetails != null &&
response.tourExpenses != null) ...[
const SizedBox(height: 10), const SizedBox(height: 10),
Padding( Padding(
padding: const EdgeInsets.only(left: 30.0), padding: const EdgeInsets.only(left: 30.0),
child: Text("Tour Summary", child: Text(
"Tour Summary",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
...@@ -119,28 +161,36 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -119,28 +161,36 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width * 0.05, horizontal:
MediaQuery.of(context).size.width * 0.05,
), ),
children: [ children: [
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.90, width: MediaQuery.of(context).size.width * 0.90,
child: _tourExpenseCard( child: _tourExpenseCard(
employeeName: response.requestDetails?.employeeName ?? "-", employeeName:
placeOfVisit: response.requestDetails?.placeOfVisit ?? "-", response.requestDetails?.employeeName ??
"-",
placeOfVisit:
response.requestDetails?.placeOfVisit ??
"-",
daAmount: response.tourExpenses?.da ?? "0", daAmount: response.tourExpenses?.da ?? "0",
totalAmount: response.tourExpenses?.appliedAmount ?? "0", totalAmount:
fromDate: response.tourExpenses?.fromDate ?? "-", response.tourExpenses?.appliedAmount ?? "0",
fromDate:
response.tourExpenses?.fromDate ?? "-",
toDate: response.tourExpenses?.toDate ?? "-", toDate: response.tourExpenses?.toDate ?? "-",
remarks: response.tourExpenses?.extraNote ?? "-", remarks:
response.tourExpenses?.extraNote ?? "-",
), ),
), ),
], ],
), ),
), ),
], ],
const SizedBox(height: 10), const SizedBox(height: 10),
/// Travel Expenses Cards /// Travel Expenses Cards
if (response.travelExpenses != null && if (response.travelExpenses != null &&
response.travelExpenses!.isNotEmpty) ...[ response.travelExpenses!.isNotEmpty) ...[
...@@ -163,14 +213,18 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -163,14 +213,18 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
child: ListView.separated( child: ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width * 0.04, horizontal:
MediaQuery.of(context).size.width * 0.04,
), ),
itemCount: response.travelExpenses!.length, itemCount: response.travelExpenses!.length,
separatorBuilder: (_, __) => const SizedBox(width: 12), separatorBuilder:
(_, __) => const SizedBox(width: 12),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final t = response.travelExpenses![index]; final t = response.travelExpenses![index];
return SizedBox( return SizedBox(
width: MediaQuery.of(context).size.width * 0.90, // card width width:
MediaQuery.of(context).size.width *
0.90, // card width
child: _travelExpenseCard( child: _travelExpenseCard(
travelType: t.travelType ?? "-", travelType: t.travelType ?? "-",
amount: t.fare ?? "0", amount: t.fare ?? "0",
...@@ -185,16 +239,10 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -185,16 +239,10 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
( (context) => Fileviewer(
context, fileName: t.imageDirFilePath ?? "",
) => Fileviewer( fileUrl: t.imageDirFilePath ?? "",
fileName: ),
t.imageDirFilePath ??
"",
fileUrl:
t.imageDirFilePath ??
"",
),
), ),
); );
}, },
...@@ -202,7 +250,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -202,7 +250,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
); );
}, },
), ),
) ),
], ],
const SizedBox(height: 10), const SizedBox(height: 10),
...@@ -212,7 +260,8 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -212,7 +260,8 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
const SizedBox(height: 10), const SizedBox(height: 10),
Padding( Padding(
padding: const EdgeInsets.only(left: 30.0), padding: const EdgeInsets.only(left: 30.0),
child: Text("Hotel Expenses", child: Text(
"Hotel Expenses",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
...@@ -227,10 +276,12 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -227,10 +276,12 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
child: ListView.separated( child: ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width * 0.04, horizontal:
MediaQuery.of(context).size.width * 0.04,
), ),
itemCount: response.hotelExpenses!.length, itemCount: response.hotelExpenses!.length,
separatorBuilder: (_, __) => const SizedBox(width: 12), separatorBuilder:
(_, __) => const SizedBox(width: 12),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final h = response.hotelExpenses![index]; final h = response.hotelExpenses![index];
return SizedBox( return SizedBox(
...@@ -247,16 +298,10 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -247,16 +298,10 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
( (context) => Fileviewer(
context, fileName: h.imageDirFilePath ?? "",
) => Fileviewer( fileUrl: h.imageDirFilePath ?? "",
fileName: ),
h.imageDirFilePath ??
"",
fileUrl:
h.imageDirFilePath ??
"",
),
), ),
); );
}, },
...@@ -274,7 +319,8 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -274,7 +319,8 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
const SizedBox(height: 10), const SizedBox(height: 10),
Padding( Padding(
padding: const EdgeInsets.only(left: 30.0), padding: const EdgeInsets.only(left: 30.0),
child: Text("Other Expenses", child: Text(
"Other Expenses",
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
...@@ -289,10 +335,12 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -289,10 +335,12 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
child: ListView.separated( child: ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width * 0.04, horizontal:
MediaQuery.of(context).size.width * 0.04,
), ),
itemCount: response.otherExpenses!.length, itemCount: response.otherExpenses!.length,
separatorBuilder: (_, __) => const SizedBox(width: 12), separatorBuilder:
(_, __) => const SizedBox(width: 12),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final o = response.otherExpenses![index]; final o = response.otherExpenses![index];
return SizedBox( return SizedBox(
...@@ -308,16 +356,10 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -308,16 +356,10 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
( (context) => Fileviewer(
context, fileName: o.imageDirFilePath ?? "",
) => Fileviewer( fileUrl: o.imageDirFilePath ?? "",
fileName: ),
o.imageDirFilePath ??
"",
fileUrl:
o.imageDirFilePath ??
"",
),
), ),
); );
}, },
...@@ -328,7 +370,6 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -328,7 +370,6 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
), ),
], ],
const SizedBox(height: 25), const SizedBox(height: 25),
], ],
), ),
...@@ -381,15 +422,17 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -381,15 +422,17 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(employeeName, Text(
style: TextStyle( employeeName,
fontSize: 14.5, style: TextStyle(
fontFamily: "JakartaMedium", fontSize: 14.5,
fontWeight: FontWeight.w600, fontFamily: "JakartaMedium",
color: AppColors.semi_black, fontWeight: FontWeight.w600,
) color: AppColors.semi_black,
),
), ),
Text(placeOfVisit, Text(
placeOfVisit,
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
...@@ -457,22 +500,24 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -457,22 +500,24 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
), ),
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
Text(travelType, Text(
style: TextStyle( travelType,
fontSize: 14.5, style: TextStyle(
fontFamily: "JakartaMedium", fontSize: 14.5,
fontWeight: FontWeight.w600, fontFamily: "JakartaMedium",
color: AppColors.semi_black, fontWeight: FontWeight.w600,
) color: AppColors.semi_black,
),
), ),
], ],
), ),
Text("₹$amount", Text(
style: TextStyle( "₹$amount",
fontFamily: "JakartaMedium", style: TextStyle(
fontSize: 14, fontFamily: "JakartaMedium",
color: AppColors.app_blue, fontSize: 14,
), color: AppColors.app_blue,
),
), ),
], ],
), ),
...@@ -483,7 +528,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -483,7 +528,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
const SizedBox(height: 2), const SizedBox(height: 2),
_buildKeyValue("To", to), _buildKeyValue("To", to),
const SizedBox(height: 2), const SizedBox(height: 2),
if ( imageUrl != null && imageUrl!.isNotEmpty) if (imageUrl != null && imageUrl!.isNotEmpty)
_buildKeyValue("Image", "View", isLink: true, onTap: onViewTap), _buildKeyValue("Image", "View", isLink: true, onTap: onViewTap),
], ],
), ),
...@@ -524,29 +569,27 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -524,29 +569,27 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
CircleAvatar( CircleAvatar(
radius: 20, radius: 20,
backgroundColor: const Color(0xffFCE4EC), backgroundColor: const Color(0xffFCE4EC),
child: child: SvgPicture.asset("assets/svg/hrm/hotel_ic.svg"),
SvgPicture.asset(
"assets/svg/hrm/hotel_ic.svg",
),
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
Text(hotelName, Text(
style: TextStyle( hotelName,
style: TextStyle(
fontSize: 14.5, fontSize: 14.5,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.semi_black, color: AppColors.semi_black,
) ),
), ),
], ],
), ),
Text("₹$amount", Text(
style: TextStyle( "₹$amount",
fontFamily: "JakartaMedium", style: TextStyle(
fontSize: 14, fontFamily: "JakartaMedium",
color: AppColors.app_blue, fontSize: 14,
), color: AppColors.app_blue,
),
), ),
], ],
), ),
...@@ -557,8 +600,8 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -557,8 +600,8 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
const SizedBox(height: 2), const SizedBox(height: 2),
_buildKeyValue("To", toDate), _buildKeyValue("To", toDate),
const SizedBox(height: 2), const SizedBox(height: 2),
if ( imageUrl != null && imageUrl!.isNotEmpty) if (imageUrl != null && imageUrl!.isNotEmpty)
_buildKeyValue("Image", "View", isLink: true, onTap: onViewTap), _buildKeyValue("Image", "View", isLink: true, onTap: onViewTap),
], ],
), ),
); );
...@@ -597,28 +640,27 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -597,28 +640,27 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
CircleAvatar( CircleAvatar(
radius: 20, radius: 20,
backgroundColor: const Color(0xffEDE7F6), backgroundColor: const Color(0xffEDE7F6),
child: SvgPicture.asset( child: SvgPicture.asset("assets/svg/hrm/books_ic.svg"),
"assets/svg/hrm/books_ic.svg",
),
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
Text( Text(
description, description,
style: TextStyle( style: TextStyle(
fontSize: 14.5, fontSize: 14.5,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.semi_black, color: AppColors.semi_black,
) ),
), ),
], ],
), ),
Text("₹$amount", Text(
style: TextStyle( "₹$amount",
fontFamily: "JakartaMedium", style: TextStyle(
fontSize: 14, fontFamily: "JakartaMedium",
color: AppColors.app_blue, fontSize: 14,
), color: AppColors.app_blue,
),
), ),
], ],
), ),
...@@ -629,8 +671,8 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -629,8 +671,8 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
const SizedBox(height: 2), const SizedBox(height: 2),
_buildKeyValue("Description", description), _buildKeyValue("Description", description),
const SizedBox(height: 2), const SizedBox(height: 2),
if ( imageUrl != null && imageUrl!.isNotEmpty) if (imageUrl != null && imageUrl!.isNotEmpty)
_buildKeyValue("Image", "View", isLink: true, onTap: onViewTap), _buildKeyValue("Image", "View", isLink: true, onTap: onViewTap),
], ],
), ),
); );
...@@ -639,56 +681,59 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -639,56 +681,59 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
Widget _buildSectionHeader(String title) { Widget _buildSectionHeader(String title) {
return Row( return Row(
children: [ children: [
Text(title, Text(
style: const TextStyle( title,
fontSize: 14, style: const TextStyle(fontSize: 14, fontFamily: "JakartaSemiBold"),
fontFamily: "JakartaSemiBold",
)
), ),
const SizedBox(width: 16), const SizedBox(width: 16),
Expanded( Expanded(
child: DottedLine( child: DottedLine(
dashGapLength: 3, dashGapLength: 3,
dashGapColor: dashGapColor: Colors.white,
Colors.white, dashColor: AppColors.grey_semi,
dashColor: AppColors.grey_semi, dashLength: 2,
dashLength: 2, lineThickness: 0.5,
lineThickness: 0.5, ),
), ),
)
], ],
); );
} }
Widget _buildKeyValue(String key, String value, Widget _buildKeyValue(
{bool isLink = false, VoidCallback? onTap}) { String key,
String value, {
bool isLink = false,
VoidCallback? onTap,
}) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 3.5, horizontal: 2), padding: const EdgeInsets.symmetric(vertical: 3.5, horizontal: 2),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text(key, Text(
style: TextStyle( key,
fontFamily: "JakartaRegular", style: TextStyle(
fontSize: 14, fontFamily: "JakartaRegular",
color: AppColors.semi_black, fontSize: 14,
), color: AppColors.semi_black,
),
), ),
isLink isLink
? GestureDetector( ? GestureDetector(
onTap: onTap, onTap: onTap,
child: const Text("View", child: const Text(
style: TextStyle( "View",
style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.blue)), color: Colors.blue,
) ),
: Text(value, ),
style: const TextStyle( )
fontSize: 14, : Text(
color: Color(0xFF818181), value,
style: const TextStyle(fontSize: 14, color: Color(0xFF818181)),
), ),
),
], ],
), ),
); );
...@@ -735,7 +780,9 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -735,7 +780,9 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
color: Color(0xFFE6F6FF), color: Color(0xFFE6F6FF),
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: SvgPicture.asset("assets/svg/hrm/tour_main_ic.svg"), child: SvgPicture.asset(
"assets/svg/hrm/tour_main_ic.svg",
),
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
Expanded( Expanded(
...@@ -743,36 +790,43 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -743,36 +790,43 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(title, Text(
style: const TextStyle( title,
fontSize: 14, style: const TextStyle(
fontFamily: "JakartaRegular", fontSize: 14,
color: Color(0xff2D2D2D) fontFamily: "JakartaRegular",
) color: Color(0xff2D2D2D),
),
), ),
const SizedBox(height: 3), const SizedBox(height: 3),
Text(date, Text(
style: const TextStyle( date,
fontSize: 12, style: const TextStyle(
color: Color(0xff818181) fontSize: 12,
) color: Color(0xff818181),
),
), ),
], ],
), ),
), ),
Container( Container(
padding: padding: const EdgeInsets.symmetric(
const EdgeInsets.symmetric(horizontal: 10, vertical: 6), horizontal: 10,
vertical: 6,
),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
color: _getStatusBgColor(status), color: _getStatusBgColor(status),
), ),
child: Text(status, child: Text(
style: TextStyle( status,
fontSize: 14, style: TextStyle(
fontFamily: "JakartaRegular", fontSize: 14,
color: _getStatusTxtColor(status))), fontFamily: "JakartaRegular",
) color: _getStatusTxtColor(status),
),
),
),
], ],
), ),
...@@ -784,11 +838,12 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -784,11 +838,12 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
child: Row( child: Row(
children: [ children: [
const Text("Amount Details", const Text(
style: TextStyle( "Amount Details",
fontSize: 14, style: TextStyle(
fontFamily: "JakartaSemiBold", fontSize: 14,
) fontFamily: "JakartaSemiBold",
),
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
Expanded( Expanded(
...@@ -806,37 +861,40 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -806,37 +861,40 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
const SizedBox(height: 6), const SizedBox(height: 6),
Column( Column(
children: details.map((d) { children:
return Padding( details.map((d) {
padding: const EdgeInsets.symmetric(vertical: 8), return Padding(
child: Row( padding: const EdgeInsets.symmetric(vertical: 8),
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expanded( children: [
flex: 4, Expanded(
child: Text(d["key"] ?? "-", flex: 4,
child: Text(
d["key"] ?? "-",
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: AppColors.semi_black, color: AppColors.semi_black,
fontFamily: "JakartaRegular", fontFamily: "JakartaRegular",
) ),
) ),
), ),
Expanded( Expanded(
flex: 3, flex: 3,
child: Text(d["value"] ?? "-", child: Text(
d["value"] ?? "-",
textAlign: TextAlign.right, textAlign: TextAlign.right,
style: const TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
fontFamily: "JakartaRegular", fontFamily: "JakartaRegular",
color: Color(0xff818181) color: Color(0xff818181),
) ),
) ),
),
],
), ),
], );
), }).toList(),
);
}).toList(),
), ),
], ],
...@@ -848,13 +906,14 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -848,13 +906,14 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text(showMore ? "Hide Details" : "View Details", Text(
style: TextStyle( showMore ? "Hide Details" : "View Details",
fontSize: 14, style: TextStyle(
fontFamily: "JakartaMedium", fontSize: 14,
fontWeight: FontWeight.w500, fontFamily: "JakartaMedium",
color: AppColors.app_blue, fontWeight: FontWeight.w500,
) color: AppColors.app_blue,
),
), ),
const SizedBox(width: 6), const SizedBox(width: 6),
Transform.flip( Transform.flip(
...@@ -865,11 +924,11 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -865,11 +924,11 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
width: 20, width: 20,
color: AppColors.app_blue, color: AppColors.app_blue,
), ),
) ),
], ],
), ),
), ),
) ),
], ],
), ),
), ),
...@@ -877,6 +936,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -877,6 +936,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
}, },
); );
} }
///travel icons ///travel icons
String _getTravelIcon(String? travelType) { String _getTravelIcon(String? travelType) {
switch (travelType?.toLowerCase()) { switch (travelType?.toLowerCase()) {
...@@ -897,7 +957,6 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -897,7 +957,6 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
} }
} }
/// Avatar color generator /// Avatar color generator
Color _getStatusBgColor(value) { Color _getStatusBgColor(value) {
var color = AppColors.approved_bg_color; var color = AppColors.approved_bg_color;
...@@ -921,10 +980,10 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -921,10 +980,10 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
return AppColors.rejected_text_color; return AppColors.rejected_text_color;
case 'Expired at TL': case 'Expired at TL':
return AppColors.rejected_text_color; return AppColors.rejected_text_color;
} }
return color; return color;
} }
getText(value) { getText(value) {
switch (value) { switch (value) {
case 'HR Approved': case 'HR Approved':
...@@ -939,5 +998,4 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{ ...@@ -939,5 +998,4 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
return "Requested"; return "Requested";
} }
} }
} }
...@@ -4,7 +4,6 @@ import 'package:flutter/foundation.dart'; ...@@ -4,7 +4,6 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/screens/commom/accountsListDetails.dart';
import 'package:graphview/GraphView.dart'; import 'package:graphview/GraphView.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../Models/hrmmodels/ogresponse.dart'; import '../../Models/hrmmodels/ogresponse.dart';
......
...@@ -126,7 +126,10 @@ class _GeneratorPartDetailsScreenState ...@@ -126,7 +126,10 @@ class _GeneratorPartDetailsScreenState
child: Column( child: Column(
children: [ children: [
Card( Card(
margin: EdgeInsets.symmetric(horizontal: 0,vertical: 2), margin: EdgeInsets.symmetric(
horizontal: 0,
vertical: 2,
),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30), bottomLeft: Radius.circular(30),
...@@ -344,13 +347,13 @@ class _GeneratorPartDetailsScreenState ...@@ -344,13 +347,13 @@ class _GeneratorPartDetailsScreenState
Container( Container(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
padding: EdgeInsets.only(left: 10,top: 10), padding: EdgeInsets.only(left: 10, top: 10),
child: Text( child: Text(
"Product Details", "Product Details",
style: TextStyle( style: TextStyle(
color: AppColors.grey_thick, color: AppColors.grey_thick,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14 fontSize: 14,
), ),
), ),
), ),
...@@ -425,7 +428,7 @@ class _GeneratorPartDetailsScreenState ...@@ -425,7 +428,7 @@ class _GeneratorPartDetailsScreenState
Expanded( Expanded(
child: Text( child: Text(
values[j] == "" ? "-" : values[j], values[j] == "" ? "-" : values[j],
textAlign:TextAlign.right, textAlign: TextAlign.right,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: AppColors.grey_semi, color: AppColors.grey_semi,
...@@ -495,7 +498,7 @@ class _GeneratorPartDetailsScreenState ...@@ -495,7 +498,7 @@ class _GeneratorPartDetailsScreenState
Expanded( Expanded(
child: Text( child: Text(
values[j] == "" ? "-" : values[j], values[j] == "" ? "-" : values[j],
textAlign:TextAlign.right, textAlign: TextAlign.right,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontFamily: "JakartaRegular", fontFamily: "JakartaRegular",
...@@ -560,7 +563,6 @@ class _GeneratorPartDetailsScreenState ...@@ -560,7 +563,6 @@ class _GeneratorPartDetailsScreenState
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
provider.partData.prodDesc == "" provider.partData.prodDesc == ""
...@@ -569,7 +571,7 @@ class _GeneratorPartDetailsScreenState ...@@ -569,7 +571,7 @@ class _GeneratorPartDetailsScreenState
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: AppColors.grey_semi, color: AppColors.grey_semi,
fontFamily: "JakartaRegular" fontFamily: "JakartaRegular",
), ),
), ),
), ),
...@@ -815,7 +817,7 @@ class _GeneratorPartDetailsScreenState ...@@ -815,7 +817,7 @@ class _GeneratorPartDetailsScreenState
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
"${headings[index]}", headings[index],
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
), ),
...@@ -881,7 +883,7 @@ class _GeneratorPartDetailsScreenState ...@@ -881,7 +883,7 @@ class _GeneratorPartDetailsScreenState
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
"${headings[index]}", headings[index],
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
), ),
...@@ -960,7 +962,7 @@ class _GeneratorPartDetailsScreenState ...@@ -960,7 +962,7 @@ class _GeneratorPartDetailsScreenState
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
"${headings[index]}", headings[index],
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
), ),
...@@ -1122,7 +1124,7 @@ class _GeneratorPartDetailsScreenState ...@@ -1122,7 +1124,7 @@ class _GeneratorPartDetailsScreenState
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
"Inventory ${type}", "Inventory $type",
style: TextStyle( style: TextStyle(
color: AppColors.app_blue, color: AppColors.app_blue,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
...@@ -1253,7 +1255,12 @@ class _GeneratorPartDetailsScreenState ...@@ -1253,7 +1255,12 @@ class _GeneratorPartDetailsScreenState
color: AppColors.grey_semi, color: AppColors.grey_semi,
fontSize: 14, fontSize: 14,
), ),
contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0), contentPadding: EdgeInsets.fromLTRB(
5.0,
10.0,
5.0,
10.0,
),
enabledBorder: InputBorder.none, enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
hintText: 'Enter Description', hintText: 'Enter Description',
......
...@@ -81,13 +81,13 @@ class _InventoryScreenState extends State<InventoryScreen> { ...@@ -81,13 +81,13 @@ class _InventoryScreenState extends State<InventoryScreen> {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbarNew(context, "Gen Inventory",0xFFFFFFFF), appBar: appbarNew(context, "Gen Inventory", 0xFFFFFFFF),
body: Container( body: Container(
decoration: BoxDecoration(color: Colors.black), decoration: BoxDecoration(color: Colors.black),
child: Column( child: Column(
children: [ children: [
Spacer(), Spacer(),
Container( SizedBox(
height: 250, height: 250,
child: QRView( child: QRView(
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/financeProvider/RequestionListProvider.dart'; import 'package:generp/Notifiers/financeProvider/RequestionListProvider.dart';
import 'package:generp/Utils/GlobalConstants.dart'; import 'package:generp/Utils/GlobalConstants.dart';
...@@ -84,17 +82,17 @@ class _AllpaymentrequesitionlistsbymodesoldState ...@@ -84,17 +82,17 @@ class _AllpaymentrequesitionlistsbymodesoldState
} }
return connection == "Online" return connection == "Online"
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () { onWillPop: () {
return onBackPressed(context); return onBackPressed(context);
}, },
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
...@@ -157,294 +155,294 @@ class _AllpaymentrequesitionlistsbymodesoldState ...@@ -157,294 +155,294 @@ class _AllpaymentrequesitionlistsbymodesoldState
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body:
provider.isLoading provider.isLoading
? Center( ? Center(
child: CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue, AppColors.app_blue,
), ),
),
)
: requestLists.isNotEmpty
? SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (requestLists.isEmpty) {
return SizedBox(
child: Center(child: Text("No Data Available")),
);
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
), ),
child: Column( )
children: [ : requestLists.isNotEmpty
Row( ? SizedBox(
children: [ child: Scrollbar(
Expanded( thumbVisibility: false,
flex: 1, child: ListView.builder(
child: Container( itemCount: requestLists.length,
height: 50, shrinkWrap: true,
width: 35, physics: AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.all(8.0), itemBuilder: (context, index) {
decoration: BoxDecoration( if (requestLists.isEmpty) {
color: Color(0xFFFFF3CE), return SizedBox(
borderRadius: BorderRadius.circular( child: Center(child: Text("No Data Available")),
8, );
), }
), return Container(
child: SvgPicture.asset( padding: EdgeInsets.symmetric(
"assets/svg/fin_ic.svg", horizontal: 10,
), vertical: 10,
), ),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
), ),
SizedBox(width: 10), child: Column(
Expanded( children: [
flex: 4, Row(
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Expanded(
requestLists[index].accountName!, flex: 1,
style: TextStyle( child: Container(
fontFamily: "JakartaMedium", height: 50,
fontSize: 14, width: 35,
color: AppColors.semi_black, padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(
8,
),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
), ),
), ),
Text( SizedBox(width: 10),
"₹" Expanded(
"${requestLists[index].amount}", flex: 4,
style: TextStyle( child: SizedBox(
fontFamily: "JakartaMedium", child: Column(
fontSize: 14, crossAxisAlignment:
color: AppColors.app_blue, CrossAxisAlignment.start,
children: [
Text(
requestLists[index].accountName!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"₹"
"${requestLists[index].amount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8,
),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
requestLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
),
),
), ),
), ),
], ],
), ),
), Divider(
), thickness: 0.5,
Expanded( color: Color(0xFFD7D7D7),
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8,
),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
requestLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
),
), ),
), ...List.generate(4, (j) {
), final headings = [
], "Requesting Propose",
), "Attachment",
Divider( "Requested Date",
thickness: 0.5, "Note",
color: Color(0xFFD7D7D7), ];
),
...List.generate(4, (j) {
final headings = [
"Requesting Propose",
"Attachment",
"Requested Date",
"Note",
];
final subHeadings = [ final subHeadings = [
requestLists[index].requestingPurpose, requestLists[index].requestingPurpose,
"View", "View",
// requestLists[index].attachmentDirFilePath // requestLists[index].attachmentDirFilePath
requestLists[index].date, requestLists[index].date,
requestLists[index].description, requestLists[index].description,
]; ];
if (j == 1 && if (j == 1 &&
requestLists[index] requestLists[index]
.attachmentViewFileName == .attachmentViewFileName ==
"") { "") {
return SizedBox.shrink(); return SizedBox.shrink();
} }
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 5), padding: EdgeInsets.symmetric(vertical: 5),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
headings[j], headings[j],
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
color: AppColors.semi_black, color: AppColors.semi_black,
), ),
), ),
), ),
Expanded( Expanded(
child: InkResponse( child: InkResponse(
onTap: onTap:
j != 1 j != 1
? null ? null
: () { : () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
( (
context, context,
) => Fileviewer( ) => Fileviewer(
fileName: fileName:
requestLists[index] requestLists[index]
.attachmentViewFileName!, .attachmentViewFileName!,
fileUrl: fileUrl:
requestLists[index] requestLists[index]
.attachmentDirFilePath!, .attachmentDirFilePath!,
),
),
);
},
child: Text(
subHeadings[j]!,
style: TextStyle(
fontSize: 14,
color:
j == 1
? AppColors.app_blue
: Color(0xFF818181),
decoration:
j == 1
? TextDecoration
.underline
: TextDecoration.none,
decorationColor:
j == 1
? AppColors.app_blue
: AppColors.white,
),
),
), ),
), ),
); ],
}, ),
child: Text( );
subHeadings[j]!, }),
style: TextStyle( InkResponse(
fontSize: 14, onTap: () async {
color: var res = await Navigator.push(
j == 1 context,
? AppColors.app_blue MaterialPageRoute(
: Color(0xFF818181), builder:
decoration: (context) =>
j == 1 Paymentrequestionlistdetails(
? TextDecoration pageName:
.underline widget.pageTitleName,
: TextDecoration.none, mode: widget.mode,
decorationColor: paymentRequestId:
j == 1 requestLists[index].id,
? AppColors.app_blue ),
: AppColors.white, settings: RouteSettings(
name: "Paymentrequestionlistdetails",
),
), ),
);
if (routeSettingName ==
"Paymentrequestionlistdetails") {
print("croos refresh");
provider
.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
}
// if (res == true) {
// print("android refresh");
// provider
// .paymentRequestionListsAPIFunction(
// context,
// widget.mode,
// "",
// "",
// );
// }
// if (Platform.isIOS) {
// print("IOS Refresh");
// if (didPushed == "true" ||
// didPopped == "true") {
// provider
// .paymentRequestionListsAPIFunction(
// context,
// widget.mode,
// "",
// "",
// );
// }
// }
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
), ),
), ),
), ),
], ],
), ),
); );
}), },
InkResponse( ),
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentrequestionlistdetails(
pageName:
widget.pageTitleName,
mode: widget.mode,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name: "Paymentrequestionlistdetails",
),
),
);
if (routeSettingName ==
"Paymentrequestionlistdetails") {
print("croos refresh");
provider
.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
}
// if (res == true) {
// print("android refresh");
// provider
// .paymentRequestionListsAPIFunction(
// context,
// widget.mode,
// "",
// "",
// );
// }
// if (Platform.isIOS) {
// print("IOS Refresh");
// if (didPushed == "true" ||
// didPopped == "true") {
// provider
// .paymentRequestionListsAPIFunction(
// context,
// widget.mode,
// "",
// "",
// );
// }
// }
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
],
), ),
); )
}, : Emptywidget(context),
),
),
)
: Emptywidget(context),
); );
}, },
); );
......
...@@ -34,60 +34,59 @@ class _MyHomePageOldState extends State<MyHomePageOld> { ...@@ -34,60 +34,59 @@ class _MyHomePageOldState extends State<MyHomePageOld> {
// TODO: implement initState // TODO: implement initState
_connectivity.initialise(); _connectivity.initialise();
_connectivity.myStream.listen((source) { _connectivity.myStream.listen((source) {
setState(() => _source = source); setState(() => _source = source);
}); });
var prov = Provider.of<HomescreenNotifier>(context, listen: false); var prov = Provider.of<HomescreenNotifier>(context, listen: false);
var prof_prov = Provider.of<ProfileNotifer>(context, listen: false); var profProv = Provider.of<ProfileNotifer>(context, listen: false);
Future.microtask(() { Future.microtask(() {
prov.DashboardApiFunction(context); prov.DashboardApiFunction(context);
}); });
Future.delayed(Duration(milliseconds: 600), () { Future.delayed(Duration(milliseconds: 600), () {
prof_prov.ProfileApiFunction(prov, context); profProv.ProfileApiFunction(prov, context);
prof_prov.VersionApiFunction(); profProv.VersionApiFunction();
}); });
super.initState(); super.initState();
} }
Future<bool> onBackPressed() async { Future<bool> onBackPressed() async {
return await showDialog<bool>( return await showDialog<bool>(
context: context, context: context,
builder: builder:
(context) => AlertDialog( (context) => AlertDialog(
title: const Text('Are you sure?'), title: const Text('Are you sure?'),
content: const Text('Do you want to exit the App'), content: const Text('Do you want to exit the App'),
actions: [ actions: [
TextButton( TextButton(
style: ButtonStyle( style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.white), backgroundColor: WidgetStateProperty.all(Colors.white),
overlayColor: MaterialStateProperty.all(Colors.white), overlayColor: WidgetStateProperty.all(Colors.white),
), ),
onPressed: () => Navigator.of(context).pop(false), onPressed: () => Navigator.of(context).pop(false),
child: Text( child: Text(
"NO", "NO",
style: TextStyle(fontWeight: FontWeight.w500), style: TextStyle(fontWeight: FontWeight.w500),
), ),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
TextButton( TextButton(
style: ButtonStyle( style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.white), backgroundColor: WidgetStateProperty.all(Colors.white),
overlayColor: MaterialStateProperty.all(Colors.white70), overlayColor: WidgetStateProperty.all(Colors.white70),
), ),
onPressed: onPressed:
() => SystemChannels.platform.invokeMethod( () => SystemChannels.platform.invokeMethod(
'SystemNavigator.pop', 'SystemNavigator.pop',
), ),
child: Text( child: Text(
"YES", "YES",
style: TextStyle(fontWeight: FontWeight.w500), style: TextStyle(fontWeight: FontWeight.w500),
), ),
), ),
], ],
elevation: 30.0, elevation: 30.0,
), ),
barrierDismissible: false, barrierDismissible: false,
) ?? ) ??
false; false;
} }
...@@ -100,7 +99,7 @@ class _MyHomePageOldState extends State<MyHomePageOld> { ...@@ -100,7 +99,7 @@ class _MyHomePageOldState extends State<MyHomePageOld> {
LocationPermission permission = await Geolocator.checkPermission(); LocationPermission permission = await Geolocator.checkPermission();
hasLocationPermission = hasLocationPermission =
permission == LocationPermission.always || permission == LocationPermission.always ||
permission == LocationPermission.whileInUse; permission == LocationPermission.whileInUse;
final loc.Location location = loc.Location(); final loc.Location location = loc.Location();
bool serviceEnabled; bool serviceEnabled;
...@@ -135,491 +134,491 @@ class _MyHomePageOldState extends State<MyHomePageOld> { ...@@ -135,491 +134,491 @@ class _MyHomePageOldState extends State<MyHomePageOld> {
} }
return (connection == 'Online') return (connection == 'Online')
? Consumer2<HomescreenNotifier, ProfileNotifer>( ? Consumer2<HomescreenNotifier, ProfileNotifer>(
builder: (context, homescreen, profile, child) { builder: (context, homescreen, profile, child) {
// Define the original data // Define the original data
final names = [ final names = [
"Attendance", "Attendance",
"Finance", "Finance",
"CRM", "CRM",
"Orders", "Orders",
"ERP", "ERP",
"Service Engineer", "Service Engineer",
"Gen Tracker", "Gen Tracker",
// "Nearby", // "Nearby",
"Inventory", "Inventory",
"Whizzdom", "Whizzdom",
// "Common", // "Common",
]; ];
final icons = [ final icons = [
"assets/svg/home_icons_1.svg", "assets/svg/home_icons_1.svg",
"assets/svg/home_icons_10.svg", "assets/svg/home_icons_10.svg",
"assets/svg/home_icons_12.svg", "assets/svg/home_icons_12.svg",
"assets/svg/home_icons_11.svg", "assets/svg/home_icons_11.svg",
"assets/svg/home_icons_2.svg", "assets/svg/home_icons_2.svg",
"assets/svg/home_icons_4.svg", "assets/svg/home_icons_4.svg",
"assets/svg/home_icons_31.svg", "assets/svg/home_icons_31.svg",
// "assets/svg/home_icons_5.svg", // "assets/svg/home_icons_5.svg",
"assets/svg/home_icons_6.svg", "assets/svg/home_icons_6.svg",
"assets/svg/home_icons_81.svg", "assets/svg/home_icons_81.svg",
// "assets/svg/home_icons_9.svg", // "assets/svg/home_icons_9.svg",
]; ];
final requiredRoles = [ final requiredRoles = [
"430", "430",
"430", "430",
"430", "430",
"430", "430",
"431", "431",
"433", "433",
"434", "434",
// "433", // "433",
"432", "432",
"431", "431",
// "430", // "430",
]; ];
final filteredItems = <Map<String, String>>[]; final filteredItems = <Map<String, String>>[];
for (int i = 0; i < names.length; i++) { for (int i = 0; i < names.length; i++) {
if (homescreen.roleStatus.contains(requiredRoles[i])) { if (homescreen.roleStatus.contains(requiredRoles[i])) {
filteredItems.add({'name': names[i], 'icon': icons[i]}); filteredItems.add({'name': names[i], 'icon': icons[i]});
} }
} }
return WillPopScope( return WillPopScope(
onWillPop: onBackPressed, onWillPop: onBackPressed,
child: RefreshIndicator.adaptive( child: RefreshIndicator.adaptive(
color: AppColors.app_blue, color: AppColors.app_blue,
onRefresh: () async { onRefresh: () async {
await Future.delayed(const Duration(milliseconds: 600)); await Future.delayed(const Duration(milliseconds: 600));
homescreen.DashboardApiFunction(context); homescreen.DashboardApiFunction(context);
}, },
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: Platform.isIOS ? false : true, bottom: Platform.isIOS ? false : true,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: Container( body: Container(
child: Column( child: Column(
children: [ children: [
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 10), padding: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
bottom: Radius.circular(30), bottom: Radius.circular(30),
), ),
),
child: Container(
margin: EdgeInsets.only(
bottom: 15,
left: 15,
right: 15,
top: 30,
),
padding: EdgeInsets.only(bottom: 15, right: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
gradient: LinearGradient(
colors: [
AppColors.profile_card_gradient1,
AppColors.profile_card_gradient2,
],
), ),
), child: Container(
child: Row( margin: EdgeInsets.only(
crossAxisAlignment: CrossAxisAlignment.center, bottom: 15,
children: [ left: 15,
Expanded( right: 15,
flex: 2, top: 30,
child: SizedBox( ),
child: Column( padding: EdgeInsets.only(bottom: 15, right: 10),
mainAxisAlignment: decoration: BoxDecoration(
MainAxisAlignment.center, borderRadius: BorderRadius.circular(30),
gradient: LinearGradient(
children: [ colors: [
SizedBox( AppColors.profile_card_gradient1,
width: 66, AppColors.profile_card_gradient2,
height: 66, ],
child: ClipRRect( ),
borderRadius: ),
BorderRadius.circular(50), child: Row(
child: CachedNetworkImage( crossAxisAlignment: CrossAxisAlignment.center,
cacheKey: children: [
profile.profileImage, Expanded(
fit: BoxFit.cover, flex: 2,
imageUrl: child: SizedBox(
"${profile.profileImage}", child: Column(
useOldImageOnUrlChange: false, mainAxisAlignment:
placeholder: MainAxisAlignment.center,
(context, url) =>
CircularProgressIndicator.adaptive(), children: [
errorWidget: SizedBox(
(context, url, error) => width: 66,
Icon(Icons.error), height: 66,
child: ClipRRect(
borderRadius:
BorderRadius.circular(50),
child: CachedNetworkImage(
cacheKey:
profile.profileImage,
fit: BoxFit.cover,
imageUrl:
"${profile.profileImage}",
useOldImageOnUrlChange: false,
placeholder:
(context, url) =>
CircularProgressIndicator.adaptive(),
errorWidget:
(context, url, error) =>
Icon(Icons.error),
),
),
), ),
),
),
Row( Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Container(
width: 13,
height: 13,
decoration: BoxDecoration(
shape: BoxShape.circle,
color:
homescreen.onlineStatus ==
"Online"
? Colors.green
: Colors.yellow,
),
),
SizedBox(width: 6),
Text(
"${homescreen.onlineStatus}",
style: TextStyle(
fontSize: 16,
fontFamily: "JakartaMedium",
color: Color(0xFF2D2D2D),
),
),
],
),
],
),
),
),
Expanded(
flex: 3,
child: Container(
padding: EdgeInsets.only(right: 10),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
children: [ children: [
Container( // Text(
width: 13, // "${profile.employeeName}",
height: 13, // maxLines: 1,
decoration: BoxDecoration( // style: TextStyle(
shape: BoxShape.circle, // color: AppColors.app_blue,
color: // fontFamily: "JakartaSemiBold",
homescreen.onlineStatus == // fontSize: 18,
"Online" // ),
? Colors.green // ),
: Colors.yellow, AutoSizeText(
'${profile.employeeName}',
maxFontSize: 18,
minFontSize: 12,
style: TextStyle(
fontSize: 18,
color: AppColors.app_blue,
fontFamily: "JakartaRegular",
), ),
maxLines: 2,
), ),
SizedBox(width: 6), AutoSizeText(
Text( '(${profile.designation})',
"${homescreen.onlineStatus}", maxFontSize: 14,
minFontSize: 10,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 14,
fontFamily: "JakartaMedium", color: AppColors.semi_black,
color: Color(0xFF2D2D2D), fontFamily: "JakartaRegular",
), ),
maxLines: 1,
), ),
], // Text(
), // "${profile.designation}",
], // maxLines: 1,
), // style: TextStyle(
), // color: AppColors.semi_black,
), // fontFamily: "JakartaRegular",
Expanded( // fontSize: 14,
flex: 3, // ),
child: Container( // ),
padding: EdgeInsets.only(right: 10), Text(
child: Column( "${profile.employeeeID}",
crossAxisAlignment: style: TextStyle(
CrossAxisAlignment.start, color: AppColors.semi_black,
mainAxisAlignment: fontFamily: "JakartaRegular",
MainAxisAlignment.center, fontSize: 14,
children: [
// Text(
// "${profile.employeeName}",
// maxLines: 1,
// style: TextStyle(
// color: AppColors.app_blue,
// fontFamily: "JakartaSemiBold",
// fontSize: 18,
// ),
// ),
AutoSizeText(
'${profile.employeeName}',
maxFontSize: 18,
minFontSize: 12,
style: TextStyle(
fontSize: 18,
color: AppColors.app_blue,
fontFamily: "JakartaRegular",
),
maxLines: 2,
),
AutoSizeText(
'(${profile.designation})',
maxFontSize: 14,
minFontSize: 10,
style: TextStyle(
fontSize: 14,
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
),
maxLines: 1,
),
// Text(
// "${profile.designation}",
// maxLines: 1,
// style: TextStyle(
// color: AppColors.semi_black,
// fontFamily: "JakartaRegular",
// fontSize: 14,
// ),
// ),
Text(
"${profile.employeeeID}",
style: TextStyle(
color: AppColors.semi_black,
fontFamily: "JakartaRegular",
fontSize: 14,
),
),
InkResponse(
onTap: () {
_showProfileBottomSheet(
context,
);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
"View Profile",
style: TextStyle(
color: AppColors.app_blue,
fontFamily:
"JakartaRegular",
fontSize: 14,
),
), ),
SizedBox(width: 5), ),
SizedBox( InkResponse(
width: 15, onTap: () {
height: 15, _showProfileBottomSheet(
child: Center( context,
child: SvgPicture.asset( );
"assets/svg/next_button.svg", },
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
"View Profile",
style: TextStyle(
color: AppColors.app_blue,
fontFamily:
"JakartaRegular",
fontSize: 14,
),
), ),
), SizedBox(width: 5),
SizedBox(
width: 15,
height: 15,
child: Center(
child: SvgPicture.asset(
"assets/svg/next_button.svg",
),
),
),
],
), ),
], ),
), ],
), ),
], ),
), ),
), ],
), ),
], ),
), ),
), ),
), Expanded(
), flex: 10,
Expanded( child: Container(
flex: 10, padding: EdgeInsets.only(
child: Container( left: 20,
padding: EdgeInsets.only( right: 20,
left: 20, top: 0,
right: 20, bottom: 10,
top: 0, ),
bottom: 10, margin: EdgeInsets.only(top: 10),
), child: GridView.builder(
margin: EdgeInsets.only(top: 10), itemCount: filteredItems.length,
child: GridView.builder( gridDelegate:
itemCount: filteredItems.length, SliverGridDelegateWithFixedCrossAxisCount(
gridDelegate: crossAxisCount: 2,
SliverGridDelegateWithFixedCrossAxisCount( crossAxisSpacing: 10,
crossAxisCount: 2, mainAxisSpacing: 10,
crossAxisSpacing: 10, ),
mainAxisSpacing: 10, itemBuilder: (context, index) {
), final item = filteredItems[index];
itemBuilder: (context, index) { return InkResponse(
final item = filteredItems[index]; onTap: () async {
return InkResponse( var res;
onTap: () async { switch (item['name']) {
var res; case "Attendance":
switch (item['name']) { res = await Navigator.push(
case "Attendance": context,
res = await Navigator.push( MaterialPageRoute(
context, builder:
MaterialPageRoute( (context) =>
builder: AttendanceScreen(),
(context) => settings: RouteSettings(
AttendanceScreen(), arguments: 'AttendanceScreen',
settings: RouteSettings( ),
arguments: 'AttendanceScreen', ),
), );
), break;
); case "ERP":
break; bool isGpsEnabled =
case "ERP": await Geolocator.isLocationServiceEnabled();
bool isGpsEnabled = if (isGpsEnabled) {
await Geolocator.isLocationServiceEnabled(); if (Platform.isAndroid) {
if (isGpsEnabled) { res = await Navigator.push(
if (Platform.isAndroid) { context,
MaterialPageRoute(
builder:
(context) => WebErpScreen(
erp_url:
homescreen
.webPageUrl,
),
),
);
} else {
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => WebERPIOS(
url:
homescreen
.webPageUrl,
),
),
);
}
} else {
requestGpsPermission();
}
break;
case "Gen Tracker":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Gentrackerdashboard(),
settings: RouteSettings(
arguments:
'Gentrackerdashboard',
),
),
);
break;
case "Service Engineer":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Serviceengineerdashboard(),
),
);
break;
case "Nearby":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Nearbygenerators(),
),
);
break;
case "Inventory":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
InventoryScreen(),
),
);
break;
case "Whizzdom":
bool isGpsEnabled =
await Geolocator.isLocationServiceEnabled();
if (isGpsEnabled) {
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => WebWhizzdomScreen(
whizzdom_url:
homescreen
.whizzdomPageUrl,
),
),
);
} else {
requestGpsPermission();
}
break;
case "Common":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Commondashboard(),
),
);
break;
case "Finance":
res = await Navigator.push( res = await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => WebErpScreen( (context) =>
erp_url: Financedashboard(),
homescreen settings: RouteSettings(
.webPageUrl, arguments: 'Financedashboard',
), ),
), ),
); );
} else { break;
case "Orders":
res = await Navigator.push( res = await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => WebERPIOS( (context) =>
url: Ordermoduledashboard(),
homescreen ),
.webPageUrl, );
case "CRM":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
CrmdashboardScreen(),
settings: RouteSettings(
name: 'CrmdashboardScreen',
), ),
), ),
); );
} default:
} else { print("111");
requestGpsPermission(); break;
} }
if (res == true) {
break; homescreen.DashboardApiFunction(
case "Gen Tracker":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Gentrackerdashboard(),
settings: RouteSettings(
arguments:
'Gentrackerdashboard',
),
),
);
break;
case "Service Engineer":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Serviceengineerdashboard(),
),
);
break;
case "Nearby":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Nearbygenerators(),
),
);
break;
case "Inventory":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
InventoryScreen(),
),
);
break;
case "Whizzdom":
bool isGpsEnabled =
await Geolocator.isLocationServiceEnabled();
if (isGpsEnabled) {
res = await Navigator.push(
context, context,
MaterialPageRoute(
builder:
(
context,
) => WebWhizzdomScreen(
whizzdom_url:
homescreen
.whizzdomPageUrl,
),
),
); );
} else {
requestGpsPermission();
} }
break; },
case "Common": child: Container(
res = await Navigator.push( decoration: BoxDecoration(
context, color: Colors.white,
MaterialPageRoute( borderRadius: BorderRadius.circular(30),
builder: ),
(context) => child: Column(
Commondashboard(), crossAxisAlignment:
), CrossAxisAlignment.center,
); mainAxisAlignment:
break; MainAxisAlignment.center,
case "Finance": children: [
res = await Navigator.push( SvgPicture.asset(
context, item['icon']!,
MaterialPageRoute( height: 45,
builder:
(context) =>
Financedashboard(),
settings: RouteSettings(
arguments: 'Financedashboard',
),
),
);
break;
case "Orders":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Ordermoduledashboard(),
),
);
case "CRM":
res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
CrmdashboardScreen(),
settings: RouteSettings(
name: 'CrmdashboardScreen',
), ),
), SizedBox(height: 10),
); Text(item['name']!),
default: ],
print("111");
break;
}
if (res == true) {
homescreen.DashboardApiFunction(
context,
);
}
},
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(30),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
SvgPicture.asset(
item['icon']!,
height: 45,
), ),
SizedBox(height: 10), ),
Text(item['name']!), );
], },
), ),
), ),
);
},
), ),
), ],
), ),
], ),
), ),
), ),
), ),
), );
), },
); )
},
)
: NoNetwork(context); : NoNetwork(context);
} }
...@@ -647,9 +646,9 @@ class _MyHomePageOldState extends State<MyHomePageOld> { ...@@ -647,9 +646,9 @@ class _MyHomePageOldState extends State<MyHomePageOld> {
bottom: MediaQuery.of(context).viewInsets.bottom, bottom: MediaQuery.of(context).viewInsets.bottom,
), ),
child: Consumer3< child: Consumer3<
HomescreenNotifier, HomescreenNotifier,
ProfileNotifer, ProfileNotifer,
LogoutNotifier LogoutNotifier
>( >(
builder: (context, home, profile, logout, child) { builder: (context, home, profile, logout, child) {
return SingleChildScrollView( return SingleChildScrollView(
...@@ -721,10 +720,10 @@ class _MyHomePageOldState extends State<MyHomePageOld> { ...@@ -721,10 +720,10 @@ class _MyHomePageOldState extends State<MyHomePageOld> {
useOldImageOnUrlChange: false, useOldImageOnUrlChange: false,
placeholder: placeholder:
(context, url) => (context, url) =>
CircularProgressIndicator.adaptive(), CircularProgressIndicator.adaptive(),
errorWidget: errorWidget:
(context, url, error) => (context, url, error) =>
Icon(Icons.error), Icon(Icons.error),
), ),
), ),
), ),
...@@ -752,7 +751,7 @@ class _MyHomePageOldState extends State<MyHomePageOld> { ...@@ -752,7 +751,7 @@ class _MyHomePageOldState extends State<MyHomePageOld> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.center, CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
...@@ -760,7 +759,7 @@ class _MyHomePageOldState extends State<MyHomePageOld> { ...@@ -760,7 +759,7 @@ class _MyHomePageOldState extends State<MyHomePageOld> {
shrinkWrap: true, shrinkWrap: true,
itemCount: 5, itemCount: 5,
physics: physics:
NeverScrollableScrollPhysics(), NeverScrollableScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final textHeadings = [ final textHeadings = [
"Company", "Company",
...@@ -774,7 +773,7 @@ class _MyHomePageOldState extends State<MyHomePageOld> { ...@@ -774,7 +773,7 @@ class _MyHomePageOldState extends State<MyHomePageOld> {
child: Align( child: Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
"${textHeadings[index]}", textHeadings[index],
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
...@@ -794,7 +793,7 @@ class _MyHomePageOldState extends State<MyHomePageOld> { ...@@ -794,7 +793,7 @@ class _MyHomePageOldState extends State<MyHomePageOld> {
shrinkWrap: true, shrinkWrap: true,
itemCount: 5, itemCount: 5,
physics: physics:
NeverScrollableScrollPhysics(), NeverScrollableScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final textHeadings = [ final textHeadings = [
profile.company, profile.company,
...@@ -808,7 +807,8 @@ class _MyHomePageOldState extends State<MyHomePageOld> { ...@@ -808,7 +807,8 @@ class _MyHomePageOldState extends State<MyHomePageOld> {
child: Align( child: Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
"${textHeadings[index].toString()}", textHeadings[index]
.toString(),
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
...@@ -906,9 +906,9 @@ class _MyHomePageOldState extends State<MyHomePageOld> { ...@@ -906,9 +906,9 @@ class _MyHomePageOldState extends State<MyHomePageOld> {
bottom: MediaQuery.of(context).viewInsets.bottom, bottom: MediaQuery.of(context).viewInsets.bottom,
), ),
child: Consumer3< child: Consumer3<
HomescreenNotifier, HomescreenNotifier,
ProfileNotifer, ProfileNotifer,
LogoutNotifier LogoutNotifier
>( >(
builder: (context, home, profile, logout, child) { builder: (context, home, profile, logout, child) {
return SingleChildScrollView( return SingleChildScrollView(
......
...@@ -62,15 +62,15 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -62,15 +62,15 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
...@@ -78,9 +78,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -78,9 +78,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
return Consumer<Crmdashboardprovider>( return Consumer<Crmdashboardprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final gridPages = final gridPages =
provider.accessPages provider.accessPages
.where((page) => ![8, 9, 23, 24, 51, 50].contains(page.id)) .where((page) => ![8, 9, 23, 24, 51, 50].contains(page.id))
.toList(); .toList();
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
...@@ -126,9 +126,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -126,9 +126,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
color: AppColors.text_field_color, color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
border: border:
focusNode.hasFocus focusNode.hasFocus
? Border.all(color: AppColors.app_blue) ? Border.all(color: AppColors.app_blue)
: null, : null,
), ),
child: Row( child: Row(
children: [ children: [
...@@ -154,8 +154,8 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -154,8 +154,8 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Universalsearchscreen( (context) => Universalsearchscreen(
text: provider.searchController.text, text: provider.searchController.text,
), ),
settings: RouteSettings(name: 'SearchScreen'), settings: RouteSettings(name: 'SearchScreen'),
), ),
); );
...@@ -191,7 +191,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -191,7 +191,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
physics: AlwaysScrollableScrollPhysics(), physics: AlwaysScrollableScrollPhysics(),
child: Column( child: Column(
children: [ children: [
if (provider.allLeads.length > 0) ...[ if (provider.allLeads.isNotEmpty) ...[
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10), margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
...@@ -254,19 +254,19 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -254,19 +254,19 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Leadlistbymode( (context) => Leadlistbymode(
pageTitleName: pageTitleName:
provider provider
.allLeads[jndex] .allLeads[jndex]
.filter! .filter!
.pageName!, .pageName!,
mode: mode:
provider provider
.allLeads[jndex] .allLeads[jndex]
.filter! .filter!
.mode, .mode,
filter: filter:
provider.allLeads[jndex].filter!, provider.allLeads[jndex].filter!,
), ),
), ),
); );
} }
...@@ -331,9 +331,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -331,9 +331,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Leadlistbymode( (context) => Leadlistbymode(
mode: gridPages[index].mode, mode: gridPages[index].mode,
pageTitleName: gridPages[index].pageName, pageTitleName: gridPages[index].pageName,
), ),
), ),
); );
} else if (gridPages[index].pageName!.contains( } else if (gridPages[index].pageName!.contains(
...@@ -344,9 +344,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -344,9 +344,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => ProspectListByMode( (context) => ProspectListByMode(
mode: gridPages[index].mode, mode: gridPages[index].mode,
pageTitleName: gridPages[index].pageName, pageTitleName: gridPages[index].pageName,
), ),
), ),
); );
} else if (gridPages[index].pageName == } else if (gridPages[index].pageName ==
...@@ -414,7 +414,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -414,7 +414,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
}, },
), ),
if (provider.pendingTasksLists.length > 0) ...[ if (provider.pendingTasksLists.isNotEmpty) ...[
Align( Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Padding( child: Padding(
...@@ -428,7 +428,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -428,7 +428,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
), ),
Container( SizedBox(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height * 0.34, height: MediaQuery.of(context).size.height * 0.34,
child: ListView.builder( child: ListView.builder(
...@@ -483,17 +483,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -483,17 +483,17 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"${headings[j]}", headings[j],
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
), ),
Expanded( Expanded(
child: Text( child: Text(
"${subHeadings[j]}", subHeadings[j],
style: TextStyle( style: TextStyle(
color: AppColors.grey_semi, color: AppColors.grey_semi,
fontSize: 14, fontSize: 14,
...@@ -516,7 +516,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -516,7 +516,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
), ),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse( floatingActionButton: InkResponse(
onTap: () { onTap: () {
if (provider.accessPages if (provider.accessPages
...@@ -566,9 +566,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -566,9 +566,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
child: Consumer<Crmdashboardprovider>( child: Consumer<Crmdashboardprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
final accessiblePagesList = final accessiblePagesList =
provider.accessPages provider.accessPages
.where((page) => [8, 9].contains(page.id)) .where((page) => [8, 9].contains(page.id))
.toList(); .toList();
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
bottom: 15, bottom: 15,
......
...@@ -76,15 +76,15 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> { ...@@ -76,15 +76,15 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> {
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
...@@ -101,11 +101,11 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> { ...@@ -101,11 +101,11 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> {
"Last Followup Date", "Last Followup Date",
]; ];
var subHeadings1 = [ var subHeadings1 = [
provider.accountDetails!.accManager ?? "-", provider.accountDetails.accManager ?? "-",
provider.accountDetails!.owner ?? "-", provider.accountDetails.owner ?? "-",
provider.leadDetails!.address ?? "-", provider.leadDetails.address ?? "-",
provider.leadDetails!.status ?? "-", provider.leadDetails.status ?? "-",
provider.followupDetails.first!.fdate ?? "-", provider.followupDetails.first.fdate ?? "-",
]; ];
var headings2 = [ var headings2 = [
...@@ -120,14 +120,14 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> { ...@@ -120,14 +120,14 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> {
]; ];
var subHeadings2 = [ var subHeadings2 = [
provider.accountDetails!.state ?? "-", provider.accountDetails.state ?? "-",
provider.accountDetails!.district ?? "-", provider.accountDetails.district ?? "-",
provider.accountDetails!.subLocality ?? "-", provider.accountDetails.subLocality ?? "-",
provider.accountDetails!.source ?? "-", provider.accountDetails.source ?? "-",
provider.accountDetails!.reference ?? "-", provider.accountDetails.reference ?? "-",
provider.accountDetails!.team ?? "-", provider.accountDetails.team ?? "-",
provider.accountDetails!.segment ?? "-", provider.accountDetails.segment ?? "-",
"${provider.leadDetails!.lage ?? "-"} days", "${provider.leadDetails.lage ?? "-"} days",
]; ];
var totalHeadings = [...headings1]; var totalHeadings = [...headings1];
...@@ -210,11 +210,11 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> { ...@@ -210,11 +210,11 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => EditAccountDetails( (context) => EditAccountDetails(
leadID: leadDetails.id, leadID: leadDetails.id,
mode: widget.mode, mode: widget.mode,
accountID: leadDetails.accId, accountID: leadDetails.accId,
companyName: leadDetails.name, companyName: leadDetails.name,
), ),
), ),
); );
if (res == true) { if (res == true) {
...@@ -257,35 +257,35 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> { ...@@ -257,35 +257,35 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> {
Expanded( Expanded(
child: InkResponse( child: InkResponse(
child: child:
totalHeadings[j] == "Lead Age" totalHeadings[j] == "Lead Age"
? Tooltip( ? Tooltip(
triggerMode: TooltipTriggerMode.tap, triggerMode: TooltipTriggerMode.tap,
message: message:
"${provider.leadDetails.createdDatetime}", "${provider.leadDetails.createdDatetime}",
child: Text( child: Text(
totalSubHeadings[j] == "" totalSubHeadings[j] == ""
? "-" ? "-"
: totalSubHeadings[j], : totalSubHeadings[j],
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xFF818181), color: Color(0xFF818181),
decorationColor: decorationColor:
AppColors.grey_semi, AppColors.grey_semi,
decoration: decoration:
TextDecoration.underline, TextDecoration.underline,
), ),
), ),
) )
: Text( : Text(
totalSubHeadings[j] == "" totalSubHeadings[j] == ""
? "-" ? "-"
: totalSubHeadings[j], : totalSubHeadings[j],
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xFF818181), color: Color(0xFF818181),
), ),
), ),
), ),
), ),
], ],
...@@ -385,9 +385,9 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> { ...@@ -385,9 +385,9 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Productdetails( (context) => Productdetails(
leadID: provider.leadDetails.id, leadID: provider.leadDetails.id,
mode: widget.mode, mode: widget.mode,
), ),
), ),
); );
break; break;
...@@ -397,8 +397,8 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> { ...@@ -397,8 +397,8 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => Contactdetails( (context) => Contactdetails(
accID: provider.leadDetails.accId, accID: provider.leadDetails.accId,
), ),
), ),
); );
break; break;
...@@ -416,8 +416,8 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> { ...@@ -416,8 +416,8 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => AppointmentDetails( (context) => AppointmentDetails(
leadID: provider.leadDetails.id, leadID: provider.leadDetails.id,
), ),
), ),
); );
break; break;
...@@ -427,9 +427,9 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> { ...@@ -427,9 +427,9 @@ class _LeadDetailsByModeOldState extends State<LeadDetailsByModeOld> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => QuotationDetails( (context) => QuotationDetails(
leadID: provider.leadDetails.id, leadID: provider.leadDetails.id,
mode: widget.mode, mode: widget.mode,
), ),
), ),
); );
default: default:
......
...@@ -102,15 +102,15 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -102,15 +102,15 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
...@@ -140,207 +140,207 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -140,207 +140,207 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body:
provider.isLoading provider.isLoading
? Center( ? Center(
child: CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue, AppColors.app_blue,
), ),
),
)
: crmLists.isNotEmpty
? SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: crmLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (crmLists.isEmpty) {
return SizedBox(
child: Center(child: Text("No Data Available")),
);
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
), ),
child: Column( )
children: [ : crmLists.isNotEmpty
Row( ? SizedBox(
children: [ child: Scrollbar(
Expanded( thumbVisibility: false,
flex: 1, child: ListView.builder(
child: Container( itemCount: crmLists.length,
height: 50, shrinkWrap: true,
width: 35, physics: AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.all(8.0), itemBuilder: (context, index) {
decoration: BoxDecoration( if (crmLists.isEmpty) {
color: Color(0xFFE6F6FF), return SizedBox(
borderRadius: BorderRadius.circular( child: Center(child: Text("No Data Available")),
8, );
), }
), return Container(
child: SvgPicture.asset( padding: EdgeInsets.symmetric(
"assets/svg/se_block_head.svg", horizontal: 10,
), vertical: 10,
),
), ),
SizedBox(width: 10), margin: EdgeInsets.symmetric(
Expanded( horizontal: 10,
flex: 4, vertical: 10,
child: SizedBox( ),
child: Column( decoration: BoxDecoration(
crossAxisAlignment: color: Colors.white,
CrossAxisAlignment.start, borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [ children: [
Text( Expanded(
crmLists[index].company!, flex: 1,
style: TextStyle( child: Container(
fontFamily: "JakartaMedium", height: 50,
fontSize: 14, width: 35,
color: AppColors.semi_black, padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(
8,
),
),
child: SvgPicture.asset(
"assets/svg/se_block_head.svg",
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
crmLists[index].company!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
],
),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8,
),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
crmLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
),
),
), ),
), ),
], ],
), ),
), Divider(
), thickness: 0.5,
Expanded( color: Color(0xFFD7D7D7),
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
), ),
decoration: BoxDecoration( ...List.generate(4, (j) {
borderRadius: BorderRadius.circular( final headings = [
8, "Account Manager",
), "Contact Person",
color: Color(0xFFE3FFE0), "Product",
), "Open Status",
child: Center( ];
child: Text(
crmLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
),
),
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Account Manager",
"Contact Person",
"Product",
"Open Status",
];
final subHeadings = [ final subHeadings = [
crmLists[index].accman, crmLists[index].accman,
crmLists[index].cname, crmLists[index].cname,
crmLists[index].product, crmLists[index].product,
crmLists[index].openStatus, crmLists[index].openStatus,
]; ];
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 5), padding: EdgeInsets.symmetric(vertical: 5),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
headings[j], headings[j],
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
color: AppColors.semi_black, color: AppColors.semi_black,
),
),
),
Expanded(
child: Text(
subHeadings[j] ?? "-",
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
),
),
],
), ),
), );
), }),
Expanded( InkResponse(
child: Text( onTap: () async {
subHeadings[j] ?? "-", Navigator.push(
style: TextStyle( context,
fontSize: 14, MaterialPageRoute(
color: Color(0xFF818181), builder:
(context) => LeadDetailsByMode(
pageTitleName:
widget.pageTitleName,
mode: widget.mode,
leadId:
provider
.crmLeadList[index]
.leadid,
),
),
);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
), ),
), ),
), ),
], ],
), ),
); );
}), },
InkResponse( ),
onTap: () async {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => LeadDetailsByMode(
pageTitleName:
widget.pageTitleName,
mode: widget.mode,
leadId:
provider
.crmLeadList[index]
.leadid,
),
),
);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
],
), ),
); )
}, : Emptywidget(context),
),
),
)
: Emptywidget(context),
); );
}, },
); );
...@@ -412,26 +412,26 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -412,26 +412,26 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.employeesList provider.employeesList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<Employees>( DropdownMenuItem<Employees>(
value: slist, value: slist,
child: Text( child: Text(
slist.name!, slist.name!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: value:
provider.employeesList.contains( provider.employeesList.contains(
provider.selectedEmployee, provider.selectedEmployee,
) )
? provider.selectedEmployee ? provider.selectedEmployee
: null, : null,
// value: provider.selectedEmployees, // value: provider.selectedEmployees,
onChanged: (Employees? value) { onChanged: (Employees? value) {
...@@ -441,15 +441,15 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -441,15 +441,15 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
.isNotEmpty) { .isNotEmpty) {
provider.selectedEmployee = value; provider.selectedEmployee = value;
provider.selectedEmployeeId = provider.selectedEmployeeId =
value!.id!; value.id!;
provider.selectedEmployeeValue = provider.selectedEmployeeValue =
value!.name!; value.name!;
provider provider
.crmLeadListSourceOnReferenceAPIFunction( .crmLeadListSourceOnReferenceAPIFunction(
context, context,
widget.mode, widget.mode,
provider.selectedSourceId, provider.selectedSourceId,
); );
} }
} }
}, },
...@@ -457,9 +457,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -457,9 +457,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -477,20 +477,20 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -477,20 +477,20 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.leadStatusList provider.leadStatusList
.map( .map(
(leadStatus) => (leadStatus) =>
DropdownMenuItem<String>( DropdownMenuItem<String>(
value: leadStatus, value: leadStatus,
child: Text( child: Text(
leadStatus!, leadStatus!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectedLeadStatus, value: provider.selectedLeadStatus,
onChanged: (String? value) { onChanged: (String? value) {
if (value != null) { if (value != null) {
...@@ -501,9 +501,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -501,9 +501,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -521,20 +521,20 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -521,20 +521,20 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.openStatusList provider.openStatusList
.map( .map(
(leadStatus) => (leadStatus) =>
DropdownMenuItem<String>( DropdownMenuItem<String>(
value: leadStatus, value: leadStatus,
child: Text( child: Text(
leadStatus!, leadStatus!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectedOpenStatus, value: provider.selectedOpenStatus,
onChanged: (String? value) { onChanged: (String? value) {
if (value != null) { if (value != null) {
...@@ -545,9 +545,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -545,9 +545,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -585,35 +585,34 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -585,35 +585,34 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.sourcesList provider.sourcesList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<Sources>( DropdownMenuItem<Sources>(
value: slist, value: slist,
child: Text( child: Text(
slist.name!, slist.name!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectedSource, value: provider.selectedSource,
onChanged: (Sources? value) { onChanged: (Sources? value) {
if (value != null) { if (value != null) {
if (provider.sourcesList.isNotEmpty) { if (provider.sourcesList.isNotEmpty) {
provider.selectedSource = value; provider.selectedSource = value;
provider.selectedSourceId = provider.selectedSourceId = value.id!;
value!.id!;
provider.selectedSourceValue = provider.selectedSourceValue =
value!.name!; value.name!;
provider provider
.crmLeadListSourceOnReferenceAPIFunction( .crmLeadListSourceOnReferenceAPIFunction(
context, context,
widget.mode, widget.mode,
provider.selectedSourceId, provider.selectedSourceId,
); );
} }
} }
}, },
...@@ -621,9 +620,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -621,9 +620,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -641,20 +640,20 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -641,20 +640,20 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.referencesList provider.referencesList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<References>( DropdownMenuItem<References>(
value: slist, value: slist,
child: Text( child: Text(
slist.name!, slist.name!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectedReference, value: provider.selectedReference,
onChanged: (References? value) { onChanged: (References? value) {
if (value != null) { if (value != null) {
...@@ -663,9 +662,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -663,9 +662,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
.isNotEmpty) { .isNotEmpty) {
provider.selectedReference = value; provider.selectedReference = value;
provider.selectedReferenceId = provider.selectedReferenceId =
value!.id!; value.id!;
provider.selectedReferenceValue = provider.selectedReferenceValue =
value!.name!; value.name!;
} }
} }
}, },
...@@ -673,9 +672,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -673,9 +672,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -693,34 +692,34 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -693,34 +692,34 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.teamsList provider.teamsList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<Teams>( DropdownMenuItem<Teams>(
value: slist, value: slist,
child: Text( child: Text(
slist.name!, slist.name!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectedTeam, value: provider.selectedTeam,
onChanged: (Teams? value) { onChanged: (Teams? value) {
if (value != null) { if (value != null) {
if (provider.teamsList.isNotEmpty) { if (provider.teamsList.isNotEmpty) {
provider.selectedTeam = value; provider.selectedTeam = value;
provider.selectedTeamId = value!.id!; provider.selectedTeamId = value.id!;
provider.selectedTeamValue = provider.selectedTeamValue =
value!.name!; value.name!;
provider provider
.crmLeadListSegmentOnTeamAPIFunction( .crmLeadListSegmentOnTeamAPIFunction(
context, context,
widget.mode, widget.mode,
provider.selectedTeamId, provider.selectedTeamId,
); );
} }
} }
}, },
...@@ -728,9 +727,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -728,9 +727,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -748,29 +747,29 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -748,29 +747,29 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.segmentsList provider.segmentsList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<Segments>( DropdownMenuItem<Segments>(
value: slist, value: slist,
child: Text( child: Text(
slist.name!, slist.name!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectedSegment, value: provider.selectedSegment,
onChanged: (Segments? value) { onChanged: (Segments? value) {
if (value != null) { if (value != null) {
if (provider.segmentsList.isNotEmpty) { if (provider.segmentsList.isNotEmpty) {
provider.selectedSegment = value; provider.selectedSegment = value;
provider.selectedSegmentId = provider.selectedSegmentId =
value!.id!; value.id!;
provider.selectedSegmentValue = provider.selectedSegmentValue =
value!.name!; value.name!;
} }
} }
}, },
...@@ -778,9 +777,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -778,9 +777,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -798,28 +797,28 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -798,28 +797,28 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.statesList provider.statesList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<States>( DropdownMenuItem<States>(
value: slist, value: slist,
child: Text( child: Text(
slist.name!, slist.name!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectedStates, value: provider.selectedStates,
onChanged: (States? value) { onChanged: (States? value) {
if (value != null) { if (value != null) {
if (provider.statesList.isNotEmpty) { if (provider.statesList.isNotEmpty) {
provider.selectedStates = value; provider.selectedStates = value;
provider.selectedStateId = value!.id!; provider.selectedStateId = value.id!;
provider.selectedStateValue = provider.selectedStateValue =
value!.name!; value.name!;
if (provider if (provider
.districtsList .districtsList
.isNotEmpty) { .isNotEmpty) {
...@@ -830,10 +829,10 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -830,10 +829,10 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
} }
provider provider
.crmLeadListDistrictsOnStateAPIFunction( .crmLeadListDistrictsOnStateAPIFunction(
context, context,
widget.mode, widget.mode,
provider.selectedStateId, provider.selectedStateId,
); );
} }
} }
}, },
...@@ -841,9 +840,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -841,9 +840,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -861,29 +860,29 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -861,29 +860,29 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.districtsList provider.districtsList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<Districts>( DropdownMenuItem<Districts>(
value: slist, value: slist,
child: Text( child: Text(
slist.district!, slist.district!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectedDistricts, value: provider.selectedDistricts,
onChanged: (Districts? value) { onChanged: (Districts? value) {
if (value != null) { if (value != null) {
if (provider.districtsList.isNotEmpty) { if (provider.districtsList.isNotEmpty) {
provider.selectedDistricts = value; provider.selectedDistricts = value;
provider.selectedDistrictId = provider.selectedDistrictId =
value!.id!; value.id!;
provider.selectedDistrictValue = provider.selectedDistrictValue =
value!.district!; value.district!;
if (provider if (provider
.subLocationsList .subLocationsList
.isNotEmpty) { .isNotEmpty) {
...@@ -891,16 +890,16 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -891,16 +890,16 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
// provider.selectedSubLocations = // provider.selectedSubLocations =
// null; // null;
provider.selectedSubLocationId = provider.selectedSubLocationId =
null; null;
provider.selectedSubLocationValue = provider.selectedSubLocationValue =
""; "";
} }
provider provider
.crmLeadListSubLocOnDistrictAPIFunction( .crmLeadListSubLocOnDistrictAPIFunction(
context, context,
widget.mode, widget.mode,
provider.selectedDistrictId, provider.selectedDistrictId,
); );
} }
} }
}, },
...@@ -908,9 +907,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -908,9 +907,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -928,21 +927,21 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -928,21 +927,21 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.subLocationsList provider.subLocationsList
.map( .map(
(slist) => DropdownMenuItem< (slist) => DropdownMenuItem<
SubLocations SubLocations
>( >(
value: slist, value: slist,
child: Text( child: Text(
slist.subLocality!, slist.subLocality!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectedSubLocations, value: provider.selectedSubLocations,
onChanged: (SubLocations? value) { onChanged: (SubLocations? value) {
if (value != null) { if (value != null) {
...@@ -951,9 +950,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -951,9 +950,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
.isNotEmpty) { .isNotEmpty) {
provider.selectedSubLocations = value; provider.selectedSubLocations = value;
provider.selectedSubLocationId = provider.selectedSubLocationId =
value!.id!; value.id!;
provider.selectedSubLocationValue = provider.selectedSubLocationValue =
value!.subLocality!; value.subLocality!;
} }
} }
}, },
...@@ -961,9 +960,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -961,9 +960,9 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -981,7 +980,7 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> { ...@@ -981,7 +980,7 @@ class _LeadlistbymodeOldState extends State<LeadlistbymodeOld> {
provider.selectedReferenceId, provider.selectedReferenceId,
provider.selectedTeamId, provider.selectedTeamId,
provider.selectedSegmentId, provider.selectedSegmentId,
"" "",
); );
Navigator.pop(context); Navigator.pop(context);
}, },
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/GlobalConstants.dart'; import 'package:generp/Utils/GlobalConstants.dart';
...@@ -17,7 +16,10 @@ import '../commonDateRangeFilter.dart'; ...@@ -17,7 +16,10 @@ import '../commonDateRangeFilter.dart';
class PaymentlistpaymentrequisitionOld extends StatefulWidget { class PaymentlistpaymentrequisitionOld extends StatefulWidget {
final String pageTitleName; final String pageTitleName;
const PaymentlistpaymentrequisitionOld({super.key, required this.pageTitleName}); const PaymentlistpaymentrequisitionOld({
super.key,
required this.pageTitleName,
});
@override @override
State<PaymentlistpaymentrequisitionOld> createState() => State<PaymentlistpaymentrequisitionOld> createState() =>
...@@ -77,15 +79,15 @@ class _PaymentlistpaymentrequisitionOldState ...@@ -77,15 +79,15 @@ class _PaymentlistpaymentrequisitionOldState
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
...@@ -143,266 +145,266 @@ class _PaymentlistpaymentrequisitionOldState ...@@ -143,266 +145,266 @@ class _PaymentlistpaymentrequisitionOldState
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body:
provider.isLoading provider.isLoading
? Center( ? Center(
child: CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue, AppColors.app_blue,
), ),
),
)
: requestLists.isNotEmpty
? SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
), ),
child: Column( )
children: [ : requestLists.isNotEmpty
Row( ? SizedBox(
children: [ child: Scrollbar(
Expanded( thumbVisibility: false,
flex: 1,
child: Container( child: ListView.builder(
height: 50, itemCount: requestLists.length,
width: 35, shrinkWrap: true,
padding: EdgeInsets.all(8.0), physics: AlwaysScrollableScrollPhysics(),
decoration: BoxDecoration( itemBuilder: (context, index) {
color: Color(0xFFFFF3CE), return Container(
borderRadius: BorderRadius.circular( padding: EdgeInsets.symmetric(
8, horizontal: 10,
), vertical: 10,
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
),
), ),
SizedBox(width: 10), margin: EdgeInsets.symmetric(
Expanded( horizontal: 10,
flex: 4, vertical: 10,
child: SizedBox( ),
child: Column( decoration: BoxDecoration(
crossAxisAlignment: color: Colors.white,
CrossAxisAlignment.start, borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [ children: [
Text( Expanded(
requestLists[index] flex: 1,
.receipientAccount!, child: Container(
style: TextStyle( height: 50,
fontFamily: "JakartaMedium", width: 35,
fontSize: 14, padding: EdgeInsets.all(8.0),
color: AppColors.semi_black, decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(
8,
),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
), ),
), ),
Text( SizedBox(width: 10),
"₹${requestLists[index].amount}", Expanded(
style: TextStyle( flex: 4,
fontFamily: "JakartaMedium", child: SizedBox(
fontSize: 14, child: Column(
color: AppColors.app_blue, crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.receipientAccount!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"₹${requestLists[index].amount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
), ),
), ),
// Expanded(
// flex: 2,
// child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: 5,
// vertical: 10,
// ),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8),
// color: Color(0xFFE3FFE0),
// ),
// child: Center(
// child: Text(
// requestLists[index].refType!,
// textAlign: TextAlign.center,
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: Color(0xFF0D9C00),
// ),
// ),
// ),
// ),
// ),
], ],
), ),
), Divider(
), thickness: 0.5,
// Expanded( color: Color(0xFFD7D7D7),
// flex: 2, ),
// child: Container( ...List.generate(5, (j) {
// padding: EdgeInsets.symmetric( final headings = [
// horizontal: 5, "To Account",
// vertical: 10, "Attachment",
// ), "Request Mode",
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8),
// color: Color(0xFFE3FFE0),
// ),
// child: Center(
// child: Text(
// requestLists[index].refType!,
// textAlign: TextAlign.center,
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: Color(0xFF0D9C00),
// ),
// ),
// ),
// ),
// ),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(5, (j) {
final headings = [
"To Account",
"Attachment",
"Request Mode",
"Payment Date", "Payment Date",
"Note", "Note",
]; ];
final subHeadings = [ final subHeadings = [
requestLists[index].payAccount, requestLists[index].payAccount,
"View", "View",
requestLists[index].requestMode, requestLists[index].requestMode,
// requestLists[index].attachmentDirFilePath // requestLists[index].attachmentDirFilePath
requestLists[index].paymentDate, requestLists[index].paymentDate,
requestLists[index].description, requestLists[index].description,
]; ];
if (headings[j] == "Attachment" && if (headings[j] == "Attachment" &&
requestLists[index] requestLists[index]
.attachmentViewFileName == .attachmentViewFileName ==
"") { "") {
return SizedBox.shrink(); return SizedBox.shrink();
} }
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 5), padding: EdgeInsets.symmetric(vertical: 5),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
headings[j], headings[j],
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
color: AppColors.semi_black, color: AppColors.semi_black,
), ),
),
),
Expanded(
child: InkResponse(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
), ),
), ),
); Expanded(
}, child: InkResponse(
child: Text( onTap:
subHeadings[j] == "" j != 1
? "-" ? null
: subHeadings[j] ?? "-", : () {
style: TextStyle( Navigator.push(
fontSize: 14, context,
color: MaterialPageRoute(
j == 1 builder:
? AppColors.app_blue (
: Color(0xFF818181), context,
decoration: ) => Fileviewer(
j == 1 fileName:
? TextDecoration requestLists[index]
.underline .attachmentViewFileName!,
: TextDecoration.none, fileUrl:
decorationColor: requestLists[index]
j == 1 .attachmentDirFilePath!,
? AppColors.app_blue ),
: AppColors.white, ),
);
},
child: Text(
subHeadings[j] == ""
? "-"
: subHeadings[j] ?? "-",
style: TextStyle(
fontSize: 14,
color:
j == 1
? AppColors.app_blue
: Color(0xFF818181),
decoration:
j == 1
? TextDecoration
.underline
: TextDecoration.none,
decorationColor:
j == 1
? AppColors.app_blue
: AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentdetailspaymentrequisition(
pageName:
widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name:
"Paymentdetailspaymentrequisition",
),
), ),
);
if (routeSettingName ==
"Paymentdetailspaymentrequisition") {
print("pld");
provider.paymentsListAPI(context, '', '');
}
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
), ),
), ),
), ),
], ],
), ),
); );
}), },
InkResponse( ),
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentdetailspaymentrequisition(
pageName:
widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name:
"Paymentdetailspaymentrequisition",
),
),
);
if (routeSettingName ==
"Paymentdetailspaymentrequisition") {
print("pld");
provider.paymentsListAPI(context, '', '');
}
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
],
), ),
); )
}, : Emptywidget(context),
),
),
)
: Emptywidget(context),
); );
}, },
); );
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/GlobalConstants.dart'; import 'package:generp/Utils/GlobalConstants.dart';
...@@ -61,15 +60,15 @@ class _PaymentreceiptlistOldState extends State<PaymentreceiptlistOld> { ...@@ -61,15 +60,15 @@ class _PaymentreceiptlistOldState extends State<PaymentreceiptlistOld> {
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
...@@ -127,239 +126,239 @@ class _PaymentreceiptlistOldState extends State<PaymentreceiptlistOld> { ...@@ -127,239 +126,239 @@ class _PaymentreceiptlistOldState extends State<PaymentreceiptlistOld> {
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body:
provider.isLoading provider.isLoading
? Center( ? Center(
child: CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue, AppColors.app_blue,
), ),
),
)
: requestLists.isNotEmpty
? SizedBox(
child: Scrollbar(
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
), ),
child: Column( )
children: [ : requestLists.isNotEmpty
Row( ? SizedBox(
children: [ child: Scrollbar(
Expanded( child: ListView.builder(
flex: 1, itemCount: requestLists.length,
child: Container( shrinkWrap: true,
height: 50, physics: AlwaysScrollableScrollPhysics(),
width: 35, itemBuilder: (context, index) {
padding: EdgeInsets.all(8.0), return Container(
decoration: BoxDecoration( padding: EdgeInsets.symmetric(
color: Color(0xFFFFF3CE), horizontal: 10,
borderRadius: BorderRadius.circular( vertical: 10,
8, ),
), margin: EdgeInsets.symmetric(
), horizontal: 10,
child: SvgPicture.asset( vertical: 10,
"assets/svg/fin_ic.svg",
),
),
), ),
SizedBox(width: 10), decoration: BoxDecoration(
Expanded( color: Colors.white,
flex: 4, borderRadius: BorderRadius.circular(16),
child: SizedBox( ),
child: Column( child: Column(
crossAxisAlignment: children: [
CrossAxisAlignment.start, Row(
children: [ children: [
Text( Expanded(
requestLists[index] flex: 1,
.receipientAccount!, child: Container(
style: TextStyle( height: 50,
fontFamily: "JakartaMedium", width: 35,
fontSize: 14, padding: EdgeInsets.all(8.0),
color: AppColors.semi_black, decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(
8,
),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
), ),
), ),
Text( SizedBox(width: 10),
"₹${requestLists[index].amount}", Expanded(
style: TextStyle( flex: 4,
fontFamily: "JakartaMedium", child: SizedBox(
fontSize: 14, child: Column(
color: AppColors.app_blue, crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.receipientAccount!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"₹${requestLists[index].amount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
), ),
), ),
], ],
), ),
), Divider(
), thickness: 0.5,
], color: Color(0xFFD7D7D7),
), ),
Divider( ...List.generate(5, (j) {
thickness: 0.5, final headings = [
color: Color(0xFFD7D7D7), "Receipt Account",
), "Attachment",
...List.generate(5, (j) { "Request Mode",
final headings = [
"Receipt Account",
"Attachment",
"Request Mode",
"Receipt Date", "Receipt Date",
"Note", "Note",
]; ];
final subHeadings = [ final subHeadings = [
requestLists[index].receipientAccount, requestLists[index].receipientAccount,
"View", "View",
requestLists[index].requestMode, requestLists[index].requestMode,
// requestLists[index].attachmentDirFilePath // requestLists[index].attachmentDirFilePath
requestLists[index].receiptDate, requestLists[index].receiptDate,
requestLists[index].description, requestLists[index].description,
]; ];
if (headings[j] == "Attachment" && if (headings[j] == "Attachment" &&
requestLists[index] requestLists[index]
.attachmentViewFileName == .attachmentViewFileName ==
"") { "") {
return SizedBox.shrink(); return SizedBox.shrink();
} }
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 5), padding: EdgeInsets.symmetric(vertical: 5),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
headings[j], headings[j],
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
color: AppColors.semi_black, color: AppColors.semi_black,
), ),
),
),
Expanded(
child: InkResponse(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
), ),
), ),
); Expanded(
}, child: InkResponse(
child: Text( onTap:
subHeadings[j] == "" j != 1
? "-" ? null
: subHeadings[j] ?? "-", : () {
style: TextStyle( Navigator.push(
fontSize: 14, context,
color: MaterialPageRoute(
j == 1 builder:
? AppColors.app_blue (
: Color(0xFF818181), context,
decoration: ) => Fileviewer(
j == 1 fileName:
? TextDecoration requestLists[index]
.underline .attachmentViewFileName!,
: TextDecoration.none, fileUrl:
decorationColor: requestLists[index]
j == 1 .attachmentDirFilePath!,
? AppColors.app_blue ),
: AppColors.white, ),
);
},
child: Text(
subHeadings[j] == ""
? "-"
: subHeadings[j] ?? "-",
style: TextStyle(
fontSize: 14,
color:
j == 1
? AppColors.app_blue
: Color(0xFF818181),
decoration:
j == 1
? TextDecoration
.underline
: TextDecoration.none,
decorationColor:
j == 1
? AppColors.app_blue
: AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Paymentreceiptdetails(
pageName: widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name: "Paymentreceiptdetails",
),
), ),
);
if (routeSettingName ==
"Paymentreceiptdetails") {
debugPrint("prd");
provider.paymentsListAPI(context, '', '');
}
// if (res == true) {
// provider.paymentsListAPI(context, '', '');
// }
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
), ),
), ),
), ),
], ],
), ),
); );
}), },
InkResponse( ),
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Paymentreceiptdetails(
pageName: widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name: "Paymentreceiptdetails",
),
),
);
if (routeSettingName ==
"Paymentreceiptdetails") {
debugPrint("prd");
provider.paymentsListAPI(context, '', '');
}
// if (res == true) {
// provider.paymentsListAPI(context, '', '');
// }
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
],
), ),
); )
}, : Emptywidget(context),
),
),
)
: Emptywidget(context),
); );
}, },
); );
......
...@@ -36,7 +36,8 @@ class ProspectDetailsByModeOld extends StatefulWidget { ...@@ -36,7 +36,8 @@ class ProspectDetailsByModeOld extends StatefulWidget {
}); });
@override @override
State<ProspectDetailsByModeOld> createState() => ProspectDetailsByModeOldState(); State<ProspectDetailsByModeOld> createState() =>
ProspectDetailsByModeOldState();
} }
class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
...@@ -100,9 +101,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -100,9 +101,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
editProvider.accountDetails.salutationName != null) { editProvider.accountDetails.salutationName != null) {
editProvider.selectedSalutation = editProvider.selectedSalutation =
editProvider.salutationList.firstWhere( editProvider.salutationList.firstWhere(
(element) => element == editProvider.accountDetails.salutationName, (element) => element == editProvider.accountDetails.salutationName,
) ?? ) ??
editProvider.salutationList.first; editProvider.salutationList.first;
} }
// print("States:${editProvider.statesList.toList()}"); // print("States:${editProvider.statesList.toList()}");
...@@ -110,53 +111,47 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -110,53 +111,47 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
editProvider.accountDetails.state != null) { editProvider.accountDetails.state != null) {
print(editProvider.accountDetails.state); print(editProvider.accountDetails.state);
final selectedState = editProvider.statesList.firstWhere( final selectedState = editProvider.statesList.firstWhere(
(element) => (element) =>
element.id!.trim() == editProvider.accountDetails.state!.trim(), element.id!.trim() == editProvider.accountDetails.state!.trim(),
); );
if (selectedState != null) { editProvider.selectedStates = selectedState;
editProvider.selectedStates = selectedState; editProvider.selectedStateId = selectedState.id;
editProvider.selectedStateId = selectedState.id; editProvider.selectedStateValue = selectedState.name;
editProvider.selectedStateValue = selectedState.name;
await editProvider.crmLeadListDistrictsOnStateAPIFunction( await editProvider.crmLeadListDistrictsOnStateAPIFunction(
context, context,
widget.mode, widget.mode,
editProvider.selectedStateId, editProvider.selectedStateId,
); );
}
} }
// Prefill district // Prefill district
if (editProvider.districtsList.isNotEmpty && if (editProvider.districtsList.isNotEmpty &&
editProvider.accountDetails.district != null) { editProvider.accountDetails.district != null) {
final selectedDistrict = editProvider.districtsList.firstWhere( final selectedDistrict = editProvider.districtsList.firstWhere(
(element) => (element) =>
element.id!.trim() == editProvider.accountDetails.district!.trim(), element.id!.trim() == editProvider.accountDetails.district!.trim(),
); );
if (selectedDistrict != null) { editProvider.selectedDistricts = selectedDistrict;
editProvider.selectedDistricts = selectedDistrict; editProvider.selectedDistrictId = selectedDistrict.id;
editProvider.selectedDistrictId = selectedDistrict.id; editProvider.selectedDistrictValue = selectedDistrict.district;
editProvider.selectedDistrictValue = selectedDistrict.district;
await editProvider.crmLeadListSubLocOnDistrictAPIFunction( await editProvider.crmLeadListSubLocOnDistrictAPIFunction(
context, context,
widget.mode, widget.mode,
editProvider.selectedDistrictId, editProvider.selectedDistrictId,
); );
}
} }
if (editProvider.subLocationsList.isNotEmpty && if (editProvider.subLocationsList.isNotEmpty &&
editProvider.accountDetails.subLocality != null) { editProvider.accountDetails.subLocality != null) {
final selectedSubLocation = editProvider.subLocationsList.firstWhere( final selectedSubLocation = editProvider.subLocationsList.firstWhere(
(element) => element.id == editProvider.accountDetails.subLocality, (element) => element.id == editProvider.accountDetails.subLocality,
); );
if (selectedSubLocation != null) { editProvider.selectedSubLocations = selectedSubLocation;
editProvider.selectedSubLocations = selectedSubLocation; editProvider.selectedSubLocationId = selectedSubLocation.id;
editProvider.selectedSubLocationId = selectedSubLocation.id; editProvider.selectedSubLocationValue = selectedSubLocation.subLocality;
editProvider.selectedSubLocationValue = selectedSubLocation.subLocality;
}
} }
print("Company Name: ${editProvider.editCompanyNameController.text}"); print("Company Name: ${editProvider.editCompanyNameController.text}");
...@@ -188,22 +183,22 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -188,22 +183,22 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
Widget _scaffold(BuildContext context) { Widget _scaffold(BuildContext context) {
return Consumer2< return Consumer2<
crmProspectDetailsProvider, crmProspectDetailsProvider,
Crmeditprospectaccountprovider Crmeditprospectaccountprovider
>( >(
builder: (context, provider, editProvider, child) { builder: (context, provider, editProvider, child) {
var leadDetails = provider.accountDetails; var leadDetails = provider.accountDetails;
...@@ -336,35 +331,35 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -336,35 +331,35 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
Expanded( Expanded(
child: InkResponse( child: InkResponse(
child: child:
provider.Headings[j] == "Lead Age" provider.Headings[j] == "Lead Age"
? Tooltip( ? Tooltip(
triggerMode: TooltipTriggerMode.tap, triggerMode: TooltipTriggerMode.tap,
message: message:
"${provider.accountDetails.createdDatetime}", "${provider.accountDetails.createdDatetime}",
child: Text( child: Text(
provider.subHeadings[j] == "" provider.subHeadings[j] == ""
? "-" ? "-"
: provider.subHeadings[j], : provider.subHeadings[j],
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xFF818181), color: Color(0xFF818181),
decorationColor: decorationColor:
AppColors.grey_semi, AppColors.grey_semi,
decoration: decoration:
TextDecoration.underline, TextDecoration.underline,
), ),
), ),
) )
: Text( : Text(
provider.subHeadings[j] == "" provider.subHeadings[j] == ""
? "-" ? "-"
: provider.subHeadings[j], : provider.subHeadings[j],
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xFF818181), color: Color(0xFF818181),
), ),
), ),
), ),
), ),
], ],
...@@ -433,27 +428,27 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -433,27 +428,27 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
editProsProvider.employeesList editProsProvider.employeesList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<Employees>( DropdownMenuItem<Employees>(
value: slist, value: slist,
child: Text( child: Text(
slist.name!, slist.name!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: value:
editProsProvider.employeesList.contains( editProsProvider.employeesList.contains(
editProsProvider editProsProvider
.selectedEmployees, .selectedEmployees,
) )
? editProsProvider.selectedEmployees ? editProsProvider.selectedEmployees
: null, : null,
// value: provider.selectedEmployees, // value: provider.selectedEmployees,
onChanged: (Employees? value) { onChanged: (Employees? value) {
...@@ -464,10 +459,10 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -464,10 +459,10 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
editProsProvider.selectedEmployees = editProsProvider.selectedEmployees =
value; value;
editProsProvider.selectedEmployeeId = editProsProvider.selectedEmployeeId =
value!.id!; value.id!;
editProsProvider editProsProvider
.selectedEmployeeValue = .selectedEmployeeValue =
value!.name!; value.name!;
} }
} }
}, },
...@@ -475,33 +470,33 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -475,33 +470,33 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController:
editProsProvider.searchController, editProsProvider.searchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: TextFormField( child: TextFormField(
controller: controller:
editProsProvider.searchController, editProsProvider.searchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding:
const EdgeInsets.symmetric( const EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 8, vertical: 8,
), ),
hintText: 'Search account...', hintText: 'Search account...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: borderRadius:
BorderRadius.circular(8), BorderRadius.circular(8),
), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) { searchMatchFn: (item, searchValue) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains( .contains(
searchValue.toLowerCase(), searchValue.toLowerCase(),
) ?? ) ??
false; false;
}, },
), ),
...@@ -514,9 +509,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -514,9 +509,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -525,17 +520,17 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -525,17 +520,17 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
InkWell( InkWell(
onTap: onTap:
editProsProvider.isLoading editProsProvider.isLoading
? null ? null
: () { : () {
editProsProvider.isLoading = true; editProsProvider.isLoading = true;
editProsProvider editProsProvider
.crmProspectDetailsTransferAccountAPIFunction( .crmProspectDetailsTransferAccountAPIFunction(
context, context,
accID, accID,
editProsProvider.selectedEmployeeId, editProsProvider.selectedEmployeeId,
); );
}, },
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
height: 45, height: 45,
...@@ -551,17 +546,17 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -551,17 +546,17 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
), ),
child: Center( child: Center(
child: child:
editProsProvider.isLoading editProsProvider.isLoading
? CircularProgressIndicator.adaptive( ? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation( valueColor: AlwaysStoppedAnimation(
AppColors.white, AppColors.white,
), ),
) )
: Text( : Text(
"Submit", "Submit",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
), ),
), ),
), ),
...@@ -592,8 +587,8 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -592,8 +587,8 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
builder: (context, setState) { builder: (context, setState) {
return SafeArea( return SafeArea(
child: Consumer2< child: Consumer2<
Crmeditprospectaccountprovider, Crmeditprospectaccountprovider,
crmProspectDetailsProvider crmProspectDetailsProvider
>( >(
builder: (context, provider, prosDetProvider, child) { builder: (context, provider, prosDetProvider, child) {
return Container( return Container(
...@@ -637,20 +632,20 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -637,20 +632,20 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.salutationList provider.salutationList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<String>( DropdownMenuItem<String>(
value: slist, value: slist,
child: Text( child: Text(
slist, slist,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: provider.selectedSalutation, value: provider.selectedSalutation,
onChanged: (String? value) { onChanged: (String? value) {
if (value != null) { if (value != null) {
...@@ -665,9 +660,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -665,9 +660,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -697,33 +692,33 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -697,33 +692,33 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.statesList provider.statesList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<States>( DropdownMenuItem<States>(
value: slist, value: slist,
child: Text( child: Text(
slist.name!, slist.name!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: value:
provider.statesList.contains( provider.statesList.contains(
provider.selectedStates, provider.selectedStates,
) )
? provider.selectedStates ? provider.selectedStates
: null, : null,
onChanged: (States? value) { onChanged: (States? value) {
if (value != null) { if (value != null) {
if (provider.statesList.isNotEmpty) { if (provider.statesList.isNotEmpty) {
provider.selectedStates = value; provider.selectedStates = value;
provider.selectedStateId = value!.id!; provider.selectedStateId = value.id!;
provider.selectedStateValue = provider.selectedStateValue =
value!.name!; value.name!;
if (provider if (provider
.districtsList .districtsList
.isNotEmpty) { .isNotEmpty) {
...@@ -734,10 +729,10 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -734,10 +729,10 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
} }
provider provider
.crmLeadListDistrictsOnStateAPIFunction( .crmLeadListDistrictsOnStateAPIFunction(
context, context,
widget.mode, widget.mode,
provider.selectedStateId, provider.selectedStateId,
); );
} }
} }
}, },
...@@ -745,9 +740,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -745,9 +740,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -765,57 +760,57 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -765,57 +760,57 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.districtsList provider.districtsList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<Districts>( DropdownMenuItem<Districts>(
value: slist, value: slist,
child: Text( child: Text(
slist.district!, slist.district!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: value:
provider.districtsList.contains( provider.districtsList.contains(
provider.selectedDistricts, provider.selectedDistricts,
) )
? provider.selectedDistricts ? provider.selectedDistricts
: null, : null,
// value: provider.selectedDistricts, // value: provider.selectedDistricts,
onChanged: (Districts? value) { onChanged: (Districts? value) {
if (value != null) { if (value != null) {
if (provider.districtsList.isNotEmpty) { if (provider.districtsList.isNotEmpty) {
provider.selectedDistricts = value; provider.selectedDistricts = value;
provider.selectedDistrictId = provider.selectedDistrictId =
value!.id!; value.id!;
provider.selectedDistrictValue = provider.selectedDistrictValue =
value!.district!; value.district!;
if (provider if (provider
.subLocationsList .subLocationsList
.isNotEmpty) { .isNotEmpty) {
provider.subLocationsList.clear(); provider.subLocationsList.clear();
provider.selectedSubLocations = provider.selectedSubLocations =
null; null;
provider.selectedSubLocationId = provider.selectedSubLocationId =
null; null;
provider.selectedSubLocationValue = provider.selectedSubLocationValue =
""; "";
} }
provider provider
.crmLeadListSubLocOnDistrictAPIFunction( .crmLeadListSubLocOnDistrictAPIFunction(
context, context,
widget.mode, widget.mode,
provider.selectedDistrictId, provider.selectedDistrictId,
); );
prosDetProvider prosDetProvider
.crmProspectDetailsAPIFunction( .crmProspectDetailsAPIFunction(
context, context,
widget.leadId, widget.leadId,
); );
} }
} }
}, },
...@@ -823,9 +818,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -823,9 +818,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -843,27 +838,27 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -843,27 +838,27 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.subLocationsList provider.subLocationsList
.map( .map(
(slist) => DropdownMenuItem< (slist) => DropdownMenuItem<
SubLocations SubLocations
>( >(
value: slist, value: slist,
child: Text( child: Text(
slist.subLocality!, slist.subLocality!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: value:
provider.subLocationsList.contains( provider.subLocationsList.contains(
provider.selectedSubLocations, provider.selectedSubLocations,
) )
? provider.selectedSubLocations ? provider.selectedSubLocations
: null, : null,
// value: provider.selectedSubLocations, // value: provider.selectedSubLocations,
onChanged: (SubLocations? value) { onChanged: (SubLocations? value) {
if (value != null) { if (value != null) {
...@@ -872,9 +867,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -872,9 +867,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
.isNotEmpty) { .isNotEmpty) {
provider.selectedSubLocations = value; provider.selectedSubLocations = value;
provider.selectedSubLocationId = provider.selectedSubLocationId =
value!.id!; value.id!;
provider.selectedSubLocationValue = provider.selectedSubLocationValue =
value!.subLocality!; value.subLocality!;
} }
} }
}, },
...@@ -882,9 +877,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -882,9 +877,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
...@@ -916,21 +911,21 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -916,21 +911,21 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
InkResponse( InkResponse(
onTap: onTap:
provider.isLoading provider.isLoading
? null ? null
: () { : () {
provider.isLoading = true; provider.isLoading = true;
provider provider
.crmProspectDetailsEditAccountSubmitAPIFunction( .crmProspectDetailsEditAccountSubmitAPIFunction(
context, context,
accID, accID,
provider.selectedSalutation, provider.selectedSalutation,
provider.selectedStateId, provider.selectedStateId,
provider.selectedDistrictId, provider.selectedDistrictId,
provider.selectedSubLocationId, provider.selectedSubLocationId,
); );
Navigator.pop(context); Navigator.pop(context);
}, },
child: Container( child: Container(
height: 45, height: 45,
alignment: Alignment.center, alignment: Alignment.center,
...@@ -944,20 +939,20 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -944,20 +939,20 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
child: child:
provider.isLoading provider.isLoading
? CircularProgressIndicator.adaptive( ? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation( valueColor: AlwaysStoppedAnimation(
AppColors.white, AppColors.white,
), ),
) )
: Text( : Text(
"Submit", "Submit",
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
color: Colors.white, color: Colors.white,
), ),
), ),
), ),
), ),
], ],
...@@ -1026,9 +1021,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -1026,9 +1021,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => ProspectLeadDetails( (context) => ProspectLeadDetails(
leadID: widget.leadId, leadID: widget.leadId,
mode: widget.mode, mode: widget.mode,
), ),
), ),
); );
break; break;
...@@ -1038,9 +1033,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -1038,9 +1033,9 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => ProspectContactDetails( (context) => ProspectContactDetails(
accountId: accountId:
provider.accountDetails.id, provider.accountDetails.id,
), ),
), ),
); );
break; break;
...@@ -1050,8 +1045,8 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -1050,8 +1045,8 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => ProspectOrderDetails( (context) => ProspectOrderDetails(
leadID: widget.leadId, leadID: widget.leadId,
), ),
), ),
); );
break; break;
...@@ -1061,8 +1056,8 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> { ...@@ -1061,8 +1056,8 @@ class ProspectDetailsByModeOldState extends State<ProspectDetailsByModeOld> {
MaterialPageRoute( MaterialPageRoute(
builder: builder:
(context) => ProspectPaymentDetails( (context) => ProspectPaymentDetails(
leadID: widget.leadId, leadID: widget.leadId,
), ),
), ),
); );
break; break;
......
...@@ -69,15 +69,15 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> { ...@@ -69,15 +69,15 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> {
} }
return (connection == "Online") return (connection == "Online")
? Platform.isAndroid ? Platform.isAndroid
? WillPopScope( ? WillPopScope(
onWillPop: () => onBackPressed(context), onWillPop: () => onBackPressed(context),
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold(context),
), ),
) )
: _scaffold(context) : _scaffold(context)
: NoNetwork(context); : NoNetwork(context);
} }
...@@ -108,187 +108,187 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> { ...@@ -108,187 +108,187 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> {
), ),
backgroundColor: AppColors.scaffold_bg_color, backgroundColor: AppColors.scaffold_bg_color,
body: body:
provider.isLoading provider.isLoading
? Center( ? Center(
child: CircularProgressIndicator.adaptive( child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue, AppColors.app_blue,
), ),
),
)
: crmLists.isNotEmpty
? SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: crmLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (crmLists.isEmpty) {
return SizedBox(
child: Center(child: Text("No Data Available")),
);
}
// if(crmLists[index].aid=="1726"){
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
), ),
child: Column( )
children: [ : crmLists.isNotEmpty
Row( ? SizedBox(
children: [ child: Scrollbar(
Expanded( thumbVisibility: false,
flex: 1, child: ListView.builder(
child: Container( itemCount: crmLists.length,
height: 50, shrinkWrap: true,
width: 35, physics: AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.all(8.0), itemBuilder: (context, index) {
decoration: BoxDecoration( if (crmLists.isEmpty) {
color: Color(0xFFE6F6FF), return SizedBox(
borderRadius: BorderRadius.circular( child: Center(child: Text("No Data Available")),
8, );
), }
),
child: SvgPicture.asset( // if(crmLists[index].aid=="1726"){
"assets/svg/se_block_head.svg", return Container(
), padding: EdgeInsets.symmetric(
), horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
), ),
SizedBox(width: 10), decoration: BoxDecoration(
Expanded( color: Colors.white,
flex: 4, borderRadius: BorderRadius.circular(16),
child: SizedBox( ),
child: Column( child: Column(
crossAxisAlignment: children: [
CrossAxisAlignment.start, Row(
children: [ children: [
Text( Expanded(
crmLists[index].aname!, flex: 1,
style: TextStyle( child: Container(
fontFamily: "JakartaMedium", height: 50,
fontSize: 14, width: 35,
color: AppColors.semi_black, padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(
8,
),
),
child: SvgPicture.asset(
"assets/svg/se_block_head.svg",
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
crmLists[index].aname!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
],
),
), ),
), ),
], ],
), ),
), Divider(
), thickness: 0.5,
], color: Color(0xFFD7D7D7),
), ),
Divider( ...List.generate(6, (j) {
thickness: 0.5, final headings = [
color: Color(0xFFD7D7D7), "Account Manager",
), "Contact Person",
...List.generate(6, (j) { "Mobile Number",
final headings = [ "Address",
"Account Manager", "Account Age",
"Contact Person", "GST Number",
"Mobile Number", ];
"Address",
"Account Age",
"GST Number",
];
final subHeadings = [ final subHeadings = [
crmLists[index].accman, crmLists[index].accman,
crmLists[index].cname, crmLists[index].cname,
crmLists[index].mob1, crmLists[index].mob1,
crmLists[index].address, crmLists[index].address,
"${crmLists[index].age} days old", "${crmLists[index].age} days old",
crmLists[index].gstNumber, crmLists[index].gstNumber,
]; ];
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 5), padding: EdgeInsets.symmetric(vertical: 5),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
headings[j], headings[j],
style: TextStyle( style: TextStyle(
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
fontSize: 14, fontSize: 14,
color: AppColors.semi_black, color: AppColors.semi_black,
),
),
),
Expanded(
child: Text(
subHeadings[j]!,
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
),
),
],
), ),
), );
), }),
Expanded( InkResponse(
child: Text( onTap: () async {
subHeadings[j]!, Navigator.push(
style: TextStyle( context,
fontSize: 14, MaterialPageRoute(
color: Color(0xFF818181), builder:
(context) => ProspectDetailsByMode(
pageTitleName:
widget.pageTitleName,
mode: widget.mode,
leadId:
provider
.accountList[index]
.aid,
),
),
);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
), ),
), ),
), ),
], ],
), ),
); );
}), },
InkResponse( ),
onTap: () async {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => ProspectDetailsByMode(
pageTitleName:
widget.pageTitleName,
mode: widget.mode,
leadId:
provider
.accountList[index]
.aid,
),
),
);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
],
), ),
); )
}, : Emptywidget(context),
),
),
)
: Emptywidget(context),
); );
}, },
); );
...@@ -352,26 +352,26 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> { ...@@ -352,26 +352,26 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> {
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
), ),
items: items:
provider.employeesList provider.employeesList
.map( .map(
(slist) => (slist) =>
DropdownMenuItem<Employees>( DropdownMenuItem<Employees>(
value: slist, value: slist,
child: Text( child: Text(
slist.name!, slist.name!,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
) )
.toList(), .toList(),
value: value:
provider.employeesList.contains( provider.employeesList.contains(
provider.selectedEmployees, provider.selectedEmployees,
) )
? provider.selectedEmployees ? provider.selectedEmployees
: null, : null,
// value: provider.selectedEmployees, // value: provider.selectedEmployees,
onChanged: (Employees? value) { onChanged: (Employees? value) {
...@@ -381,9 +381,9 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> { ...@@ -381,9 +381,9 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> {
.isNotEmpty) { .isNotEmpty) {
provider.selectedEmployees = value; provider.selectedEmployees = value;
provider.selectedEmployeeId = provider.selectedEmployeeId =
value!.id!; value.id!;
provider.selectedEmployeeValue = provider.selectedEmployeeValue =
value!.name!; value.name!;
} }
} }
}, },
...@@ -391,33 +391,33 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> { ...@@ -391,33 +391,33 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> {
dropdownSearchData: DropdownSearchData( dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, searchInnerWidgetHeight: 50,
searchController: searchController:
provider.searchController, provider.searchController,
searchInnerWidget: Padding( searchInnerWidget: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: TextFormField( child: TextFormField(
controller: controller:
provider.searchController, provider.searchController,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
contentPadding: contentPadding:
const EdgeInsets.symmetric( const EdgeInsets.symmetric(
horizontal: 10, horizontal: 10,
vertical: 8, vertical: 8,
), ),
hintText: 'Search account...', hintText: 'Search account...',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: borderRadius:
BorderRadius.circular(8), BorderRadius.circular(8),
), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) { searchMatchFn: (item, searchValue) {
return item.value?.name return item.value?.name
?.toLowerCase() ?.toLowerCase()
.contains( .contains(
searchValue.toLowerCase(), searchValue.toLowerCase(),
) ?? ) ??
false; false;
}, },
), ),
...@@ -429,9 +429,9 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> { ...@@ -429,9 +429,9 @@ class _ProspectListByModeoldState extends State<ProspectListByModeold> {
buttonStyleData: ddtheme.buttonStyleData, buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData, iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: menuItemStyleData:
ddtheme.menuItemStyleData, ddtheme.menuItemStyleData,
dropdownStyleData: dropdownStyleData:
ddtheme.dropdownStyleData, ddtheme.dropdownStyleData,
), ),
), ),
], ],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment