Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sai Srinivas
GEN_ERP_2025
Commits
ad026e51
Commit
ad026e51
authored
Aug 12, 2025
by
Sai Srinivas
Browse files
08-08-2025 By Sai Srinivas
Order Module
parent
b5225d58
Changes
25
Show whitespace changes
Inline
Side-by-side
assets/svg/order/tpc_details_req_ic.svg
0 → 100644
View file @
ad026e51
<svg
width=
"38"
height=
"37"
viewBox=
"0 0 38 37"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<circle
cx=
"18.8506"
cy=
"18.7314"
r=
"18.208"
fill=
"#E6F6FF"
/>
<path
d=
"M19.1697 27.8887C17.7272 27.9247 14.8924 27.7008 13.9658 27.4803C13.3341 27.347 12.7406 26.9796 12.2934 26.468C11.8516 25.9695 11.5738 25.3471 11.4979 24.6853V24.6656C11.4495 24.1884 11.4345 23.7084 11.4531 23.2291C11.4531 23.2291 11.4176 22.8059 11.4979 22.0383C11.4979 22.0317 11.4979 22.0257 11.4979 22.0192C11.565 21.3891 11.8469 20.8013 12.2962 20.3544C12.7473 19.9024 13.3388 19.6174 13.9735 19.5463C14.9017 19.448 17.731 19.394 19.1687 19.3945C20.6063 19.3951 22.9131 19.4491 23.8424 19.5463C24.477 19.6174 25.0686 19.9024 25.5197 20.3544C25.9689 20.8016 26.2508 21.3895 26.3185 22.0197V22.0394C26.3648 22.4341 26.3879 22.8311 26.3879 23.2285C26.3907 23.709 26.3677 24.1893 26.3191 24.6673V24.6869C26.2438 25.3497 25.9662 25.9733 25.5241 26.4729C25.0764 26.9845 24.4829 27.3519 23.8511 27.4846C22.924 27.6921 20.6101 27.8985 19.1697 27.8887Z"
fill=
"url(#paint0_linear_1_10142)"
/>
<path
d=
"M18.8251 18.3142C21.3065 18.3142 23.3181 16.3026 23.3181 13.8212C23.3181 11.3397 21.3065 9.32812 18.8251 9.32812C16.3436 9.32812 14.332 11.3397 14.332 13.8212C14.332 16.3026 16.3436 18.3142 18.8251 18.3142Z"
fill=
"url(#paint1_linear_1_10142)"
/>
<defs>
<linearGradient
id=
"paint0_linear_1_10142"
x1=
"23.7474"
y1=
"28.2572"
x2=
"14.0707"
y2=
"18.5804"
gradientUnits=
"userSpaceOnUse"
>
<stop
stop-color=
"#FE7838"
/>
<stop
offset=
"0.54"
stop-color=
"#FE7636"
/>
<stop
offset=
"1"
stop-color=
"#FFAD8A"
/>
</linearGradient>
<linearGradient
id=
"paint1_linear_1_10142"
x1=
"22.0022"
y1=
"16.9983"
x2=
"15.6479"
y2=
"10.644"
gradientUnits=
"userSpaceOnUse"
>
<stop
stop-color=
"#E09868"
/>
<stop
offset=
"0.51"
stop-color=
"#E09868"
/>
<stop
offset=
"1"
stop-color=
"#F9C4A0"
/>
</linearGradient>
</defs>
</svg>
lib/Models/crmModels/crmDashboardFollowUpResponse.dart
0 → 100644
View file @
ad026e51
class
crmDashboardFollowUpResponse
{
String
?
error
;
List
<
FollowupLists
>?
followupLists
;
String
?
message
;
int
?
sessionExists
;
crmDashboardFollowUpResponse
(
{
this
.
error
,
this
.
followupLists
,
this
.
message
,
this
.
sessionExists
});
crmDashboardFollowUpResponse
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
error
=
json
[
'error'
];
if
(
json
[
'followup_lists'
]
!=
null
)
{
followupLists
=
<
FollowupLists
>[];
json
[
'followup_lists'
].
forEach
((
v
)
{
followupLists
!.
add
(
new
FollowupLists
.
fromJson
(
v
));
});
}
message
=
json
[
'message'
];
sessionExists
=
json
[
'session_exists'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'error'
]
=
this
.
error
;
if
(
this
.
followupLists
!=
null
)
{
data
[
'followup_lists'
]
=
this
.
followupLists
!.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
data
[
'message'
]
=
this
.
message
;
data
[
'session_exists'
]
=
this
.
sessionExists
;
return
data
;
}
}
class
FollowupLists
{
String
?
aname
;
String
?
appdate
;
String
?
atype
;
String
?
anote
;
String
?
leadid
;
String
?
lstatus
;
String
?
lempid
;
String
?
aid
;
FollowupLists
(
{
this
.
aname
,
this
.
appdate
,
this
.
atype
,
this
.
anote
,
this
.
leadid
,
this
.
lstatus
,
this
.
lempid
,
this
.
aid
});
FollowupLists
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
aname
=
json
[
'aname'
];
appdate
=
json
[
'appdate'
];
atype
=
json
[
'atype'
];
anote
=
json
[
'anote'
];
leadid
=
json
[
'leadid'
];
lstatus
=
json
[
'lstatus'
];
lempid
=
json
[
'lempid'
];
aid
=
json
[
'aid'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'aname'
]
=
this
.
aname
;
data
[
'appdate'
]
=
this
.
appdate
;
data
[
'atype'
]
=
this
.
atype
;
data
[
'anote'
]
=
this
.
anote
;
data
[
'leadid'
]
=
this
.
leadid
;
data
[
'lstatus'
]
=
this
.
lstatus
;
data
[
'lempid'
]
=
this
.
lempid
;
data
[
'aid'
]
=
this
.
aid
;
return
data
;
}
}
lib/Models/crmModels/crmDashboardQuotationResponse.dart
0 → 100644
View file @
ad026e51
class
crmDashboardQuotationResponse
{
String
?
error
;
List
<
QuotationLists
>?
quotationLists
;
String
?
message
;
int
?
sessionExists
;
crmDashboardQuotationResponse
(
{
this
.
error
,
this
.
quotationLists
,
this
.
message
,
this
.
sessionExists
});
crmDashboardQuotationResponse
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
error
=
json
[
'error'
];
if
(
json
[
'quotation_lists'
]
!=
null
)
{
quotationLists
=
<
QuotationLists
>[];
json
[
'quotation_lists'
].
forEach
((
v
)
{
quotationLists
!.
add
(
new
QuotationLists
.
fromJson
(
v
));
});
}
message
=
json
[
'message'
];
sessionExists
=
json
[
'session_exists'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'error'
]
=
this
.
error
;
if
(
this
.
quotationLists
!=
null
)
{
data
[
'quotation_lists'
]
=
this
.
quotationLists
!.
map
((
v
)
=>
v
.
toJson
()).
toList
();
}
data
[
'message'
]
=
this
.
message
;
data
[
'session_exists'
]
=
this
.
sessionExists
;
return
data
;
}
}
class
QuotationLists
{
String
?
aname
;
String
?
leadid
;
String
?
lstatus
;
String
?
lempid
;
String
?
quotationId
;
QuotationLists
(
{
this
.
aname
,
this
.
leadid
,
this
.
lstatus
,
this
.
lempid
,
this
.
quotationId
});
QuotationLists
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
aname
=
json
[
'aname'
];
leadid
=
json
[
'leadid'
];
lstatus
=
json
[
'lstatus'
];
lempid
=
json
[
'lempid'
];
quotationId
=
json
[
'quotation_id'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'aname'
]
=
this
.
aname
;
data
[
'leadid'
]
=
this
.
leadid
;
data
[
'lstatus'
]
=
this
.
lstatus
;
data
[
'lempid'
]
=
this
.
lempid
;
data
[
'quotation_id'
]
=
this
.
quotationId
;
return
data
;
}
}
lib/Models/ordersModels/EditPaymentDetailsAdjustedOrdersViewResponse.dart
View file @
ad026e51
class
EditPaymentDetailsAdjustedOrdersViewResponse
{
List
<
PaidList
>?
paidList
;
List
<
Edit
PaidList
>?
paidList
;
List
<
EditOrderList
>?
editOrderList
;
String
?
error
;
String
?
message
;
...
...
@@ -10,9 +10,9 @@ class EditPaymentDetailsAdjustedOrdersViewResponse {
EditPaymentDetailsAdjustedOrdersViewResponse
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
if
(
json
[
'paid_list'
]
!=
null
)
{
paidList
=
<
PaidList
>[];
paidList
=
<
Edit
PaidList
>[];
json
[
'paid_list'
].
forEach
((
v
)
{
paidList
!.
add
(
new
PaidList
.
fromJson
(
v
));
paidList
!.
add
(
new
Edit
PaidList
.
fromJson
(
v
));
});
}
if
(
json
[
'order_list'
]
!=
null
)
{
...
...
@@ -39,7 +39,7 @@ class EditPaymentDetailsAdjustedOrdersViewResponse {
}
}
class
PaidList
{
class
Edit
PaidList
{
String
?
accId
;
String
?
orderId
;
String
?
orderPaymentId
;
...
...
@@ -49,7 +49,7 @@ class PaidList {
String
?
balanceAmount
;
String
?
adjustedAmount
;
PaidList
(
Edit
PaidList
(
{
this
.
accId
,
this
.
orderId
,
this
.
orderPaymentId
,
...
...
@@ -59,7 +59,7 @@ class PaidList {
this
.
balanceAmount
,
this
.
adjustedAmount
});
PaidList
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
Edit
PaidList
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
accId
=
json
[
'acc_id'
];
orderId
=
json
[
'order_id'
];
orderPaymentId
=
json
[
'order_payment_id'
];
...
...
lib/Notifiers/crmProvider/crmDashboardProvider.dart
View file @
ad026e51
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/Models/crmModels/crmDashboardFollowUpResponse.dart'
;
import
'package:generp/Models/crmModels/crmDashboardQuotationResponse.dart'
;
import
'package:generp/Models/crmModels/crmDashboardResponse.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:geolocator/geolocator.dart'
;
import
'package:geolocator/geolocator.dart'
as
geo_location
;
import
'package:google_maps_flutter/google_maps_flutter.dart'
;
...
...
@@ -28,6 +31,13 @@ class Crmdashboardprovider extends ChangeNotifier {
List
<
Leads
>
_leadsList
=
[];
List
<
Enquires
>
_enquiresList
=
[];
List
<
FollowupLists
>
_dashboardFollowUps
=
[];
List
<
QuotationLists
>
_dashboardQuotations
=
[];
List
<
FollowupLists
>
get
dashboardFollowUps
=>
_dashboardFollowUps
;
List
<
QuotationLists
>
get
dashboardQuotations
=>
_dashboardQuotations
;
LatLng
?
currentLocationLatLng
;
String
latlongs
=
""
;
...
...
@@ -225,4 +235,46 @@ class Crmdashboardprovider extends ChangeNotifier {
}
catch
(
e
,
s
)
{}
}
Future
<
void
>
crmDashboardFollowUpAPIFunction
(
context
,
type
)
async
{
try
{
var
HomeProv
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
final
data
=
await
ApiCalling
.
crmDashboardFollowUpAPI
(
HomeProv
.
empId
,
HomeProv
.
session
,
type
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
){
if
(
data
.
error
==
"0"
)
{
_dashboardFollowUps
=
data
.
followupLists
!;
notifyListeners
();
}
}
else
{
sessionDoesNotExist
(
context
);
}
}
}
catch
(
e
,
s
)
{}
}
Future
<
void
>
crmDashboardQuotationsAPIFunction
(
context
)
async
{
try
{
var
HomeProv
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
final
data
=
await
ApiCalling
.
crmDashboardQuotationsAPI
(
HomeProv
.
empId
,
HomeProv
.
session
,
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
){
if
(
data
.
error
==
"0"
)
{
_dashboardQuotations
=
data
.
quotationLists
!;
notifyListeners
();
}
}
else
{
sessionDoesNotExist
(
context
);
}
}
}
catch
(
e
,
s
)
{}
}
}
lib/Notifiers/ordersProvider/addPaymentProvider.dart
View file @
ad026e51
...
...
@@ -47,6 +47,7 @@ class Addpaymentprovider extends ChangeNotifier{
final
ImagePicker
_picker
=
ImagePicker
();
DateTime
?
_date
;
String
?
_formattedDate
;
String
?
_formattedDateToSend
;
Timer
?
_debounce
;
List
<
String
>
_paymentMode
=
[];
...
...
@@ -89,6 +90,8 @@ class Addpaymentprovider extends ChangeNotifier{
List
<
String
?>
get
selectedBalanceAmounts
=>
_selectedBalanceAmounts
;
List
<
String
?>
get
selectedCreatedDatetimes
=>
_selectedCreatedDatetimes
;
String
?
get
formattedDate
=>
_formattedDate
;
String
?
get
formattedDateToSend
=>
_formattedDateToSend
;
DateTime
?
get
dateNow
=>
_date
;
File
?
get
imagePath
=>
_imageName
;
File
?
get
imageFilePath
=>
_image
;
...
...
@@ -186,7 +189,8 @@ class Addpaymentprovider extends ChangeNotifier{
void
setDate
(
DateTime
newDate
)
{
_date
=
newDate
;
_formattedDate
=
DateFormat
(
'yyyy-MM-dd'
).
format
(
newDate
);
_formattedDate
=
DateFormat
(
'd MMM yyyy'
).
format
(
newDate
);
_formattedDateToSend
=
DateFormat
(
'yyyy-MM-dd'
).
format
(
newDate
);
paymentReceivedDateController
.
text
=
_formattedDate
!;
dateError
=
null
;
notifyListeners
();
...
...
lib/Notifiers/ordersProvider/editPaymentProvider.dart
View file @
ad026e51
import
'package:flutter/cupertino.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Notifiers/ordersProvider/paymentsProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -9,10 +10,15 @@ import 'addPaymentProvider.dart';
class
Editpaymentprovider
extends
ChangeNotifier
{
bool
_submitLoading
=
false
;
List
<
PaidList
>
_paidList
=
[];
TextEditingController
adjustedAddAmountController
=
TextEditingController
();
String
?
approvalRejectionError
;
String
?
adjustedAddAmountError
;
String
?
selectedAccountError
;
List
<
EditPaidList
>
_paidList
=
[];
List
<
EditOrderList
>
_editOrderList
=
[];
PaidList
?
_selectedPaidList
;
Edit
PaidList
?
_selectedPaidList
s
;
EditOrderList
?
_selectedOrderList
;
List
<
TextEditingController
>
editOrderAmountControllers
=
[];
...
...
@@ -23,11 +29,11 @@ class Editpaymentprovider extends ChangeNotifier {
List
<
Map
<
String
,
String
>>
_insertAmounts
=
[];
List
<
Map
<
String
,
String
>>
_updateAmounts
=
[];
List
<
PaidList
>
get
paidList
=>
_paidList
;
List
<
Edit
PaidList
>
get
paidList
=>
_paidList
;
List
<
EditOrderList
>
get
editOrderList
=>
_editOrderList
;
PaidList
?
get
selectedPaidList
=>
_selectedPaidList
;
Edit
PaidList
?
get
selectedPaidList
s
=>
_selectedPaidList
s
;
EditOrderList
?
get
selectedOrderList
=>
_selectedOrderList
;
...
...
@@ -36,7 +42,31 @@ class Editpaymentprovider extends ChangeNotifier {
List
<
String
?>
get
selectedOrderIDs
=>
_selectedOrderIDs
;
bool
get
submitLoading
=>
_submitLoading
;
List
<
EditPaidList
>
_editpaidLists
=
[];
List
<
EditPaidList
>
get
editpaidLists
=>
_editpaidLists
;
EditPaidList
?
_editselectedPaidList
;
String
?
_editselectedPaidOrderId
;
String
?
_editselectedPaidOrderValue
;
EditPaidList
?
get
editselectedPaidList
=>
_editselectedPaidList
;
String
?
get
editselectedPaidOrderId
=>
_editselectedPaidOrderId
;
String
?
get
editselectedPaidOrderValue
=>
_editselectedPaidOrderValue
;
set
editselectedPaidList
(
EditPaidList
?
value
){
_editselectedPaidList
=
value
;
_editselectedPaidOrderId
=
value
!.
orderId
;
_editselectedPaidOrderValue
=
value
!.
orderNumber
;
notifyListeners
();
}
set
editselectedPaidOrderId
(
String
?
value
){
_editselectedPaidOrderId
=
value
;
notifyListeners
();
}
set
editselectedPaidOrderValue
(
String
?
value
){
_editselectedPaidOrderValue
=
value
;
notifyListeners
();
}
set
selectedPaidOrderIDs
(
List
<
String
?>
value
)
{
_selectedPaidOrderIDs
=
value
;
notifyListeners
();
...
...
@@ -47,8 +77,8 @@ class Editpaymentprovider extends ChangeNotifier {
notifyListeners
();
}
set
selectedPaidList
(
PaidList
?
value
)
{
_selectedPaidList
=
value
;
set
selectedPaidList
s
(
Edit
PaidList
?
value
)
{
_selectedPaidList
s
=
value
;
notifyListeners
();
}
...
...
@@ -62,8 +92,8 @@ class Editpaymentprovider extends ChangeNotifier {
notifyListeners
();
}
void
updateSelectedPaidOrderId
(
int
index
,
PaidList
?
value
)
{
_selectedPaidList
=
value
!;
void
updateSelectedPaidOrderId
(
int
index
,
Edit
PaidList
?
value
)
{
_selectedPaidList
s
=
value
!;
_selectedPaidOrderIDs
[
index
]
=
value
!.
orderId
;
print
(
_selectedPaidOrderIDs
[
index
]);
...
...
@@ -247,7 +277,7 @@ class Editpaymentprovider extends ChangeNotifier {
Future
<
void
>
editPaymentDetailsAdjustedOrdersViewAPIFunction
(
context
,
payment_id
,
payment_id
,
[
index
]
)
async
{
try
{
print
(
"payment_id:
${payment_id}
"
);
...
...
@@ -260,10 +290,13 @@ class Editpaymentprovider extends ChangeNotifier {
);
if
(
data
!=
null
)
{
if
(
data
.
error
==
"0"
)
{
_editOrderList
=
data
.
editOrderList
!;
_paidList
=
data
.
paidList
!;
if
(
index
!=
null
){
adjustedAddAmountController
.
text
=
data
.
paidList
![
index
].
orderAmount
!;
_editselectedPaidList
=
data
.
paidList
![
index
];
_editselectedPaidOrderId
=
data
.
paidList
![
index
].
orderId
;
}
getFormDataUpdate
();
notifyListeners
();
}
else
if
(
data
.
error
==
"1"
)
{}
}
else
{}
...
...
@@ -310,14 +343,146 @@ class Editpaymentprovider extends ChangeNotifier {
}
}
Future
<
void
>
paymentsDetailsAddAdjustedOrderModeAPIFunction
(
context
,
paymentId
,
selectedOrderId
,
mode
,
)
async
{
try
{
if
(!
validate
()){
return
;
}
_submitLoading
=
true
;
notifyListeners
();
var
provider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
var
pprovider
=
Provider
.
of
<
Paymentsprovider
>(
context
,
listen:
false
);
final
data
=
await
ApiCalling
.
paymentsDetailsAddAdjustedOrderAPI
(
provider
.
empId
,
provider
.
session
,
paymentId
,
selectedOrderId
,
adjustedAddAmountController
.
text
,
);
if
(
data
!=
null
)
{
if
(
data
.
error
==
"0"
)
{
_submitLoading
=
false
;
toast
(
context
,
"
${data.message}
"
);
resetAll
();
Navigator
.
pop
(
context
,
true
);
pprovider
.
paymentsDetailsByModeAPIFunction
(
context
,
paymentId
,
mode
);
notifyListeners
();
}
else
{
_submitLoading
=
false
;
notifyListeners
();
}
}
else
{
_submitLoading
=
false
;
notifyListeners
();
}
}
catch
(
e
,
s
)
{
_submitLoading
=
false
;
notifyListeners
();
}
}
Future
<
void
>
paymentsDetailsEditAdjustedOrderModeAPIFunction
(
context
,
orderPaymentId
,
selectedOrderId
,
mode
,
paymentId
,
)
async
{
try
{
print
(
"
$selectedOrderId
,
${adjustedAddAmountController.text}
,
$orderPaymentId
,"
);
if
(!
validate
()){
return
;
}
_submitLoading
=
true
;
notifyListeners
();
var
provider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
var
pprovider
=
Provider
.
of
<
Paymentsprovider
>(
context
,
listen:
false
);
final
data
=
await
ApiCalling
.
paymentsDetailsEditAdjustedOrderAPI
(
provider
.
empId
,
provider
.
session
,
selectedOrderId
,
adjustedAddAmountController
.
text
,
orderPaymentId
,
);
if
(
data
!=
null
)
{
if
(
data
.
error
==
"0"
)
{
toast
(
context
,
"
${data.message}
"
);
resetAll
();
Navigator
.
pop
(
context
,
true
);
pprovider
.
paymentsDetailsByModeAPIFunction
(
context
,
paymentId
,
mode
);
notifyListeners
();
}
else
{
_submitLoading
=
false
;
notifyListeners
();
}
}
else
{
_submitLoading
=
false
;
notifyListeners
();
}
}
catch
(
e
,
s
)
{
_submitLoading
=
false
;
}
}
onChnageAmountController
(
value
)
{
adjustedAddAmountError
=
null
;
notifyListeners
();
}
bool
validate
(){
bool
isValid
=
true
;
adjustedAddAmountError
=
null
;
selectedAccountError
=
null
;
if
(
_editselectedPaidList
==
null
||
_editselectedPaidOrderId
==
null
){
selectedAccountError
=
"Please Select a Value"
;
isValid
=
false
;
}
if
(
adjustedAddAmountController
.
text
.
trim
().
isEmpty
){
adjustedAddAmountError
=
"Please enter Amount"
;
isValid
=
false
;
}
_submitLoading
=
false
;
notifyListeners
();
return
isValid
;
}
void
resetAll
()
{
_submitLoading
=
false
;
approvalRejectionError
=
""
;
adjustedAddAmountController
.
clear
();
adjustedAddAmountError
=
null
;
_editselectedPaidList
=
null
;
_editselectedPaidOrderId
=
null
;
_editselectedPaidOrderValue
=
null
;
checkdropDownReset
();
notifyListeners
();
}
checkdropDownReset
(){
if
(
_editselectedPaidList
!=
null
&&
!
_editpaidLists
.
contains
(
_editselectedPaidList
))
{
_editselectedPaidList
=
null
;
_editselectedPaidOrderId
=
null
;
_editselectedPaidOrderValue
=
null
;
}
notifyListeners
();
}
void
checkDropdownselected
()
{
if
(
_selectedOrderList
!=
null
&&
!
_editOrderList
.
contains
(
_selectedOrderList
))
{
selectedOrderList
=
null
;
_selectedOrderIDs
.
clear
();
}
if
(
_selectedPaidList
!=
null
&&
!
_paidList
.
contains
(
_selectedPaidList
))
{
_selectedPaidList
=
null
;
if
(
_
edit
selectedPaidList
!=
null
&&
!
_paidList
.
contains
(
_
edit
selectedPaidList
))
{
_
edit
selectedPaidList
=
null
;
_selectedPaidOrderIDs
.
clear
();
}
}
...
...
@@ -325,7 +490,7 @@ class Editpaymentprovider extends ChangeNotifier {
void
resetForm
()
{
_submitLoading
=
false
;
checkDropdownselected
();
_selectedPaidList
=
null
;
_
edit
selectedPaidList
=
null
;
_selectedOrderList
=
null
;
_selectedOrderIDs
.
clear
();
_selectedPaidOrderIDs
.
clear
();
...
...
lib/Notifiers/ordersProvider/paymentsProvider.dart
View file @
ad026e51
...
...
@@ -10,9 +10,14 @@ import '../../services/api_calling.dart';
import
'../HomeScreenNotifier.dart'
;
class
Paymentsprovider
extends
ChangeNotifier
{
bool
_showMoreDetails
=
false
;
bool
_submitLoading
=
false
;
TextEditingController
approvalRejectionController
=
TextEditingController
();
TextEditingController
adjustedAddAmountController
=
TextEditingController
();
String
?
approvalRejectionError
;
String
?
adjustedAddAmountError
;
String
?
selectedAccountError
;
List
<
Employees
>
_employeesList
=
[];
List
<
OrderList
>
_paymentsList
=
[];
...
...
@@ -26,9 +31,37 @@ class Paymentsprovider extends ChangeNotifier {
List
<
String
>
_subHeadings
=
[];
PaymentDetails
get
paymentDetails
=>
_paymentsDetails
;
List
<
PaidList
>
get
paidLists
=>
_paidLists
;
PaidList
?
_selectedPaidList
;
String
?
_selectedPaidOrderId
;
String
?
_selectedPaidOrderValue
;
PaidList
?
get
selectedPaidList
=>
_selectedPaidList
;
String
?
get
selectedPaidOrderId
=>
_selectedPaidOrderId
;
String
?
get
selectedPaidOrderValue
=>
_selectedPaidOrderValue
;
set
selectedPaidList
(
PaidList
?
value
){
_selectedPaidList
=
value
;
_selectedPaidOrderId
=
value
!.
id
;
_selectedPaidOrderValue
=
value
!.
orderNumber
;
notifyListeners
();
}
set
selectedPaidOrderId
(
String
?
value
){
_selectedPaidOrderId
=
value
;
notifyListeners
();
}
set
selectedPaidOrderValue
(
String
?
value
){
_selectedPaidOrderValue
=
value
;
notifyListeners
();
}
List
<
String
>
get
Headings
=>
_headings
;
bool
get
showMoreDetails
=>
_showMoreDetails
;
bool
get
submitLoading
=>
_submitLoading
;
List
<
String
>
get
subHeadings
=>
_subHeadings
;
List
<
Employees
>
get
employeesList
=>
_employeesList
;
...
...
@@ -43,6 +76,11 @@ class Paymentsprovider extends ChangeNotifier {
bool
get
isLoading
=>
_isLoading
;
set
submitLoading
(
bool
value
){
_submitLoading
=
value
;
notifyListeners
();
}
set
selectedEmployee
(
Employees
?
value
)
{
_selectedEmployee
=
value
;
_selectedEmpID
=
value
?.
id
!;
...
...
@@ -60,6 +98,11 @@ class Paymentsprovider extends ChangeNotifier {
notifyListeners
();
}
set
showMoreDetails
(
bool
value
)
{
_showMoreDetails
=
value
;
notifyListeners
();
}
Future
<
void
>
paymentsListsByModeFilterAPIFunction
(
context
,
mode
)
async
{
try
{
var
provider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
...
...
@@ -113,7 +156,11 @@ class Paymentsprovider extends ChangeNotifier {
}
catch
(
e
,
s
)
{}
}
Future
<
void
>
paymentsDetailsByModeAPIFunction
(
context
,
paymentId
,
mode
)
async
{
Future
<
void
>
paymentsDetailsByModeAPIFunction
(
context
,
paymentId
,
mode
,
)
async
{
try
{
var
provider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
final
data
=
await
ApiCalling
.
paymentsDetailsByModeAPI
(
...
...
@@ -127,7 +174,8 @@ class Paymentsprovider extends ChangeNotifier {
if
(
data
.
error
==
"0"
)
{
_paymentsDetails
=
data
.
paymentDetails
!;
_paidLists
=
data
.
paidList
!;
_headings
=
[
"Account Name"
,
_headings
=
[
"Account Name"
,
"Entered By"
,
"Payment Type"
,
"Payment Reference Number"
,
...
...
@@ -140,25 +188,25 @@ class Paymentsprovider extends ChangeNotifier {
"Attachment"
,
"Created Datetime"
,
"Description"
,
"Status"
,];
"Status"
,
];
_subHeadings
=
[
_paymentsDetails
.
accountName
??
"-"
,
_paymentsDetails
.
enteredEmpName
??
"-"
,
_paymentsDetails
.
paymentType
??
"-"
,
_paymentsDetails
.
refNo
??
"-"
,
_paymentsDetails
.
paymentDate
??
"-"
,
_paymentsDetails
.
adjustedAmount
??
"-"
,
_paymentsDetails
.
amount
??
"-"
,
_paymentsDetails
.
description
??
"-"
,
_paymentsDetails
.
approvalEmployee
??
"-"
,
_paymentsDetails
.
approvalEmployee
??
"-"
,
_paymentsDetails
.
attachmentViewFileName
??
"-"
,
_paymentsDetails
.
datetime
??
"-"
,
_paymentsDetails
.
status
??
"-"
,
_paymentsDetails
.
accountName
??
"-"
,
_paymentsDetails
.
enteredEmpName
??
"-"
,
_paymentsDetails
.
paymentType
??
"-"
,
_paymentsDetails
.
refNo
??
"-"
,
_paymentsDetails
.
paymentDate
??
"-"
,
_paymentsDetails
.
adjustedAmount
??
"-"
,
_paymentsDetails
.
amount
??
"-"
,
_paymentsDetails
.
description
??
"-"
,
_paymentsDetails
.
approvalEmployee
??
"-"
,
_paymentsDetails
.
approvalEmployee
??
"-"
,
_paymentsDetails
.
attachmentViewFileName
??
"-"
,
_paymentsDetails
.
datetime
??
"-"
,
_paymentsDetails
.
status
??
"-"
,
];
_isLoading
=
false
;
}
else
{
_isLoading
=
false
;
}
...
...
@@ -167,35 +215,44 @@ class Paymentsprovider extends ChangeNotifier {
}
catch
(
e
,
s
)
{}
}
Future
<
void
>
paymentApprovalRejectionAPIFunction
(
context
,
paymentId
,
type
)
async
{
try
{
if
(!
validateApprovalRejectionForm
(
context
)){
Future
<
void
>
paymentApprovalRejectionAPIFunction
(
context
,
paymentId
,
type
,
)
async
{
try
{
if
(!
validateApprovalRejectionForm
(
context
))
{
return
;
}
var
provider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
final
data
=
await
ApiCalling
.
paymentOrderApproveRejectAPI
(
provider
.
empId
,
provider
.
session
,
paymentId
,
type
,
approvalRejectionController
.
text
);
if
(
data
!=
null
){
if
(
data
.
error
==
"0"
){
final
data
=
await
ApiCalling
.
paymentOrderApproveRejectAPI
(
provider
.
empId
,
provider
.
session
,
paymentId
,
type
,
approvalRejectionController
.
text
,
);
if
(
data
!=
null
)
{
if
(
data
.
error
==
"0"
)
{
toast
(
context
,
"
${data.message}
"
);
resetForm
();
Navigator
.
pop
(
context
,
true
);
notifyListeners
();
}
}
}
catch
(
e
,
s
){
}
}
catch
(
e
,
s
)
{}
}
Future
<
void
>
paymentDeletionAPIFunction
(
context
,
paymentId
)
async
{
try
{
Future
<
void
>
paymentDeletionAPIFunction
(
context
,
paymentId
)
async
{
try
{
var
provider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
final
data
=
await
ApiCalling
.
paymentOrderDeleteAPI
(
provider
.
empId
,
provider
.
session
,
paymentId
);
if
(
data
!=
null
){
if
(
data
.
error
==
"0"
){
final
data
=
await
ApiCalling
.
paymentOrderDeleteAPI
(
provider
.
empId
,
provider
.
session
,
paymentId
,
);
if
(
data
!=
null
)
{
if
(
data
.
error
==
"0"
)
{
toast
(
context
,
"
${data.message}
"
);
resetForm
();
Navigator
.
pop
(
context
,
true
);
...
...
@@ -203,16 +260,35 @@ class Paymentsprovider extends ChangeNotifier {
notifyListeners
();
}
}
}
catch
(
e
,
s
)
{}
}
}
catch
(
e
,
s
){
bool
validate
(){
bool
isValid
=
true
;
adjustedAddAmountError
=
null
;
selectedAccountError
=
null
;
if
(
_selectedPaidList
==
null
||
_selectedPaidOrderId
==
null
){
selectedAccountError
=
"Please Select a Value"
;
isValid
=
false
;
}
if
(
adjustedAddAmountController
.
text
.
trim
().
isEmpty
){
adjustedAddAmountError
=
"Please enter Amount"
;
isValid
=
false
;
}
_submitLoading
=
false
;
notifyListeners
();
return
isValid
;
}
bool
validateApprovalRejectionForm
(
BuildContext
context
){
bool
validateApprovalRejectionForm
(
BuildContext
context
)
{
bool
isValid
=
true
;
approvalRejectionError
=
null
;
if
(
approvalRejectionController
.
text
.
trim
().
isEmpty
){
if
(
approvalRejectionController
.
text
.
trim
().
isEmpty
)
{
approvalRejectionError
=
"Please Enter Remarks"
;
isValid
=
false
;
}
...
...
@@ -220,28 +296,49 @@ class Paymentsprovider extends ChangeNotifier {
return
isValid
;
}
void
onChangeApprovalRejection
(
value
){
void
onChangeApprovalRejection
(
value
)
{
approvalRejectionError
=
""
;
notifyListeners
();
}
onChnageAmountController
(
value
)
{
adjustedAddAmountError
=
null
;
notifyListeners
();
}
void
resetForm
()
{
void
resetForm
(){
_submitLoading
=
false
;
adjustedAddAmountController
.
clear
();
approvalRejectionController
.
clear
();
approvalRejectionError
=
""
;
adjustedAddAmountError
=
null
;
notifyListeners
();
}
void
resetAll
()
{
_submitLoading
=
false
;
approvalRejectionController
.
clear
();
approvalRejectionError
=
""
;
adjustedAddAmountController
.
clear
();
adjustedAddAmountError
=
null
;
_selectedEmployee
=
null
;
_selectedEmpID
=
""
;
_selectedEmpName
=
""
;
_selectedPaidList
=
null
;
_selectedPaidOrderId
=
null
;
_selectedPaidOrderValue
=
null
;
checkdropDownReset
();
notifyListeners
();
}
checkdropDownReset
(){
if
(
_selectedPaidList
!=
null
&&
!
_paidLists
.
contains
(
_selectedPaidList
))
{
_selectedPaidList
=
null
;
_selectedPaidOrderId
=
null
;
_selectedPaidOrderValue
=
null
;
}
notifyListeners
();
}
}
lib/Notifiers/ordersProvider/tpcAgentsProvider.dart
View file @
ad026e51
...
...
@@ -15,6 +15,7 @@ import '../HomeScreenNotifier.dart';
class
Tpcagentsprovider
extends
ChangeNotifier
{
bool
_submitClicked
=
false
;
bool
_showMoreDetails
=
false
;
TextEditingController
tpcNameController
=
TextEditingController
();
TextEditingController
tpcMobileNumberController
=
TextEditingController
();
...
...
@@ -56,6 +57,7 @@ class Tpcagentsprovider extends ChangeNotifier{
File
?
_imageName
;
bool
get
submitClicked
=>
_submitClicked
;
bool
get
showMoreDetails
=>
_showMoreDetails
;
List
<
String
>
get
Headings
=>
_headings
;
List
<
String
>
get
subHeadings
=>
_subHeadings
;
...
...
@@ -77,6 +79,11 @@ class Tpcagentsprovider extends ChangeNotifier{
notifyListeners
();
}
set
showMoreDetails
(
bool
value
){
_showMoreDetails
=
value
;
notifyListeners
();
}
set
imagePath
(
File
?
value
)
{
_imageName
=
value
;
notifyListeners
();
...
...
lib/screens/crm/AppointmentDetails.dart
View file @
ad026e51
...
...
@@ -320,7 +320,7 @@ Dropdowntheme ddtheme = Dropdowntheme();
InkWell
(
onTap:
provider
.
isLoading
?
null
:(){
provider
.
isLoading
=
true
;
provider
.
crmLeadDetailsAddAppointmentAPIFunction
(
context
,
widget
.
leadID
,
provider
.
dateController
.
text
,
provider
.
selectedVisitType
,
provider
.
noteController
.
text
);
provider
.
crmLeadDetailsAddAppointmentAPIFunction
(
context
,
widget
.
leadID
,
provider
.
formattedDateToSend
,
provider
.
selectedVisitType
,
provider
.
noteController
.
text
);
},
child:
Container
(
...
...
lib/screens/crm/crmDashboard.dart
View file @
ad026e51
...
...
@@ -8,6 +8,8 @@ import 'package:flutter_svg/svg.dart';
import
'package:generp/Notifiers/crmProvider/addNewLeadsandProspectsProvider.dart'
;
import
'package:generp/screens/crm/addLeadsProspectsScreen.dart'
;
import
'package:generp/screens/crm/appointmentCalendar.dart'
;
import
'package:generp/screens/crm/followUpListonType.dart'
;
import
'package:generp/screens/crm/generatedQuotesList.dart'
;
import
'package:generp/screens/crm/pendingTasksDetails.dart'
;
import
'package:generp/screens/crm/pendingTasksList.dart'
;
import
'package:generp/screens/crm/universalSearchScreen.dart'
;
...
...
@@ -250,7 +252,6 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
0xFFED3424
,
0xFF326D72
,
0xFF586000
,
];
return
InkResponse
(
...
...
@@ -288,6 +289,41 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
),
);
}
if
(
leadTitles
[
jndex
]
==
"Quotation Generated"
)
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Generatedquoteslist
(),
settings:
RouteSettings
(
name:
"Generatedquoteslist"
,
),
),
);
}
if
(
leadTitles
[
jndex
]
==
"Today Visits"
)
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Followuplistontype
(
type:
"Visit"
),
settings:
RouteSettings
(
name:
"Generatedquoteslist"
,
),
),
);
}
if
(
leadTitles
[
jndex
]
==
"Today Calls"
)
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Followuplistontype
(
type:
"Phone"
),
settings:
RouteSettings
(
name:
"Generatedquoteslist"
,
),
),
);
}
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
...
...
@@ -1109,7 +1145,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
provider
.
accessPages
.
any
((
element
)
=>
[
8
,
9
].
contains
(
element
.
id
),)?
InkResponse
(
floatingActionButton:
provider
.
accessPages
.
any
((
element
)
=>
[
8
,
9
].
contains
(
element
.
id
))
?
InkResponse
(
onTap:
()
async
{
// if (provider.accessPages
// .where((page) => [8, 9].contains(page.id))
...
...
@@ -1119,7 +1157,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Addleadsprospectsscreen
(),
settings:
RouteSettings
(
name:
'Addleadsprospectsscreen'
),
settings:
RouteSettings
(
name:
'Addleadsprospectsscreen'
,
),
),
);
// }
...
...
@@ -1128,7 +1168,10 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
...
...
@@ -1142,7 +1185,8 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
),
),
),
):
SizedBox
.
shrink
(),
)
:
SizedBox
.
shrink
(),
);
},
);
...
...
lib/screens/crm/followUpListonType.dart
0 → 100644
View file @
ad026e51
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dotted_line/dotted_line.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:generp/Notifiers/crmProvider/crmDashboardProvider.dart'
;
import
'package:generp/Utils/GlobalConstants.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/crm/pendingTasksDetails.dart'
;
import
'package:provider/provider.dart'
;
import
'followUpUpdateScreen.dart'
;
class
Followuplistontype
extends
StatefulWidget
{
final
type
;
const
Followuplistontype
({
super
.
key
,
required
this
.
type
});
@override
State
<
Followuplistontype
>
createState
()
=>
_FollowuplistontypeState
();
}
class
_FollowuplistontypeState
extends
State
<
Followuplistontype
>
{
FocusNode
focusNode
=
FocusNode
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
event
)
{
setState
(()
=>
_source
=
event
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
prov
=
Provider
.
of
<
Crmdashboardprovider
>(
context
,
listen:
false
);
prov
.
crmDashboardFollowUpAPIFunction
(
context
,
widget
.
type
);
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Crmdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
followUps
=
provider
.
dashboardFollowUps
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
// elevation: 2.0,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/appbar_back_button.svg"
,
height:
25
,
),
),
SizedBox
(
width:
10
),
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"Follow Up (
${widget.type}
)"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
),
body:
(
followUps
.
isNotEmpty
)
?
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
Column
(
children:
[
Container
(
width:
double
.
infinity
,
child:
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
horizontal:
10
,
),
itemCount:
followUps
.
length
,
itemBuilder:
(
context
,
index
)
{
final
subHeadings
=
[
followUps
[
index
].
aname
??
"-"
,
followUps
[
index
].
appdate
??
"-"
,
followUps
[
index
].
anote
??
"-"
,
];
return
InkResponse
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Followupupdatescreen
(
leadID:
followUps
[
index
]
.
leadid
,
mode:
""
,
),
settings:
RouteSettings
(
name:
'Followupupdatescreen'
,
),
),
);
if
(
routeSettingName
==
"Followupupdatescreen"
){
provider
.
crmDashboardFollowUpAPIFunction
(
context
,
widget
.
type
);
}
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
margin:
EdgeInsets
.
symmetric
(
vertical:
3
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
"
${followUps[index].aname}
"
,
maxLines:
1
,
overflow:
TextOverflow
.
visible
,
style:
TextStyle
(
decoration:
TextDecoration
.
underline
,
height:
1
,
decorationStyle:
TextDecorationStyle
.
dotted
,
decorationColor:
Color
(
0xFF676767
),
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
),
),
),
Expanded
(
child:
Text
(
"
${followUps[index].appdate}
"
,
textAlign:
TextAlign
.
right
,
maxLines:
1
,
style:
TextStyle
(
color:
AppColors
.
grey_semi
,
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
),
),
),
],
),
SizedBox
(
height:
10
,),
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
16
),
gradient:
LinearGradient
(
colors:
[
Color
(
0xFFFFFFFF
),
Color
(
0xFFE8F7FF
)
])
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
"Remarks"
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
),
),
),
Expanded
(
child:
Text
(
"
${followUps[index].anote}
"
,
textAlign:
TextAlign
.
right
,
maxLines:
1
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
),
),
),
],
),
),
],
),
),
],
),
),
);
},
),
),
SizedBox
(
height:
150
),
],
),
)
:
Emptywidget
(
context
),
);
},
);
}
}
lib/screens/crm/generatedQuotesList.dart
0 → 100644
View file @
ad026e51
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dotted_line/dotted_line.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:generp/Notifiers/crmProvider/crmDashboardProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/crm/pendingTasksDetails.dart'
;
import
'package:provider/provider.dart'
;
import
'LeadDetailsByMode.dart'
;
class
Generatedquoteslist
extends
StatefulWidget
{
const
Generatedquoteslist
({
super
.
key
});
@override
State
<
Generatedquoteslist
>
createState
()
=>
_GeneratedquoteslistState
();
}
class
_GeneratedquoteslistState
extends
State
<
Generatedquoteslist
>
{
FocusNode
focusNode
=
FocusNode
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
event
)
{
setState
(()
=>
_source
=
event
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
prov
=
Provider
.
of
<
Crmdashboardprovider
>(
context
,
listen:
false
);
prov
.
crmDashboardQuotationsAPIFunction
(
context
);
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
getDecorationColor
(
value
){
switch
(
value
){
case
"Hot"
:
return
AppColors
.
processed_bg_color
;
case
"Warm"
:
return
AppColors
.
rejected_bg_color
;
case
"Cold"
:
return
AppColors
.
approved_bg_color
;
case
"All"
:
return
AppColors
.
requested_bg_color
;
}
}
getTextColor
(
value
){
switch
(
value
){
case
"Hot"
:
return
AppColors
.
processed_text_color
;
case
"Warm"
:
return
AppColors
.
rejected_text_color
;
case
"Cold"
:
return
AppColors
.
approved_text_color
;
case
"All"
:
return
AppColors
.
requested_text_color
;
}
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Crmdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
quotess
=
provider
.
dashboardQuotations
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
// elevation: 2.0,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/appbar_back_button.svg"
,
height:
25
,
),
),
SizedBox
(
width:
10
),
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"Quotations Generated"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
),
body:
(
quotess
.
isNotEmpty
)
?
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
Column
(
children:
[
Container
(
width:
double
.
infinity
,
child:
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
horizontal:
10
,
),
itemCount:
quotess
.
length
,
itemBuilder:
(
context
,
index
)
{
return
InkResponse
(
onTap:
()
async
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LeadDetailsByMode
(
pageTitleName:
"Lead Details"
,
mode:
""
,
leadId:
quotess
[
index
].
leadid
,
),
),
);
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
margin:
EdgeInsets
.
symmetric
(
vertical:
3
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Row
(
children:
[
SvgPicture
.
asset
(
"assets/svg/finance/fin_payments_ic.svg"
,),
SizedBox
(
width:
10
,),
Expanded
(
flex:
4
,
child:
Text
(
"
${quotess[index].aname}
"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
decoration:
TextDecoration
.
underline
,
height:
1.5
,
decorationStyle:
TextDecorationStyle
.
dotted
,
decorationColor:
Color
(
0xFF676767
),
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
),
),
),
SizedBox
(
width:
10
,),
Expanded
(
flex:
2
,
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
),
color:
getDecorationColor
(
quotess
[
index
].
lstatus
)
),
child:
Text
(
"
${quotess[index].lstatus}
"
,
textAlign:
TextAlign
.
center
,
maxLines:
1
,
style:
TextStyle
(
color:
getTextColor
(
quotess
[
index
].
lstatus
),
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
),
),
),
),
],
),
),
);
},
),
),
SizedBox
(
height:
150
),
],
),
)
:
Emptywidget
(
context
),
);
},
);
}
}
lib/screens/finance/addPaymentReceiptList.dart
View file @
ad026e51
...
...
@@ -630,7 +630,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
provider
.
submitClicked
=
true
;
provider
.
addReceiptPaymentRequestionSubmitAPI
(
context
,
provider
.
formattedDate
,
provider
.
formattedDate
ToSend
,
);
},
child:
Container
(
...
...
lib/screens/order/editAdjustedOrderList.dart
View file @
ad026e51
...
...
@@ -183,7 +183,7 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
Expanded
(
child:
DropdownButtonHideUnderline
(
child:
DropdownButton2
<
PaidList
Edit
PaidList
>(
isExpanded:
true
,
hint:
Text
(
...
...
@@ -204,7 +204,7 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
(
ord
,
)
=>
DropdownMenuItem
<
PaidList
Edit
PaidList
>(
value:
ord
,
...
...
@@ -244,7 +244,7 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
// editProvider.paidList[0],
// ),
onChanged:
(
PaidList
?
value
,
Edit
PaidList
?
value
,
)
{
if
(
value
!=
null
)
{
...
...
@@ -252,7 +252,7 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
.
paidList
.
isNotEmpty
)
{
editProvider
.
selectedPaidList
=
.
edit
selectedPaidList
=
value
;
print
(
"Selected Complaint Type:
${value.orderId}
, ID:
${value.orderNumber}
"
,
...
...
@@ -260,7 +260,7 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
editProvider
.
updateSelectedPaidOrderId
(
index
,
editProvider
.
selectedPaidList
,
.
edit
selectedPaidList
,
);
// provider.selectedOrderIds = value!.orderId!;
// provider.selectedOrderNumbers = value!.orderNumber!;
...
...
lib/screens/order/editPaymentDetailsByMode.dart
View file @
ad026e51
import
'dart:async'
;
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
...
...
@@ -11,6 +12,7 @@ import '../../Models/ordersModels/AddOrderPaymentSelectOrderResponse.dart';
import
'../../Notifiers/ordersProvider/addPaymentProvider.dart'
;
import
'../../Notifiers/ordersProvider/editPaymentProvider.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonServices.dart'
;
import
'../../Utils/commonWidgets.dart'
;
import
'../../Utils/dropdownTheme.dart'
;
...
...
@@ -39,11 +41,17 @@ class _EditpaymentdetailsbymodeState extends State<Editpaymentdetailsbymode> {
final
TextEditingController
textEditingController
=
TextEditingController
();
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
5
,
(
index
)
=>
FocusNode
());
Dropdowntheme
ddtheme
=
Dropdowntheme
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
provider
=
Provider
.
of
<
Addpaymentprovider
>(
context
,
listen:
false
);
if
(
provider
.
dateNow
==
null
)
{
...
...
@@ -73,6 +81,7 @@ class _EditpaymentdetailsbymodeState extends State<Editpaymentdetailsbymode> {
@override
void
dispose
()
{
focusNodes
.
map
((
e
)
=>
e
.
dispose
());
_connectivity
.
disposeStream
();
super
.
dispose
();
}
...
...
@@ -83,6 +92,45 @@ class _EditpaymentdetailsbymodeState extends State<Editpaymentdetailsbymode> {
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
case
ConnectivityResult
.
mobile
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
async
{
Provider
.
of
<
Addpaymentprovider
>(
context
,
listen:
false
,
).
resetForm
();
Provider
.
of
<
Editpaymentprovider
>(
context
,
listen:
false
,
).
resetForm
();
return
onBackPressed
(
context
);
},
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer2
<
Addpaymentprovider
,
Editpaymentprovider
>(
builder:
(
context
,
provider
,
editProvider
,
child
)
{
return
WillPopScope
(
...
...
@@ -92,11 +140,12 @@ class _EditpaymentdetailsbymodeState extends State<Editpaymentdetailsbymode> {
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
white
,
appBar:
appbar2
(
appBar:
appbar2
New
(
context
,
"
${widget.pageTitleName}
"
,
provider
.
resetForm
,
SizedBox
(
width:
0
),
SizedBox
.
shrink
(),
0xFFFFFFFF
),
body:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
...
...
@@ -311,7 +360,7 @@ class _EditpaymentdetailsbymodeState extends State<Editpaymentdetailsbymode> {
provider
.
selectedDescription
,
provider
.
selectedPaymentMode
,
provider
.
paymentRefController
.
text
,
provider
.
paymentReceivedDateController
.
text
,
provider
.
formattedDateToSend
,
provider
.
amountController
.
text
,
);
},
...
...
lib/screens/order/orderModuleDashboard.dart
View file @
ad026e51
...
...
@@ -98,8 +98,7 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
!
page
.
pageName
!.
contains
(
"Receipt List"
),
)
.
toList
();
print
(
"receiptListPages
${receiptListPages.map((e) => e.pageName)}
"
);
print
(
"otherPages
${otherPages}
"
);
final
approvalOrderPages
=
orderListPages
.
where
(
...
...
@@ -565,20 +564,21 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
if
(
receiptListPages
[
index
].
pageName
!.
contains
(
"Receipt List"
,
))
{
navigate
=
Paymentlistsbymode
(
navigate
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentlistsbymode
(
mode:
receiptListPages
[
index
].
mode
!,
pageTitleName:
receiptListPages
[
index
].
pageName
!,
);
}
if
(
navigate
!=
null
)
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
navigate
,
),
settings:
RouteSettings
(
name:
"Paymentlistsbymode"
)
),
);
}
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
...
...
lib/screens/order/ordersDetailsByModes.dart
View file @
ad026e51
...
...
@@ -511,7 +511,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
resizeToAvoidBottomInset:
true
,
appBar:
appbar2New
(
context
,
widget
.
mode
!
=
""
widget
.
mode
=
=
""
?
"Order Details"
:
"Order Details (
${widget.mode}
)"
,
provider
.
resetAll
,
...
...
@@ -1455,6 +1455,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
textAlign:
TextAlign
.
left
,
heads
[
j
],
...
...
@@ -1468,6 +1469,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
if
(
subHeads
[
j
]
==
"View"
)
...[
Expanded
(
flex:
3
,
child:
InkResponse
(
onTap:
()
{
Navigator
.
push
(
...
...
@@ -1506,11 +1508,13 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
]
else
...[
Expanded
(
flex:
4
,
child:
Text
(
textAlign:
TextAlign
.
right
,
subHeads
[
j
]
==
""
?
"-"
:
subHeads
[
j
],
maxLines:
2
,
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
),
...
...
lib/screens/order/ordersListByModes.dart
View file @
ad026e51
...
...
@@ -166,7 +166,7 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
{
Provider
.
of
<
Pagesdashboardprovider
>(
context
).
resetAll
();
Provider
.
of
<
Pagesdashboardprovider
>(
context
,
listen:
false
).
resetAll
();
return
onBackPressed
(
context
);
},
child:
SafeArea
(
...
...
lib/screens/order/paymentDetailsByMode.dart
View file @
ad026e51
import
'dart:io'
;
import
'package:dotted_line/dotted_line.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/ordersProvider/editPaymentProvider.dart'
;
import
'package:generp/Notifiers/ordersProvider/paymentsProvider.dart'
;
import
'package:generp/Utils/dropdownTheme.dart'
;
import
'package:generp/screens/order/editAdjustedOrderList.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Models/ordersModels/EditPaymentDetailsAdjustedOrdersViewResponse.dart'
show
EditPaidList
;
import
'../../Models/ordersModels/paymentDetailsByModeFilterResponse.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
import
'../finance/FileViewer.dart'
;
...
...
@@ -14,6 +22,7 @@ import 'ordersDetailsByModes.dart';
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
class
Paymentdetailsbymode
extends
StatefulWidget
{
final
pageTitleName
;
final
paymentId
;
...
...
@@ -33,6 +42,7 @@ class Paymentdetailsbymode extends StatefulWidget {
class
_PaymentdetailsbymodeState
extends
State
<
Paymentdetailsbymode
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
Dropdowntheme
ddtheme
=
Dropdowntheme
();
@override
void
initState
()
{
...
...
@@ -59,6 +69,95 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
_connectivity
.
disposeStream
();
}
Color
getDecorationColor
(
value
)
{
var
color
=
AppColors
.
approved_bg_color
;
switch
(
value
)
{
case
'Registered'
:
return
AppColors
.
requested_bg_color
;
case
'Level 1 Approved'
:
return
AppColors
.
approved_bg_color
;
case
'Level 1 Rejected'
:
return
AppColors
.
rejected_bg_color
;
case
'Level 2 Approved'
:
return
AppColors
.
approved_bg_color
;
case
'Level 2 Rejected'
:
return
AppColors
.
rejected_bg_color
;
case
'Sales Order Registered'
:
return
AppColors
.
processed_bg_color
;
case
'Dispatched'
:
return
AppColors
.
approved_bg_color
;
}
return
color
;
}
Color
getTextColor
(
value
)
{
var
color
=
AppColors
.
approved_text_color
;
switch
(
value
)
{
case
'Registered'
:
return
AppColors
.
requested_text_color
;
case
'Level 1 Approved'
:
return
AppColors
.
approved_text_color
;
case
'Level 1 Rejected'
:
return
AppColors
.
rejected_text_color
;
case
'Level 2 Approved'
:
return
AppColors
.
approved_text_color
;
case
'Level 2 Rejected'
:
return
AppColors
.
rejected_text_color
;
case
'Sales Order Registered'
:
return
AppColors
.
processed_text_color
;
case
'Dispatched'
:
return
AppColors
.
approved_text_color
;
}
return
color
;
}
getText
(
value
)
{
var
text
=
"R"
;
switch
(
value
)
{
case
'Registered'
:
return
"R"
;
case
'Level 1 Approved'
:
return
"L1A"
;
case
'Level 1 Rejected'
:
return
"L1R"
;
case
'Level 2 Approved'
:
return
"L2A"
;
case
'Level 2 Rejected'
:
return
"L2R"
;
case
'Sales Order Registered'
:
return
"SOR"
;
case
'Dispatched'
:
return
"D"
;
}
return
text
;
}
//All","Registered","Level 1 Approved","Level 2 Approved","Level 1 Rejected",
// Level 2 Rejected","Level 2 Rejected Final","Sales Order Registered","Dispatched"
double
getSize
(
value
)
{
var
text
=
"A"
;
switch
(
value
)
{
case
'Registered'
:
return
16.0
;
case
'Level 1 Approved'
:
return
13.0
;
case
'Level 1 Rejected'
:
return
13.0
;
case
'Level 2 Approved'
:
return
13.0
;
case
'Level 2 Rejected'
:
return
13.0
;
case
'Processed'
:
return
16.0
;
case
'Sales Order Registered'
:
return
13.0
;
case
'Dispatched'
:
return
16.0
;
}
return
18.0
;
}
@override
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
...
...
@@ -72,15 +171,896 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
default
:
connection
=
'Offline'
;
}
return
connection
==
"Online"
?
Consumer
<
Paymentsprovider
>(
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
async
{
Provider
.
of
<
Paymentsprovider
>(
context
,
listen:
false
,
).
resetAll
();
return
onBackPressed
(
context
);
},
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer2
<
Paymentsprovider
,
Editpaymentprovider
>(
builder:
(
context
,
provider
,
editProvider
,
child
)
{
var
paymentDetails
=
provider
.
paymentDetails
;
var
adjustList
=
provider
.
paidLists
;
final
headings2
=
[
"Payment Type"
,
"Payment Reference Number"
,
"Payment Date"
,
"Adjusted Amount"
,
"Amount"
,
];
final
subHeadings2
=
[
paymentDetails
.
paymentType
??
"-"
,
paymentDetails
.
refNo
??
"-"
,
paymentDetails
.
paymentDate
??
"-"
,
paymentDetails
.
adjustedAmount
??
"-"
,
paymentDetails
.
amount
??
"-"
,
];
final
headings3
=
[
"Entered By"
,
"Approved Employee"
,
"Created Datetime"
,
"Description"
,
];
final
subHeadings3
=
[
paymentDetails
.
enteredEmpName
??
"-"
,
paymentDetails
.
approvalEmployee
??
"-"
,
paymentDetails
.
datetime
??
"-"
,
paymentDetails
.
description
??
"-"
,
];
final
sections
=
[
if
(
provider
.
showMoreDetails
)
...[
{
"title"
:
"payment Details"
,
"headings"
:
headings2
,
"subHeadings"
:
subHeadings2
,
},
{
"title"
:
"Other Details"
,
"headings"
:
headings3
,
"subHeadings"
:
subHeadings3
,
},
],
];
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2New
(
context
,
widget
.
pageTitleName
,
provider
.
resetAll
,
SizedBox
.
shrink
(),
0xFFFFFFFF
,
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
SingleChildScrollView
(
child:
Column
(
children:
[
Card
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
2
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
only
(
bottomLeft:
Radius
.
circular
(
30
),
bottomRight:
Radius
.
circular
(
30
),
),
),
elevation:
2
,
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
only
(
bottomLeft:
Radius
.
circular
(
30
),
bottomRight:
Radius
.
circular
(
30
),
),
),
// margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
child:
Column
(
children:
[
Row
(
children:
[
Expanded
(
flex:
1
,
child:
Container
(
height:
45
,
width:
45
,
padding:
EdgeInsets
.
all
(
7.5
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
shape:
BoxShape
.
circle
,
// borderRadius: BorderRadius.circular(8),
),
child:
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
,
),
),
),
SizedBox
(
width:
10
),
Expanded
(
flex:
4
,
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
InkResponse
(
onTap:
()
{},
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
8.0
,
bottom:
4
,
),
child:
Text
(
paymentDetails
.
accountName
==
""
?
"-"
:
paymentDetails
.
accountName
??
"-"
,
style:
TextStyle
(
decoration:
TextDecoration
.
underline
,
decorationStyle:
TextDecorationStyle
.
dotted
,
decorationColor:
AppColors
.
grey_thick
,
height:
1.2
,
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
),
),
Text
(
paymentDetails
.
amount
==
""
?
"-"
:
"₹
${paymentDetails.amount}
"
,
style:
TextStyle
(
fontFamily:
"JakartaRegular"
,
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:
getDecorationColor
(
paymentDetails
.
status
??
"-"
,
),
),
child:
Center
(
child:
Text
(
paymentDetails
.
status
??
"-"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
getTextColor
(
paymentDetails
.
status
,
),
),
),
),
),
),
if
(
paymentDetails
.
status
==
"Registered"
)
...[
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
Editpaymentdetailsbymode
(
pageTitleName:
"Edit Payment (
${widget.mode}
)"
,
mode:
widget
.
mode
,
values:
{
"payment_id"
:
provider
.
paymentDetails
.
paymentId
,
"description"
:
provider
.
paymentDetails
!
.
description
,
"amount"
:
provider
.
paymentDetails
!
.
amount
,
"payment_mode"
:
provider
.
paymentDetails
!
.
paymentType
,
"pay_ref"
:
provider
.
paymentDetails
!
.
refNo
,
"pay_received_date"
:
provider
.
paymentDetails
!
.
paymentDate
,
},
),
settings:
RouteSettings
(
name:
'Editorderaccountdetails'
,
),
),
);
if
(
res
==
true
)
{
provider
.
paymentsDetailsByModeAPIFunction
(
context
,
widget
.
paymentId
,
widget
.
mode
,
);
}
},
child:
Container
(
height:
32
,
width:
30
,
padding:
EdgeInsets
.
all
(
8.0
),
child:
SvgPicture
.
asset
(
"assets/svg/crm/lead_details_edit_ic.svg"
,
),
),
),
),
],
],
),
SizedBox
(
height:
10
),
Column
(
children:
List
.
generate
(
sections
.
length
,
(
sectionIndex
,
)
{
final
section
=
sections
[
sectionIndex
];
final
title
=
section
[
"title"
]
as
String
;
final
headings
=
section
[
"headings"
]
as
List
<
String
>;
final
subHeadings
=
section
[
"subHeadings"
]
as
List
<
String
>;
return
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
4
,
),
child:
Row
(
children:
[
Expanded
(
flex:
3
,
child:
Text
(
title
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaSemiBold"
,
),
),
),
Expanded
(
flex:
6
,
child:
DottedLine
(
dashGapLength:
4
,
dashGapColor:
Colors
.
white
,
dashColor:
AppColors
.
grey_semi
,
dashLength:
2
,
lineThickness:
0.5
,
),
),
],
),
),
Column
(
children:
List
.
generate
(
headings
.
length
,
(
j
,
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
7
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
headings
[
j
],
style:
TextStyle
(
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
),
Expanded
(
child:
InkResponse
(
onTap:
subHeadings
[
j
]
==
"View"
?
()
{}
:
null
,
child:
Text
(
subHeadings
[
j
].
isEmpty
?
"-"
:
subHeadings
[
j
],
textAlign:
TextAlign
.
right
,
style:
TextStyle
(
fontSize:
14
,
decoration:
subHeadings
[
j
]
==
"View"
?
TextDecoration
.
underline
:
TextDecoration
.
none
,
decorationColor:
AppColors
.
app_blue
,
color:
subHeadings
[
j
]
==
"View"
?
AppColors
.
app_blue
:
Color
(
0xFF818181
,
),
),
),
),
),
],
),
);
}),
),
],
);
}),
),
InkResponse
(
onTap:
()
async
{
provider
.
showMoreDetails
=
!
provider
.
showMoreDetails
;
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
provider
.
showMoreDetails
?
"Hide Details"
:
"View Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
Transform
.
flip
(
flipY:
provider
.
showMoreDetails
?
true
:
false
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_dropdown.svg"
,
height:
25
,
width:
20
,
color:
AppColors
.
app_blue
,
),
),
],
),
),
),
SizedBox
(
height:
10
),
],
),
),
),
if
(
adjustList
.
isNotEmpty
)
...[
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
only
(
top:
10
,
left:
10
,
right:
10
),
child:
Row
(
children:
[
Text
(
"Adjusted Order List"
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
grey_thick
,
fontFamily:
"JakartaMedium"
,
),
),
Spacer
(),
InkResponse
(
onTap:
()
async
{
await
editProvider
.
editPaymentDetailsAdjustedOrdersViewAPIFunction
(
context
,
paymentDetails
.
paymentId
,
);
Future
.
delayed
(
Duration
(
milliseconds:
500
),()
{
_showAddAdjustedOrderSheet
(
context
,
paymentDetails
.
paymentId
,
widget
.
mode
,
);
},);
},
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Text
(
textAlign:
TextAlign
.
right
,
"+ Add Order"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
),
),
],
),
),
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemCount:
adjustList
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
itemBuilder:
(
context
,
lp
)
{
return
InkResponse
(
onTap:
()
async
{
// await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => Editadjustedorderlist(
// mode: widget.mode,
// pageTitleName:
// "Edit Adjusted Order List (${widget.mode})",
//
// values: {
// "account_id":
// provider.paymentDetails.accId,
// "payment_id":
// provider.paymentDetails.paymentId,
// "orders":
// provider.paidLists
// .map(
// (order) => {
// "order_number":
// order.orderNumber,
// "amount":
// order.adjustedAmount,
// },
// )
// .toList(),
// },
// ),
// ),
// );
await
editProvider
.
editPaymentDetailsAdjustedOrdersViewAPIFunction
(
context
,
paymentDetails
.
paymentId
,
lp
,
);
print
(
"adjusted Order ID:
${adjustList[lp].id}
"
);
print
(
"adjusted selectedPaidOrderId ID:
${editProvider.editselectedPaidOrderId}
"
,
);
Future
.
delayed
(
Duration
(
milliseconds:
500
),
()
{
_showEditAdjustedOrderSheet
(
context
,
paymentDetails
.
paymentId
,
widget
.
mode
,
);
});
},
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.9
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
12
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
// vertical: 10,
),
child:
Column
(
children:
[
Row
(
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/crm/product_details_ic.svg"
,
),
),
SizedBox
(
width:
10
),
Expanded
(
flex:
6
,
child:
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
Ordersdetailsbymodes
(
pageTitleName:
"CRM Order Details"
,
mode:
widget
.
mode
,
orderId:
adjustList
[
lp
].
id
,
),
),
);
},
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3.0
,
),
child:
Text
(
adjustList
[
lp
].
orderNumber
??
"-"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
decoration:
TextDecoration
.
underline
,
decorationColor:
AppColors
.
semi_black
,
decorationStyle:
TextDecorationStyle
.
dashed
,
height:
1.5
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
),
),
),
],
),
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
7.5
,
),
child:
Row
(
children:
[
Expanded
(
flex:
4
,
child:
Text
(
"Payment Details"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaSemiBold"
,
),
),
),
Expanded
(
flex:
6
,
child:
DottedLine
(
dashGapLength:
4
,
dashGapColor:
Colors
.
white
,
dashColor:
AppColors
.
grey_semi
,
dashLength:
2
,
lineThickness:
0.5
,
),
),
],
),
),
...
List
.
generate
(
4
,
(
j
)
{
final
heads
=
[
"Order Amount"
,
"Paid Amount"
,
"Balance Amount"
,
"Adjusted Amount"
,
];
final
subHeads
=
[
adjustList
[
lp
].
totalAmount
??
"-"
,
adjustList
[
lp
].
paidAmount
??
"-"
,
adjustList
[
lp
].
balanceAmount
??
"-"
,
adjustList
[
lp
].
adjustedAmount
??
"-"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
textAlign:
TextAlign
.
left
,
heads
[
j
],
style:
TextStyle
(
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
),
Expanded
(
child:
Text
(
textAlign:
TextAlign
.
right
,
subHeads
[
j
]
==
""
?
"-"
:
subHeads
[
j
],
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
),
),
),
),
],
),
);
}),
],
),
),
);
},
),
]
else
...[
InkResponse
(
onTap:
()
async
{
await
editProvider
.
editPaymentDetailsAdjustedOrdersViewAPIFunction
(
context
,
paymentDetails
.
paymentId
,
);
Future
.
delayed
(
Duration
(
milliseconds:
500
),()
{
_showAddAdjustedOrderSheet
(
context
,
paymentDetails
.
paymentId
,
widget
.
mode
,
);
},);
},
child:
Container
(
height:
50
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Center
(
child:
Text
(
textAlign:
TextAlign
.
right
,
"+ Add Order"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
),
),
),
],
],
),
),
bottomNavigationBar:
widget
.
mode
==
"self"
?
SizedBox
.
shrink
()
:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
65
,
decoration:
BoxDecoration
(
color:
Colors
.
white
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
if
(![
"self"
,
"admin"
].
contains
(
widget
.
mode
))
...[
Expanded
(
child:
InkResponse
(
onTap:
()
{
_showLevelApprovalRejectionSheet
(
context
,
"Reject"
,
);
},
child:
Container
(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8),
// color: Color(0xFFFFEFEF),
// border: Border.all(
// color: Color(0xFFED3424),
// width: 0.5,
// ),
// ),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/finance/level_reject_ic.svg"
,
),
SizedBox
(
width:
10
),
Center
(
child:
Text
(
"Reject"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
),
),
SizedBox
(
width:
10
),
SvgPicture
.
asset
(
"assets/svg/crm/vertical_line_ic.svg"
,
),
SizedBox
(
width:
10
),
Expanded
(
child:
InkResponse
(
onTap:
()
{
// provider
// .approveRejectPaymentRequestAPIFunction(
// context,
// provider.requestsDetails.id,
// );
_showLevelApprovalRejectionSheet
(
context
,
"Approve"
,
);
},
child:
Container
(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8),
// color: Color(0xFFE7FFE5),
// border: Border.all(
// color: Color(0xFF0D9C00),
// width: 0.5,
// ),
// ),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/finance/level_approve_ic.svg"
,
),
SizedBox
(
width:
10
),
Center
(
child:
Text
(
"Approve"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
),
),
]
else
if
(
widget
.
mode
==
"admin"
)
...[
SvgPicture
.
asset
(
"assets/svg/crm/vertical_line_ic.svg"
,
),
SizedBox
(
width:
10
),
Expanded
(
child:
InkResponse
(
onTap:
()
{
_showLevelDeletionSheet
(
context
);
},
child:
Container
(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8),
// color: Color(0xFFFFEFEF),
// border: Border.all(
// color: Color(0xFFED3424),
// width: 0.5,
// ),
// ),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/finance/level_delete_ic.svg"
,
),
SizedBox
(
width:
10
),
Center
(
child:
Text
(
"Delete"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
),
),
],
],
),
),
);
},
);
}
Widget
_scaffold1
(
BuildContext
context
)
{
return
Consumer
<
Paymentsprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
paymentDetails
=
provider
.
paymentDetails
;
var
adjustList
=
provider
.
paidLists
;
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
...
...
@@ -100,8 +1080,7 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
:
SizedBox
(
width:
0
),
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
body:
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
...
...
@@ -394,7 +1373,6 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
],
),
),
),
bottomNavigationBar:
widget
.
mode
==
"self"
?
Container
(
height:
0
)
...
...
@@ -513,11 +1491,9 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
},
);
},
):
NoNetwork
(
context
);
);
}
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
...
...
@@ -540,7 +1516,9 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
...
...
@@ -554,7 +1532,7 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
"Edit Adjusted Order"
,
];
return
ListTile
(
onTap:
()
async
{
onTap:
()
async
{
var
res
;
switch
(
index
)
{
case
0
:
...
...
@@ -636,7 +1614,7 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
);
break
;
}
if
(
res
==
true
){
if
(
res
==
true
)
{
provider
.
paymentsDetailsByModeAPIFunction
(
context
,
widget
.
paymentId
,
...
...
@@ -692,7 +1670,9 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -835,7 +1815,9 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -911,7 +1893,9 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
right:
15
,
top:
30
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
Consumer
<
Paymentsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
SingleChildScrollView
(
...
...
@@ -1019,4 +2003,459 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
},
);
}
Future
<
void
>
_showAddAdjustedOrderSheet
(
BuildContext
context
,
paymentId
,
mode
,
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
backgroundColor:
Colors
.
white
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
Editpaymentprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Add Order"
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
,
),
),
SizedBox
(
height:
10
),
TextWidget
(
context
,
"Order"
),
Row
(
children:
[
Expanded
(
child:
DropdownButtonHideUnderline
(
child:
DropdownButton2
<
EditPaidList
>(
isExpanded:
true
,
hint:
Text
(
'Select Account Type'
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
paidList
.
map
(
(
ord
)
=>
DropdownMenuItem
<
EditPaidList
>(
value:
ord
,
child:
Text
(
"(Order Number:
${ord.orderNumber}
) + (Order Amount:
${ord.orderAmount}
) + (Balance Amount:
${ord.balanceAmount}
)"
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
// value:
// editProvider
// .selectedPaidList,
value:
provider
.
editselectedPaidList
!=
null
?
provider
.
paidList
.
firstWhere
(
(
product
)
=>
product
.
orderId
==
provider
.
editselectedPaidOrderId
,
orElse:
()
=>
provider
.
paidList
[
0
],
)
:
null
,
// value:editProvider.paidList.firstWhere(
// (
// ord,
// ) =>
// ord.orderId ==
// editProvider.selectedPaidOrderIDs[index],
// orElse:
// () =>
// editProvider.paidList[0],
// ),
onChanged:
(
EditPaidList
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
paidList
.
isNotEmpty
)
{
provider
.
editselectedPaidList
=
value
;
provider
.
editselectedPaidOrderId
=
value
!.
orderId
;
print
(
"Selected Complaint Type:
${provider.editselectedPaidOrderId}
, ID:
${value.orderNumber}
"
,
);
}
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
),
],
),
if
(
provider
.
selectedAccountError
!=
null
)
...[
errorWidget
(
context
,
provider
.
selectedAccountError
),
],
SizedBox
(
width:
10
),
Row
(
children:
[
Expanded
(
flex:
2
,
child:
textControllerWidget
(
context
,
provider
.
adjustedAddAmountController
,
"Order Amount"
,
"Enter Order Amount"
,
provider
.
onChnageAmountController
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
null
,
null
,
TextInputAction
.
next
,
),
),
],
),
if
(
provider
.
adjustedAddAmountError
!=
null
)
...[
errorWidget
(
context
,
provider
.
adjustedAddAmountError
,
),
],
SizedBox
(
height:
10
),
InkResponse
(
onTap:
provider
.
submitLoading
?
null
:
()
{
provider
.
submitLoading
=
true
;
provider
.
paymentsDetailsAddAdjustedOrderModeAPIFunction
(
context
,
paymentId
,
provider
.
editselectedPaidOrderId
,
mode
,
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
15
,
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
provider
.
submitLoading
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
AppColors
.
white
,
),
)
:
const
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
],
),
),
);
},
),
);
},
);
},
).
whenComplete
(()
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
Paymentsprovider
>(
context
,
listen:
false
);
provider
.
paymentsDetailsByModeAPIFunction
(
context
,
widget
.
paymentId
,
widget
.
mode
,
);
});
});
}
Future
<
void
>
_showEditAdjustedOrderSheet
(
BuildContext
context
,
paymentId
,
mode
,
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
backgroundColor:
Colors
.
white
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
Editpaymentprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Edit Order"
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
,
),
),
SizedBox
(
height:
10
),
TextWidget
(
context
,
"Order"
),
Row
(
children:
[
Expanded
(
child:
DropdownButtonHideUnderline
(
child:
DropdownButton2
<
EditPaidList
>(
isExpanded:
true
,
hint:
Text
(
'Select Account Type'
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
paidList
.
map
(
(
ord
)
=>
DropdownMenuItem
<
EditPaidList
>(
value:
ord
,
child:
Text
(
"(Order Number:
${ord.orderNumber}
) + (Order Amount:
${ord.orderAmount}
) + (Balance Amount:
${ord.balanceAmount}
)"
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
// value:
// editProvider
// .selectedPaidList,
value:
provider
.
editselectedPaidList
!=
null
?
provider
.
paidList
.
firstWhere
(
(
product
)
=>
product
.
orderId
==
provider
.
editselectedPaidOrderId
,
)
:
null
,
// value:editProvider.paidList.firstWhere(
// (
// ord,
// ) =>
// ord.orderId ==
// editProvider.selectedPaidOrderIDs[index],
// orElse:
// () =>
// editProvider.paidList[0],
// ),
onChanged:
(
EditPaidList
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
paidList
.
isNotEmpty
)
{
provider
.
editselectedPaidList
=
value
;
provider
.
editselectedPaidOrderId
=
value
!.
orderId
;
print
(
"Selected Complaint Type:
${value.orderId}
, ID:
${value.orderNumber}
"
,
);
}
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
),
],
),
if
(
provider
.
selectedAccountError
!=
null
)
...[
errorWidget
(
context
,
provider
.
selectedAccountError
),
],
SizedBox
(
width:
10
),
Row
(
children:
[
Expanded
(
flex:
2
,
child:
textControllerWidget
(
context
,
provider
.
adjustedAddAmountController
,
"Order Amount"
,
"Enter Order Amount"
,
provider
.
onChnageAmountController
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
null
,
null
,
TextInputAction
.
next
,
),
),
],
),
if
(
provider
.
adjustedAddAmountError
!=
null
)
...[
errorWidget
(
context
,
provider
.
adjustedAddAmountError
,
),
],
SizedBox
(
height:
10
),
InkResponse
(
onTap:
provider
.
submitLoading
?
null
:
()
{
provider
.
submitLoading
=
true
;
provider
.
paymentsDetailsEditAdjustedOrderModeAPIFunction
(
context
,
provider
.
paidList
.
firstWhere
(
(
product
)
=>
product
.
orderId
==
provider
.
editselectedPaidOrderId
,
)
.
orderPaymentId
,
provider
.
editselectedPaidOrderId
,
mode
,
paymentId
,
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
15
,
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
provider
.
submitLoading
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
AppColors
.
white
,
),
)
:
const
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
],
),
),
);
},
),
);
},
);
},
).
whenComplete
(()
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
Paymentsprovider
>(
context
,
listen:
false
);
provider
.
paymentsDetailsByModeAPIFunction
(
context
,
widget
.
paymentId
,
widget
.
mode
,
);
});
});
}
}
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment