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
b269a97b
Commit
b269a97b
authored
May 09, 2025
by
Sai Srinivas
Browse files
09-05-2025 By Sai Srinivas
Service Engineer Module without Nearby Generators.
parent
c09dfa71
Changes
59
Show whitespace changes
Inline
Side-by-side
assets/svg/se_payment_details.svg
0 → 100644
View file @
b269a97b
<svg
width=
"39"
height=
"39"
viewBox=
"0 0 39 39"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<circle
cx=
"19.2449"
cy=
"19.2449"
r=
"19.2449"
fill=
"#EEFCFF"
/>
<g
clip-path=
"url(#clip0_254_2918)"
>
<path
d=
"M29.0811 19.9575C29.0811 25.3898 24.6773 29.7937 19.2449 29.7937C13.8123 29.7937 9.40851 25.3898 9.40851 19.9575C9.40851 14.5249 13.8123 10.1211 19.2449 10.1211C24.6773 10.1211 29.0811 14.5249 29.0811 19.9575Z"
fill=
"url(#paint0_linear_254_2918)"
/>
<path
d=
"M21.2559 24.4282C21.1254 24.4282 20.9947 24.3907 20.8786 24.312L15.9604 20.9587C15.718 20.7925 15.6108 20.4885 15.6976 20.2067C15.7842 19.925 16.0445 19.7336 16.3386 19.7336H18.3506C19.2136 19.7336 19.9155 19.0317 19.9155 18.1688C19.9155 17.3059 19.2136 16.604 18.3506 16.604H16.3386C15.9684 16.604 15.6679 16.3036 15.6679 15.9334C15.6679 15.5631 15.9684 15.2627 16.3386 15.2627H18.3506C19.953 15.2627 21.2568 16.5664 21.2568 18.1688C21.2568 19.7184 20.037 20.9892 18.5071 21.0713L21.6351 23.2042C21.9409 23.4124 22.0195 23.8301 21.8113 24.1358C21.6816 24.3254 21.4705 24.4282 21.2559 24.4282Z"
fill=
"#FAFAFA"
/>
<path
d=
"M22.151 16.604H16.3386C15.9684 16.604 15.668 16.3036 15.668 15.9334C15.668 15.5631 15.9684 15.2627 16.3386 15.2627H22.151C22.5212 15.2627 22.8217 15.5631 22.8217 15.9334C22.8217 16.3036 22.5212 16.604 22.151 16.604Z"
fill=
"#FAFAFA"
/>
<path
d=
"M22.151 19.0635H16.3386C15.9684 19.0635 15.6679 18.763 15.6679 18.3928C15.6679 18.0226 15.9684 17.7222 16.3386 17.7222H22.151C22.5212 17.7222 22.8217 18.0226 22.8217 18.3928C22.8217 18.763 22.5212 19.0635 22.151 19.0635Z"
fill=
"#FAFAFA"
/>
</g>
<defs>
<linearGradient
id=
"paint0_linear_254_2918"
x1=
"19.2448"
y1=
"10.1211"
x2=
"30.2345"
y2=
"36.3689"
gradientUnits=
"userSpaceOnUse"
>
<stop
stop-color=
"#FFC107"
/>
<stop
offset=
"1"
stop-color=
"#E69D00"
/>
</linearGradient>
<clipPath
id=
"clip0_254_2918"
>
<rect
width=
"19.6726"
height=
"19.6726"
fill=
"white"
transform=
"translate(9.40851 10.1211)"
/>
</clipPath>
</defs>
</svg>
assets/svg/se_update_complaint.svg
0 → 100644
View file @
b269a97b
<svg
width=
"39"
height=
"39"
viewBox=
"0 0 39 39"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<circle
cx=
"19.2449"
cy=
"19.2449"
r=
"19.2449"
fill=
"#EEFCFF"
/>
<path
d=
"M25.7414 17.2846L20.0035 11.0479H15.0854C14.4332 11.0479 13.8077 11.3295 13.3465 11.8307C12.8854 12.332 12.6263 13.0119 12.6263 13.7208V26.1943C12.6263 26.9032 12.8854 27.5831 13.3465 28.0844C13.8077 28.5856 14.4332 28.8673 15.0854 28.8673H23.2823C23.9345 28.8673 24.5599 28.5856 25.0211 28.0844C25.4823 27.5831 25.7414 26.9032 25.7414 26.1943V17.2846Z"
fill=
"url(#paint0_linear_254_2912)"
/>
<path
d=
"M25.7414 17.2846H21.6429C21.2081 17.2846 20.7911 17.0969 20.4837 16.7627C20.1763 16.4285 20.0035 15.9753 20.0035 15.5027V11.0479L25.7414 17.2846Z"
fill=
"#6563FF"
/>
<defs>
<linearGradient
id=
"paint0_linear_254_2912"
x1=
"19.1838"
y1=
"18.9487"
x2=
"29.8521"
y2=
"38.8319"
gradientUnits=
"userSpaceOnUse"
>
<stop
stop-color=
"#B2B1FF"
/>
<stop
offset=
"1"
stop-color=
"#6563FF"
/>
</linearGradient>
</defs>
</svg>
lib/Models/TechniciansPendingComplaintsResponse.dart
View file @
b269a97b
...
...
@@ -38,6 +38,7 @@ class TP_List {
String
?
complaintCategory
;
String
?
compRegDatetime
;
String
?
mobileNo
;
String
?
contactName
;
TP_List
(
{
this
.
genId
,
...
...
@@ -48,7 +49,9 @@ class TP_List {
this
.
productName
,
this
.
complaintCategory
,
this
.
compRegDatetime
,
this
.
mobileNo
});
this
.
mobileNo
,
this
.
contactName
,
});
TP_List
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
genId
=
json
[
'gen_id'
];
...
...
@@ -60,6 +63,7 @@ class TP_List {
complaintCategory
=
json
[
'complaint_category'
];
compRegDatetime
=
json
[
'comp_reg_datetime'
];
mobileNo
=
json
[
'mobile_no'
];
contactName
=
json
[
'contact_name'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
...
...
@@ -73,6 +77,7 @@ class TP_List {
data
[
'complaint_category'
]
=
this
.
complaintCategory
;
data
[
'comp_reg_datetime'
]
=
this
.
compRegDatetime
;
data
[
'mobile_no'
]
=
this
.
mobileNo
;
data
[
'contact_name'
]
=
this
.
contactName
;
return
data
;
}
}
lib/Models/ViewVisitDetailsResponseNew.dart
0 → 100644
View file @
b269a97b
class
ViewVisitDetailsResponseNew
{
ComplaintDetails
?
complaintDetails
;
CustomerDetails
?
customerDetails
;
GeneratorDetails
?
generatorDetails
;
ComplaintDetailsNew
?
complaintDetailsNew
;
int
?
error
;
int
?
sessionExists
;
ViewVisitDetailsResponseNew
(
{
this
.
complaintDetails
,
this
.
customerDetails
,
this
.
generatorDetails
,
this
.
complaintDetailsNew
,
this
.
error
,
this
.
sessionExists
});
ViewVisitDetailsResponseNew
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
complaintDetails
=
json
[
'complaint_details'
]
!=
null
?
new
ComplaintDetails
.
fromJson
(
json
[
'complaint_details'
])
:
null
;
customerDetails
=
json
[
'customer_details'
]
!=
null
?
new
CustomerDetails
.
fromJson
(
json
[
'customer_details'
])
:
null
;
generatorDetails
=
json
[
'generator_details'
]
!=
null
?
new
GeneratorDetails
.
fromJson
(
json
[
'generator_details'
])
:
null
;
complaintDetailsNew
=
json
[
'complaint_details_new'
]
!=
null
?
new
ComplaintDetailsNew
.
fromJson
(
json
[
'complaint_details_new'
])
:
null
;
error
=
json
[
'error'
];
sessionExists
=
json
[
'session_exists'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
if
(
this
.
complaintDetails
!=
null
)
{
data
[
'complaint_details'
]
=
this
.
complaintDetails
!.
toJson
();
}
if
(
this
.
customerDetails
!=
null
)
{
data
[
'customer_details'
]
=
this
.
customerDetails
!.
toJson
();
}
if
(
this
.
generatorDetails
!=
null
)
{
data
[
'generator_details'
]
=
this
.
generatorDetails
!.
toJson
();
}
if
(
this
.
complaintDetailsNew
!=
null
)
{
data
[
'complaint_details_new'
]
=
this
.
complaintDetailsNew
!.
toJson
();
}
data
[
'error'
]
=
this
.
error
;
data
[
'session_exists'
]
=
this
.
sessionExists
;
return
data
;
}
}
class
ComplaintDetails
{
String
?
id
;
String
?
oemPemName
;
String
?
accId
;
String
?
productId
;
String
?
genHashId
;
String
?
engineModel
;
String
?
alt
;
String
?
engineNo
;
String
?
altNo
;
String
?
invNo
;
String
?
dgSetNo
;
String
?
btryNo
;
String
?
state
;
String
?
district
;
String
?
address
;
String
?
branchId
;
String
?
salesEmpId
;
String
?
dispDate
;
String
?
cmsngDate
;
String
?
dateOfEngineSale
;
String
?
pdiDate
;
String
?
wrntyExpiryDate
;
String
?
nextService
;
String
?
date
;
String
?
extra
;
String
?
status
;
String
?
dataSource
;
String
?
refType
;
String
?
refId
;
String
?
orderId
;
String
?
empId
;
String
?
isSuspense
;
String
?
loc
;
String
?
tempLoc
;
String
?
locStatus
;
String
?
isExist
;
String
?
delRemarks
;
String
?
delEmpId
;
String
?
delDatetime
;
String
?
cname
;
String
?
mob1
;
String
?
mob2
;
String
?
mail
;
String
?
aname
;
String
?
emodel
;
String
?
spname
;
String
?
complaintId
;
String
?
openedDate
;
String
?
dateOfSupply
;
String
?
complaintType
;
String
?
complaintCategory
;
String
?
complaintDesc
;
ComplaintDetails
(
{
this
.
id
,
this
.
oemPemName
,
this
.
accId
,
this
.
productId
,
this
.
genHashId
,
this
.
engineModel
,
this
.
alt
,
this
.
engineNo
,
this
.
altNo
,
this
.
invNo
,
this
.
dgSetNo
,
this
.
btryNo
,
this
.
state
,
this
.
district
,
this
.
address
,
this
.
branchId
,
this
.
salesEmpId
,
this
.
dispDate
,
this
.
cmsngDate
,
this
.
dateOfEngineSale
,
this
.
pdiDate
,
this
.
wrntyExpiryDate
,
this
.
nextService
,
this
.
date
,
this
.
extra
,
this
.
status
,
this
.
dataSource
,
this
.
refType
,
this
.
refId
,
this
.
orderId
,
this
.
empId
,
this
.
isSuspense
,
this
.
loc
,
this
.
tempLoc
,
this
.
locStatus
,
this
.
isExist
,
this
.
delRemarks
,
this
.
delEmpId
,
this
.
delDatetime
,
this
.
cname
,
this
.
mob1
,
this
.
mob2
,
this
.
mail
,
this
.
aname
,
this
.
emodel
,
this
.
spname
,
this
.
complaintId
,
this
.
openedDate
,
this
.
dateOfSupply
,
this
.
complaintType
,
this
.
complaintCategory
,
this
.
complaintDesc
});
ComplaintDetails
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
id
=
json
[
'id'
];
oemPemName
=
json
[
'oem_pem_name'
];
accId
=
json
[
'acc_id'
];
productId
=
json
[
'product_id'
];
genHashId
=
json
[
'gen_hash_id'
];
engineModel
=
json
[
'engine_model'
];
alt
=
json
[
'alt'
];
engineNo
=
json
[
'engine_no'
];
altNo
=
json
[
'alt_no'
];
invNo
=
json
[
'inv_no'
];
dgSetNo
=
json
[
'dg_set_no'
];
btryNo
=
json
[
'btry_no'
];
state
=
json
[
'state'
];
district
=
json
[
'district'
];
address
=
json
[
'address'
];
branchId
=
json
[
'branch_id'
];
salesEmpId
=
json
[
'sales_emp_id'
];
dispDate
=
json
[
'disp_date'
];
cmsngDate
=
json
[
'cmsng_date'
];
dateOfEngineSale
=
json
[
'date_of_engine_sale'
];
pdiDate
=
json
[
'pdi_date'
];
wrntyExpiryDate
=
json
[
'wrnty_expiry_date'
];
nextService
=
json
[
'next_service'
];
date
=
json
[
'date'
];
extra
=
json
[
'extra'
];
status
=
json
[
'status'
];
dataSource
=
json
[
'data_source'
];
refType
=
json
[
'ref_type'
];
refId
=
json
[
'ref_id'
];
orderId
=
json
[
'order_id'
];
empId
=
json
[
'emp_id'
];
isSuspense
=
json
[
'is_suspense'
];
loc
=
json
[
'loc'
];
tempLoc
=
json
[
'temp_loc'
];
locStatus
=
json
[
'loc_status'
];
isExist
=
json
[
'is_exist'
];
delRemarks
=
json
[
'del_remarks'
];
delEmpId
=
json
[
'del_emp_id'
];
delDatetime
=
json
[
'del_datetime'
];
cname
=
json
[
'cname'
];
mob1
=
json
[
'mob1'
];
mob2
=
json
[
'mob2'
];
mail
=
json
[
'mail'
];
aname
=
json
[
'aname'
];
emodel
=
json
[
'emodel'
];
spname
=
json
[
'spname'
];
complaintId
=
json
[
'complaint_id'
];
openedDate
=
json
[
'opened_date'
];
dateOfSupply
=
json
[
'date_of_supply'
];
complaintType
=
json
[
'complaint_type'
];
complaintCategory
=
json
[
'complaint_category'
];
complaintDesc
=
json
[
'complaint_desc'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'id'
]
=
this
.
id
;
data
[
'oem_pem_name'
]
=
this
.
oemPemName
;
data
[
'acc_id'
]
=
this
.
accId
;
data
[
'product_id'
]
=
this
.
productId
;
data
[
'gen_hash_id'
]
=
this
.
genHashId
;
data
[
'engine_model'
]
=
this
.
engineModel
;
data
[
'alt'
]
=
this
.
alt
;
data
[
'engine_no'
]
=
this
.
engineNo
;
data
[
'alt_no'
]
=
this
.
altNo
;
data
[
'inv_no'
]
=
this
.
invNo
;
data
[
'dg_set_no'
]
=
this
.
dgSetNo
;
data
[
'btry_no'
]
=
this
.
btryNo
;
data
[
'state'
]
=
this
.
state
;
data
[
'district'
]
=
this
.
district
;
data
[
'address'
]
=
this
.
address
;
data
[
'branch_id'
]
=
this
.
branchId
;
data
[
'sales_emp_id'
]
=
this
.
salesEmpId
;
data
[
'disp_date'
]
=
this
.
dispDate
;
data
[
'cmsng_date'
]
=
this
.
cmsngDate
;
data
[
'date_of_engine_sale'
]
=
this
.
dateOfEngineSale
;
data
[
'pdi_date'
]
=
this
.
pdiDate
;
data
[
'wrnty_expiry_date'
]
=
this
.
wrntyExpiryDate
;
data
[
'next_service'
]
=
this
.
nextService
;
data
[
'date'
]
=
this
.
date
;
data
[
'extra'
]
=
this
.
extra
;
data
[
'status'
]
=
this
.
status
;
data
[
'data_source'
]
=
this
.
dataSource
;
data
[
'ref_type'
]
=
this
.
refType
;
data
[
'ref_id'
]
=
this
.
refId
;
data
[
'order_id'
]
=
this
.
orderId
;
data
[
'emp_id'
]
=
this
.
empId
;
data
[
'is_suspense'
]
=
this
.
isSuspense
;
data
[
'loc'
]
=
this
.
loc
;
data
[
'temp_loc'
]
=
this
.
tempLoc
;
data
[
'loc_status'
]
=
this
.
locStatus
;
data
[
'is_exist'
]
=
this
.
isExist
;
data
[
'del_remarks'
]
=
this
.
delRemarks
;
data
[
'del_emp_id'
]
=
this
.
delEmpId
;
data
[
'del_datetime'
]
=
this
.
delDatetime
;
data
[
'cname'
]
=
this
.
cname
;
data
[
'mob1'
]
=
this
.
mob1
;
data
[
'mob2'
]
=
this
.
mob2
;
data
[
'mail'
]
=
this
.
mail
;
data
[
'aname'
]
=
this
.
aname
;
data
[
'emodel'
]
=
this
.
emodel
;
data
[
'spname'
]
=
this
.
spname
;
data
[
'complaint_id'
]
=
this
.
complaintId
;
data
[
'opened_date'
]
=
this
.
openedDate
;
data
[
'date_of_supply'
]
=
this
.
dateOfSupply
;
data
[
'complaint_type'
]
=
this
.
complaintType
;
data
[
'complaint_category'
]
=
this
.
complaintCategory
;
data
[
'complaint_desc'
]
=
this
.
complaintDesc
;
return
data
;
}
}
class
CustomerDetails
{
String
?
cname
;
String
?
aname
;
String
?
mob1
;
String
?
mob2
;
String
?
mail
;
CustomerDetails
({
this
.
cname
,
this
.
aname
,
this
.
mob1
,
this
.
mob2
,
this
.
mail
});
CustomerDetails
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
cname
=
json
[
'cname'
];
aname
=
json
[
'aname'
];
mob1
=
json
[
'mob1'
];
mob2
=
json
[
'mob2'
];
mail
=
json
[
'mail'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'cname'
]
=
this
.
cname
;
data
[
'aname'
]
=
this
.
aname
;
data
[
'mob1'
]
=
this
.
mob1
;
data
[
'mob2'
]
=
this
.
mob2
;
data
[
'mail'
]
=
this
.
mail
;
return
data
;
}
}
class
GeneratorDetails
{
String
?
id
;
String
?
oemPemName
;
String
?
accId
;
String
?
productId
;
String
?
genHashId
;
String
?
engineModel
;
String
?
alt
;
String
?
engineNo
;
String
?
altNo
;
String
?
invNo
;
String
?
dgSetNo
;
String
?
btryNo
;
String
?
state
;
String
?
district
;
String
?
address
;
String
?
branchId
;
String
?
salesEmpId
;
String
?
dispDate
;
String
?
cmsngDate
;
String
?
dateOfEngineSale
;
String
?
pdiDate
;
String
?
wrntyExpiryDate
;
String
?
nextService
;
String
?
date
;
String
?
extra
;
String
?
status
;
String
?
dataSource
;
String
?
refType
;
String
?
refId
;
String
?
orderId
;
String
?
empId
;
String
?
isSuspense
;
String
?
loc
;
String
?
tempLoc
;
String
?
locStatus
;
String
?
isExist
;
String
?
delRemarks
;
String
?
delEmpId
;
String
?
delDatetime
;
String
?
emodel
;
String
?
spname
;
GeneratorDetails
(
{
this
.
id
,
this
.
oemPemName
,
this
.
accId
,
this
.
productId
,
this
.
genHashId
,
this
.
engineModel
,
this
.
alt
,
this
.
engineNo
,
this
.
altNo
,
this
.
invNo
,
this
.
dgSetNo
,
this
.
btryNo
,
this
.
state
,
this
.
district
,
this
.
address
,
this
.
branchId
,
this
.
salesEmpId
,
this
.
dispDate
,
this
.
cmsngDate
,
this
.
dateOfEngineSale
,
this
.
pdiDate
,
this
.
wrntyExpiryDate
,
this
.
nextService
,
this
.
date
,
this
.
extra
,
this
.
status
,
this
.
dataSource
,
this
.
refType
,
this
.
refId
,
this
.
orderId
,
this
.
empId
,
this
.
isSuspense
,
this
.
loc
,
this
.
tempLoc
,
this
.
locStatus
,
this
.
isExist
,
this
.
delRemarks
,
this
.
delEmpId
,
this
.
delDatetime
,
this
.
emodel
,
this
.
spname
});
GeneratorDetails
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
id
=
json
[
'id'
];
oemPemName
=
json
[
'oem_pem_name'
];
accId
=
json
[
'acc_id'
];
productId
=
json
[
'product_id'
];
genHashId
=
json
[
'gen_hash_id'
];
engineModel
=
json
[
'engine_model'
];
alt
=
json
[
'alt'
];
engineNo
=
json
[
'engine_no'
];
altNo
=
json
[
'alt_no'
];
invNo
=
json
[
'inv_no'
];
dgSetNo
=
json
[
'dg_set_no'
];
btryNo
=
json
[
'btry_no'
];
state
=
json
[
'state'
];
district
=
json
[
'district'
];
address
=
json
[
'address'
];
branchId
=
json
[
'branch_id'
];
salesEmpId
=
json
[
'sales_emp_id'
];
dispDate
=
json
[
'disp_date'
];
cmsngDate
=
json
[
'cmsng_date'
];
dateOfEngineSale
=
json
[
'date_of_engine_sale'
];
pdiDate
=
json
[
'pdi_date'
];
wrntyExpiryDate
=
json
[
'wrnty_expiry_date'
];
nextService
=
json
[
'next_service'
];
date
=
json
[
'date'
];
extra
=
json
[
'extra'
];
status
=
json
[
'status'
];
dataSource
=
json
[
'data_source'
];
refType
=
json
[
'ref_type'
];
refId
=
json
[
'ref_id'
];
orderId
=
json
[
'order_id'
];
empId
=
json
[
'emp_id'
];
isSuspense
=
json
[
'is_suspense'
];
loc
=
json
[
'loc'
];
tempLoc
=
json
[
'temp_loc'
];
locStatus
=
json
[
'loc_status'
];
isExist
=
json
[
'is_exist'
];
delRemarks
=
json
[
'del_remarks'
];
delEmpId
=
json
[
'del_emp_id'
];
delDatetime
=
json
[
'del_datetime'
];
emodel
=
json
[
'emodel'
];
spname
=
json
[
'spname'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'id'
]
=
this
.
id
;
data
[
'oem_pem_name'
]
=
this
.
oemPemName
;
data
[
'acc_id'
]
=
this
.
accId
;
data
[
'product_id'
]
=
this
.
productId
;
data
[
'gen_hash_id'
]
=
this
.
genHashId
;
data
[
'engine_model'
]
=
this
.
engineModel
;
data
[
'alt'
]
=
this
.
alt
;
data
[
'engine_no'
]
=
this
.
engineNo
;
data
[
'alt_no'
]
=
this
.
altNo
;
data
[
'inv_no'
]
=
this
.
invNo
;
data
[
'dg_set_no'
]
=
this
.
dgSetNo
;
data
[
'btry_no'
]
=
this
.
btryNo
;
data
[
'state'
]
=
this
.
state
;
data
[
'district'
]
=
this
.
district
;
data
[
'address'
]
=
this
.
address
;
data
[
'branch_id'
]
=
this
.
branchId
;
data
[
'sales_emp_id'
]
=
this
.
salesEmpId
;
data
[
'disp_date'
]
=
this
.
dispDate
;
data
[
'cmsng_date'
]
=
this
.
cmsngDate
;
data
[
'date_of_engine_sale'
]
=
this
.
dateOfEngineSale
;
data
[
'pdi_date'
]
=
this
.
pdiDate
;
data
[
'wrnty_expiry_date'
]
=
this
.
wrntyExpiryDate
;
data
[
'next_service'
]
=
this
.
nextService
;
data
[
'date'
]
=
this
.
date
;
data
[
'extra'
]
=
this
.
extra
;
data
[
'status'
]
=
this
.
status
;
data
[
'data_source'
]
=
this
.
dataSource
;
data
[
'ref_type'
]
=
this
.
refType
;
data
[
'ref_id'
]
=
this
.
refId
;
data
[
'order_id'
]
=
this
.
orderId
;
data
[
'emp_id'
]
=
this
.
empId
;
data
[
'is_suspense'
]
=
this
.
isSuspense
;
data
[
'loc'
]
=
this
.
loc
;
data
[
'temp_loc'
]
=
this
.
tempLoc
;
data
[
'loc_status'
]
=
this
.
locStatus
;
data
[
'is_exist'
]
=
this
.
isExist
;
data
[
'del_remarks'
]
=
this
.
delRemarks
;
data
[
'del_emp_id'
]
=
this
.
delEmpId
;
data
[
'del_datetime'
]
=
this
.
delDatetime
;
data
[
'emodel'
]
=
this
.
emodel
;
data
[
'spname'
]
=
this
.
spname
;
return
data
;
}
}
class
ComplaintDetailsNew
{
String
?
cname
;
String
?
mob1
;
String
?
mob2
;
String
?
mail
;
String
?
aname
;
String
?
emodel
;
String
?
spname
;
String
?
complaintId
;
String
?
openedDate
;
String
?
dateOfSupply
;
String
?
complaintType
;
String
?
complaintCategory
;
String
?
complaintDesc
;
ComplaintDetailsNew
(
{
this
.
cname
,
this
.
mob1
,
this
.
mob2
,
this
.
mail
,
this
.
aname
,
this
.
emodel
,
this
.
spname
,
this
.
complaintId
,
this
.
openedDate
,
this
.
dateOfSupply
,
this
.
complaintType
,
this
.
complaintCategory
,
this
.
complaintDesc
});
ComplaintDetailsNew
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
cname
=
json
[
'cname'
];
mob1
=
json
[
'mob1'
];
mob2
=
json
[
'mob2'
];
mail
=
json
[
'mail'
];
aname
=
json
[
'aname'
];
emodel
=
json
[
'emodel'
];
spname
=
json
[
'spname'
];
complaintId
=
json
[
'complaint_id'
];
openedDate
=
json
[
'opened_date'
];
dateOfSupply
=
json
[
'date_of_supply'
];
complaintType
=
json
[
'complaint_type'
];
complaintCategory
=
json
[
'complaint_category'
];
complaintDesc
=
json
[
'complaint_desc'
];
}
Map
<
String
,
dynamic
>
toJson
()
{
final
Map
<
String
,
dynamic
>
data
=
new
Map
<
String
,
dynamic
>();
data
[
'cname'
]
=
this
.
cname
;
data
[
'mob1'
]
=
this
.
mob1
;
data
[
'mob2'
]
=
this
.
mob2
;
data
[
'mail'
]
=
this
.
mail
;
data
[
'aname'
]
=
this
.
aname
;
data
[
'emodel'
]
=
this
.
emodel
;
data
[
'spname'
]
=
this
.
spname
;
data
[
'complaint_id'
]
=
this
.
complaintId
;
data
[
'opened_date'
]
=
this
.
openedDate
;
data
[
'date_of_supply'
]
=
this
.
dateOfSupply
;
data
[
'complaint_type'
]
=
this
.
complaintType
;
data
[
'complaint_category'
]
=
this
.
complaintCategory
;
data
[
'complaint_desc'
]
=
this
.
complaintDesc
;
return
data
;
}
}
lib/Notifiers/AtteendaceHistoryNotifier.dart
View file @
b269a97b
...
...
@@ -40,25 +40,41 @@ class Atteendacehistorynotifier with ChangeNotifier {
// Public Getters
DateTime
get
month
=>
_month
;
int
get
presentDays
=>
_presentDays
;
int
get
absentDays
=>
_absentDays
;
int
get
holidays
=>
_holidays
;
int
get
latePenalties
=>
_latePenalties
;
String
get
date
=>
_date
;
String
get
intime
=>
_intime
;
String
get
outtime
=>
_outtime
;
String
get
inlocation
=>
_inlocation
;
String
get
outlocation
=>
_outlocation
;
String
get
penalties
=>
_penalties
;
String
get
selectedDate
=>
_selectedDate
;
int
?
get
selectedIndex
=>
_selectedIndex
;
int
?
get
currentDayIndex
=>
_currentDayIndex
;
bool
get
initialRenderDone
=>
_initialRenderDone
;
bool
get
isLoading
=>
_isLoading
;
List
<
Map
<
String
,
dynamic
>>
get
dateArrayList
=>
_dateArrayList
;
List
<
Map
<
String
,
dynamic
>>
get
penaltyArrayList
=>
_penaltyArrayList
;
int
get
startingIndex
=>
_startingIndex
;
AttendanceProvider
()
{
...
...
@@ -134,7 +150,12 @@ class Atteendacehistorynotifier with ChangeNotifier {
Future
<
void
>
_loadAttendanceDetails
()
async
{
try
{
final
data
=
await
ApiCalling
.
LoadAttendanceDetails
(
_empId
,
_sessionId
,
_monthNo
,
_year
);
final
data
=
await
ApiCalling
.
LoadAttendanceDetails
(
_empId
,
_sessionId
,
_monthNo
,
_year
,
);
if
(
data
!=
null
)
{
final
decoded
=
jsonDecode
(
data
);
...
...
@@ -149,7 +170,8 @@ class Atteendacehistorynotifier with ChangeNotifier {
if
(
dateArray
!=
null
)
{
_firstKey
=
dateArray
.
keys
.
first
;
_firstValue
=
dateArray
[
_firstKey
];
_dateArrayList
=
dateArray
.
entries
.
map
((
e
)
{
_dateArrayList
=
dateArray
.
entries
.
map
((
e
)
{
final
parts
=
e
.
key
.
split
(
"-"
);
final
date
=
parts
[
2
];
return
{
date:
e
.
value
};
...
...
@@ -158,7 +180,15 @@ class Atteendacehistorynotifier with ChangeNotifier {
if
(
_firstKey
!=
null
)
{
final
parsedDate
=
DateTime
.
tryParse
(
_firstKey
!);
if
(
parsedDate
!=
null
)
{
List
<
String
>
weekdays
=
[
'Sunday'
,
'Monday'
,
'Tuesday'
,
'Wednesday'
,
'Thursday'
,
'Friday'
,
'Saturday'
];
List
<
String
>
weekdays
=
[
'Sunday'
,
'Monday'
,
'Tuesday'
,
'Wednesday'
,
'Thursday'
,
'Friday'
,
'Saturday'
,
];
final
dayOfWeek
=
DateFormat
(
'EEEE'
).
format
(
parsedDate
);
_startingIndex
=
weekdays
.
indexOf
(
dayOfWeek
);
}
...
...
@@ -166,7 +196,8 @@ class Atteendacehistorynotifier with ChangeNotifier {
}
if
(
penaltyArray
!=
null
)
{
_penaltyArrayList
=
penaltyArray
.
entries
.
map
((
e
)
=>
{
e
.
key
:
e
.
value
}).
toList
();
_penaltyArrayList
=
penaltyArray
.
entries
.
map
((
e
)
=>
{
e
.
key
:
e
.
value
}).
toList
();
}
_isLoading
=
false
;
...
...
@@ -182,7 +213,11 @@ class Atteendacehistorynotifier with ChangeNotifier {
_sessionId
=
await
SharedpreferencesService
().
getString
(
"Session_id"
);
try
{
final
data
=
await
ApiCalling
.
DateWiseAttendanceApi
(
_empId
,
_sessionId
,
selected
);
final
data
=
await
ApiCalling
.
DateWiseAttendanceApi
(
_empId
,
_sessionId
,
selected
,
);
if
(
data
!=
null
)
{
_date
=
data
.
date
!;
_intime
=
data
.
intime
!;
...
...
lib/Notifiers/AttendanceNotifier.dart
View file @
b269a97b
...
...
@@ -11,7 +11,7 @@ import '../Models/AttendanceListResponse.dart';
import
'../Utils/commonServices.dart'
;
class
AttendanceNotifier
extends
ChangeNotifier
{
List
<
AttHistory
>
_attHistory
=
[];
List
<
dynamic
>
_attHistory
=
[];
int
_attendanceStatus
=
0
;
bool
_isLoading
=
false
;
String
_date
=
""
;
...
...
@@ -29,6 +29,7 @@ class AttendanceNotifier extends ChangeNotifier {
dynamic
_absentDays
=
0
;
dynamic
_holidays
=
0
;
dynamic
_latePenalties
=
0
;
int
?
_selectedIndex
;
int
?
_currentDayIndex
;
bool
_initialRenderDone
=
true
;
...
...
@@ -36,29 +37,52 @@ class AttendanceNotifier extends ChangeNotifier {
List
<
Map
<
String
,
dynamic
>>
_dateArrayList
=
[];
List
<
Map
<
String
,
dynamic
>>
_penalityArrayList
=
[];
List
<
AttHistory
>
get
attendanceHistory
=>
_attHistory
;
List
<
dynamic
>
get
attendanceHistory
=>
_attHistory
;
int
get
attendanceStatus
=>
_attendanceStatus
;
bool
get
isLoading
=>
_isLoading
;
String
get
date
=>
_date
;
String
get
intime
=>
_intime
;
String
get
outtime
=>
_outtime
;
String
get
inlocation
=>
_inlocation
;
String
get
outlocation
=>
_outlocation
;
String
get
penalties
=>
_penalties
;
String
get
selectedDate
=>
_selectedDate
;
dynamic
get
presentDays
=>
_presentDays
;
dynamic
get
absentDays
=>
_absentDays
;
dynamic
get
holidays
=>
_holidays
;
dynamic
get
latePenalties
=>
_latePenalties
;
DateTime
get
month
=>
_month
;
DateTime
get
present_month
=>
_present_month
;
String
get
year
=>
_year
;
int
get
monthNo
=>
_monthNo
;
String
?
get
dateColor
=>
_dateColor
;
int
?
get
selectedIndex
=>
_selectedIndex
;
int
?
get
currentDayIndex
=>
_currentDayIndex
;
bool
get
initialRenderDone
=>
_initialRenderDone
;
List
<
Map
<
String
,
dynamic
>>
get
dateArrayList
=>
_dateArrayList
;
List
<
Map
<
String
,
dynamic
>>
get
penalityArrayList
=>
_penalityArrayList
;
set
currentDayIndex
(
int
?
value
)
{
...
...
@@ -79,17 +103,23 @@ class AttendanceNotifier extends ChangeNotifier {
Future
<
void
>
getAttendanceList
(
homeprov
,
BuildContext
context
)
async
{
try
{
final
data
=
await
ApiCalling
.
AttendanceListApi
(
homeprov
.
empId
,
homeprov
.
session
);
final
data
=
await
ApiCalling
.
AttendanceListApi
(
homeprov
.
empId
,
homeprov
.
session
,
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
_attHistory
=
data
.
attHistory
!;
//
_attHistory = data.attHistory!;
_attendanceStatus
=
data
.
attStatus
!;
_isLoading
=
false
;
notifyListeners
();
}
else
{
_isLoading
=
true
;
SharedpreferencesService
().
clearPreferences
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LoginScreen
()));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LoginScreen
()),
);
}
}
else
{
toast
(
context
,
"Something went wrong, Please try again."
);
...
...
@@ -99,9 +129,17 @@ class AttendanceNotifier extends ChangeNotifier {
}
}
Future
<
void
>
dateWiseAttendance
(
homeprov
,
Selecteddate
,
BuildContext
context
)
async
{
Future
<
void
>
dateWiseAttendance
(
homeprov
,
Selecteddate
,
BuildContext
context
,
)
async
{
try
{
final
data
=
await
ApiCalling
.
DateWiseAttendanceApi
(
homeprov
.
empId
,
homeprov
.
session
,
Selecteddate
);
final
data
=
await
ApiCalling
.
DateWiseAttendanceApi
(
homeprov
.
empId
,
homeprov
.
session
,
Selecteddate
,
);
if
(
data
!=
null
)
{
_date
=
data
.
date
??
""
;
_intime
=
data
.
intime
??
""
;
...
...
@@ -120,7 +158,12 @@ class AttendanceNotifier extends ChangeNotifier {
Future
<
void
>
loadAttendanceDetails
(
homeprov
,
BuildContext
context
)
async
{
try
{
final
data
=
await
ApiCalling
.
LoadAttendanceDetails
(
homeprov
.
empId
,
homeprov
.
session
,
monthNo
,
year
);
final
data
=
await
ApiCalling
.
LoadAttendanceDetails
(
homeprov
.
empId
,
homeprov
.
session
,
monthNo
,
year
,
);
if
(
data
!=
null
)
{
final
decodedResponse
=
jsonDecode
(
data
);
_presentDays
=
decodedResponse
[
'present_days'
]
??
0
;
...
...
@@ -128,23 +171,35 @@ class AttendanceNotifier extends ChangeNotifier {
_holidays
=
decodedResponse
[
'holidays'
]
??
0
;
_latePenalties
=
decodedResponse
[
'late_penalties'
]
??
0
;
Map
<
String
,
dynamic
>?
dateArray
=
decodedResponse
[
'date_array'
];
Map
<
String
,
dynamic
>?
latePenaltyArray
=
decodedResponse
[
'late_penalty_array'
];
Map
<
String
,
dynamic
>?
latePenaltyArray
=
decodedResponse
[
'late_penalty_array'
];
_dateArrayList
=
[];
_penalityArrayList
=
[];
_attHistory
=
decodedResponse
[
'att_history'
];
// Calculate the date range: 26th of previous month to 25th of current month
DateTime
startDate
=
DateTime
(
_month
.
year
,
_month
.
month
-
1
,
26
);
DateTime
endDate
=
DateTime
(
_month
.
year
,
_month
.
month
,
25
);
// Generate date and penalty arrays
for
(
DateTime
date
=
startDate
;
date
.
isBefore
(
endDate
.
add
(
Duration
(
days:
1
)));
date
=
date
.
add
(
Duration
(
days:
1
)))
{
for
(
DateTime
date
=
startDate
;
date
.
isBefore
(
endDate
.
add
(
Duration
(
days:
1
)));
date
=
date
.
add
(
Duration
(
days:
1
))
)
{
String
dayStr
=
date
.
day
.
toString
();
String
dateKey
=
DateFormat
(
'yyyy-MM-dd'
).
format
(
date
);
String
color
=
dateArray
!=
null
&&
dateArray
.
containsKey
(
dateKey
)
?
dateArray
[
dateKey
]
:
''
;
String
color
=
dateArray
!=
null
&&
dateArray
.
containsKey
(
dateKey
)
?
dateArray
[
dateKey
]
:
''
;
_dateArrayList
.
add
({
dayStr:
color
});
int
penalty
=
latePenaltyArray
!=
null
&&
latePenaltyArray
.
containsKey
(
dateKey
)
?
latePenaltyArray
[
dateKey
]
:
0
;
int
penalty
=
latePenaltyArray
!=
null
&&
latePenaltyArray
.
containsKey
(
dateKey
)
?
latePenaltyArray
[
dateKey
]
:
0
;
_penalityArrayList
.
add
({
dateKey:
penalty
});
}
...
...
@@ -224,8 +279,10 @@ class AttendanceNotifier extends ChangeNotifier {
void
setPreviousMonth
(
homeprov
,
context
)
{
_month
=
DateTime
(
month
.
year
,
month
.
month
-
1
);
resetForNewMonth
();
if
(
DateFormat
(
'MMMM'
).
format
(
_present_month
)
==
DateFormat
(
'MMMM'
).
format
(
_month
)
&&
DateFormat
(
'yyyy'
).
format
(
_present_month
)
==
DateFormat
(
'yyyy'
).
format
(
_month
))
{
if
(
DateFormat
(
'MMMM'
).
format
(
_present_month
)
==
DateFormat
(
'MMMM'
).
format
(
_month
)
&&
DateFormat
(
'yyyy'
).
format
(
_present_month
)
==
DateFormat
(
'yyyy'
).
format
(
_month
))
{
_initialRenderDone
=
true
;
_month
=
present_month
;
}
...
...
@@ -235,8 +292,10 @@ class AttendanceNotifier extends ChangeNotifier {
void
setNextMonth
(
homeprov
,
context
)
{
_month
=
DateTime
(
month
.
year
,
month
.
month
+
1
);
resetForNewMonth
();
if
(
DateFormat
(
'MMMM'
).
format
(
_present_month
)
==
DateFormat
(
'MMMM'
).
format
(
_month
)
&&
DateFormat
(
'yyyy'
).
format
(
_present_month
)
==
DateFormat
(
'yyyy'
).
format
(
_month
))
{
if
(
DateFormat
(
'MMMM'
).
format
(
_present_month
)
==
DateFormat
(
'MMMM'
).
format
(
_month
)
&&
DateFormat
(
'yyyy'
).
format
(
_present_month
)
==
DateFormat
(
'yyyy'
).
format
(
_month
))
{
_initialRenderDone
=
true
;
_month
=
present_month
;
}
...
...
lib/Notifiers/InventoryProvider.dart
View file @
b269a97b
...
...
@@ -124,15 +124,7 @@ class InventoryProvider extends ChangeNotifier {
}
else
if
(
data
.
error
==
1
)
{
toast
(
context
,
"Enter Correct ID"
);
}
else
{}
if
(
from
==
"inventory"
)
{
this
.
_qrViewController
!.
pauseCamera
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
GeneratorPartDetailsScreen
(),
),
);
}
notifyListeners
();
}
}
on
Error
catch
(
e
)
{
...
...
lib/Notifiers/PCWalletProvider.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:provider/provider.dart'
;
import
'../Models/PaymentCollectionWalletResponse.dart'
;
import
'HomeScreenNotifier.dart'
;
class
Pcwalletprovider
extends
ChangeNotifier
{
List
<
HistoryList
>
_historyList
=
[];
TotalDet
_totalDet
=
TotalDet
();
bool
_isLoading
=
false
;
bool
get
isLoading
=>
_isLoading
;
TotalDet
get
totlDetails
=>
_totalDet
;
List
<
HistoryList
>
get
historyList
=>
_historyList
;
Future
<
void
>
LoadTransactionsListAPI
(
BuildContext
context
)
async
{
try
{
var
HomeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
,
);
final
data
=
await
ApiCalling
.
loadTransactionsListAPI
(
HomeProvider
.
empId
,
HomeProvider
.
session
);
if
(
data
!=
null
)
{
if
(
data
.
error
==
0
)
{
_historyList
=
data
.
historyList
!;
_totalDet
=
data
.
totalDet
!;
_isLoading
=
false
;
}
else
{
_isLoading
=
false
;
}
notifyListeners
();
}
else
{
print
(
"Something went wrong, Please try again."
);
}
}
on
Exception
catch
(
e
)
{
print
(
"
$e
"
);
}
}
Map
<
String
,
List
<
HistoryList
>>
groupByDate
(
List
<
HistoryList
>
list
)
{
Map
<
String
,
List
<
HistoryList
>>
grouped
=
{};
for
(
var
item
in
list
)
{
String
date
=
item
.
datetime
!;
if
(!
grouped
.
containsKey
(
date
))
{
grouped
[
date
]
=
[];
}
grouped
[
date
]!.
add
(
item
);
}
return
grouped
;
}
}
\ No newline at end of file
lib/Notifiers/PaymentCollectionProvider.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/Models/PaymentCollectionResponse.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Utils/SharedpreferencesService.dart'
;
import
'package:generp/screens/LoginScreen.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:provider/provider.dart'
;
import
'../Models/AccountSuggestionResponse.dart'
;
import
'../screens/splash.dart'
;
class
Paymentcollectionprovider
extends
ChangeNotifier
{
List
<
PC_List
>
_paymentCollectionList
=
[];
List
<
AccountList
>
_accountList
=
[];
bool
_isLoading
=
false
;
List
<
PC_List
>
get
paymenCollectionList
=>
_paymentCollectionList
;
List
<
AccountList
>
get
accountList
=>
_accountList
;
bool
get
isLoading
=>
_isLoading
;
Future
<
void
>
PaymentCollectionAPI
(
BuildContext
context
)
async
{
try
{
var
HomeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
,
);
final
data
=
await
ApiCalling
.
paymentCollectionListAPI
(
HomeProvider
.
empId
,
HomeProvider
.
session
,
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
if
(
data
.
error
==
0
)
{
_paymentCollectionList
=
data
.
list
!;
_isLoading
=
false
;
}
else
{
_isLoading
=
false
;
}
notifyListeners
();
}
else
{
SharedpreferencesService
().
clearPreferences
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Splash
()),
);
}
notifyListeners
();
}
}
on
Error
catch
(
e
)
{
print
(
e
.
toString
());
}
}
Future
<
void
>
AccountSuggestionAPI
(
BuildContext
context
,
searchText
)
async
{
try
{
var
HomeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
,
);
final
data
=
await
ApiCalling
.
AccountSuggestionAPI
(
HomeProvider
.
empId
,
HomeProvider
.
session
,
searchText
,
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
if
(
data
.
error
==
0
)
{
_isLoading
=
false
;
_accountList
=
data
.
accountList
!;
_isLoading
=
false
;
notifyListeners
();
}
else
{
_isLoading
=
false
;
_accountList
=
[];
notifyListeners
();
}
}
else
{
SharedpreferencesService
().
clearPreferences
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LoginScreen
()),
);
}
}
else
{
_isLoading
=
false
;
}
}
on
Error
catch
(
e
)
{
print
(
e
.
toString
());
}
}
}
lib/Notifiers/PaymentDetailsProvider.dart
0 → 100644
View file @
b269a97b
import
'dart:io'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_image_compress/flutter_image_compress.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Utils/SharedpreferencesService.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:image_picker/image_picker.dart'
;
import
'package:provider/provider.dart'
;
import
'../Models/TechnicianLoadNumbersResponse.dart'
;
import
'../Utils/commonServices.dart'
;
import
'../screens/splash.dart'
;
import
'package:pin_code_fields/pin_code_fields.dart'
;
class
Paymentdetailsprovider
extends
ChangeNotifier
{
List
<
PaymentModeList
>
_payment_mode_drop_down
=
[];
List
<
Contacts
>
_contacts_drop_down
=
[];
String
_paymentModeID
=
""
;
String
_PaymentMode
=
""
;
String
_contactID
=
""
;
String
_contact
=
""
;
String
_enteredOtp
=
""
;
PaymentModeList
?
_selectPaymentModeList
;
Contacts
?
_selectContact
;
var
_type
=
""
;
var
_refType
=
""
;
var
_refId
=
""
;
var
_account_id
=
""
;
var
_CollectionId
=
0
;
var
_image_picked
=
0
;
final
ImagePicker
_picker
=
ImagePicker
();
File
?
_image
;
bool
_isLoading
=
true
;
List
<
PaymentModeList
>
get
paymentModeDropDown
=>
_payment_mode_drop_down
;
List
<
Contacts
>
get
contactsDropDown
=>
_contacts_drop_down
;
PaymentModeList
?
get
selectPaymentMode
=>
_selectPaymentModeList
;
Contacts
?
get
selectContact
=>
_selectContact
;
String
get
paymentModeID
=>
_paymentModeID
;
String
get
PaymentMode
=>
_PaymentMode
;
String
get
contactID
=>
_contactID
;
String
get
contact
=>
_contact
;
String
get
enteredOtp
=>
_enteredOtp
;
get
type
=>
_type
;
get
refType
=>
_refType
;
get
refId
=>
_refId
;
get
account_id
=>
_account_id
;
get
CollectionId
=>
_CollectionId
;
get
image_picked
=>
_image_picked
;
bool
get
isLoading
=>
_isLoading
;
set
enteredOtp
(
String
value
){
_enteredOtp
=
value
;
}
set
selectContact
(
value
){
_selectContact
=
value
;
_contact
=
value
?.
name
;
_contactID
=
value
?.
mob1
;
notifyListeners
();
}
set
selectPaymentMode
(
value
){
_selectPaymentModeList
=
value
;
_PaymentMode
=
value
?.
name
??
""
;
_paymentModeID
=
value
?.
id
??
""
;
notifyListeners
();
}
set
paymentModeID
(
value
){
_paymentModeID
=
value
;
notifyListeners
();
}
set
PaymentMode
(
value
){
_PaymentMode
=
value
;
notifyListeners
();
}
set
contact
(
value
){
_contact
=
value
;
notifyListeners
();
}
set
contactID
(
value
){
_contactID
=
value
;
notifyListeners
();
}
Future
<
void
>
LoadNumbersAPI
(
BuildContext
context
,
accountName
,
referenceID
,
generatorID
,
)
async
{
if
(
accountName
==
"Generator"
)
{
_type
=
"generator"
;
_refType
=
"Complaint"
;
_refId
=
referenceID
;
}
else
{
_type
=
"account"
;
_refType
=
"Account"
;
_refId
=
referenceID
;
}
try
{
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
,
);
// print("${type}");
final
data
=
await
ApiCalling
.
LoadContactsTechnicianAPI
(
homeProvider
.
empId
,
homeProvider
.
session
,
_type
,
generatorID
,
_refId
,
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
if
(
data
.
error
==
0
)
{
_contacts_drop_down
=
data
.
contacts
!;
_payment_mode_drop_down
=
data
.
paymentModeList
!;
if
(
_selectContact
!=
null
&&
!
_contacts_drop_down
.
contains
(
_selectContact
))
{
_selectContact
=
null
;
_contact
=
""
;
_contactID
=
""
;
}
if
(
_selectPaymentModeList
!=
null
&&
!
_payment_mode_drop_down
.
contains
(
_selectPaymentModeList
))
{
_selectPaymentModeList
=
null
;
_PaymentMode
=
""
;
_paymentModeID
=
""
;
}
notifyListeners
();
}
else
{}
}
else
{
SharedpreferencesService
().
clearPreferences
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Splash
()),
);
}
}
}
on
Error
catch
(
e
)
{
debugPrint
(
e
.
toString
());
}
}
Future
<
void
>
PaymentUpdateAPI
(
BuildContext
context
,
reference
,
amount
)
async
{
try
{
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
,
);
final
data
=
await
ApiCalling
.
TechnicianUpdatepaymentAPI
(
homeProvider
.
empId
,
homeProvider
.
session
,
_refType
,
_refId
,
_paymentModeID
,
reference
,
amount
,
_contact
,
_contactID
,
_image
,
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
if
(
data
.
error
==
0
)
{
_CollectionId
=
data
.
paymentCollectionId
??
0
;
// OTPDialogue(context);
notifyListeners
();
}
else
{}
}
else
{
SharedpreferencesService
().
clearPreferences
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Splash
()),
);
}
}
}
on
Error
catch
(
e
)
{
debugPrint
(
e
.
toString
());
}
}
Future
<
void
>
OTPVerifyAPI
(
BuildContext
context
)
async
{
try
{
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
,
);
final
data
=
await
ApiCalling
.
TechnicianPaymentOTPValidateAPI
(
homeProvider
.
empId
,
homeProvider
.
session
,
_CollectionId
,
_enteredOtp
,
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
if
(
data
.
error
==
0
)
{
toast
(
context
,
data
.
message
);
Navigator
.
pop
(
context
,
true
);
}
else
{
toast
(
context
,
data
.
message
);
}
}
else
{
SharedpreferencesService
().
clearPreferences
();
toast
(
context
,
data
.
message
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Splash
()),
);
}
}
else
{}
}
on
Error
catch
(
e
)
{
debugPrint
(
e
.
toString
());
}
}
imgFromCamera
(
context
,
reference
,
amount
)
async
{
// Capture a photo
try
{
final
XFile
?
galleryImage
=
await
_picker
.
pickImage
(
source
:
ImageSource
.
camera
,
imageQuality:
50
,
);
debugPrint
(
"added"
);
_image
=
File
(
galleryImage
!.
path
);
_image_picked
=
1
;
if
(
_image
!=
null
)
{
var
file
=
FlutterImageCompress
.
compressWithFile
(
galleryImage
!.
path
);
{
if
(
file
!=
null
)
{
CheckValidations
(
context
,
reference
,
amount
);
}
}
}
}
catch
(
e
)
{
debugPrint
(
"mmmm:
${e.toString()}
"
);
}
}
imgFromGallery
(
context
,
reference
,
amount
)
async
{
// Pick an image
try
{
final
XFile
?
galleryImage
=
await
_picker
.
pickImage
(
source
:
ImageSource
.
gallery
,
);
final
bytes
=
(
await
galleryImage
?.
readAsBytes
())?.
lengthInBytes
;
final
kb
=
bytes
!
/
1024
;
final
mb
=
kb
/
1024
;
debugPrint
(
"Jenny: bytes:
$bytes
, kb:
$kb
, mb:
$mb
"
);
_image
=
File
(
galleryImage
!.
path
);
_image_picked
=
1
;
if
(
_image
!=
null
)
{
var
file
=
FlutterImageCompress
.
compressWithFile
(
galleryImage
!.
path
);
{
if
(
file
!=
null
)
{
CheckValidations
(
context
,
reference
,
amount
);
}
}
}
}
catch
(
e
)
{
debugPrint
(
"mmmm:
${e.toString()}
"
);
}
}
CheckValidations
(
BuildContext
context
,
reference
,
amount
)
{
if
(
_contactID
==
null
||
_contactID
==
""
)
{
toast
(
context
,
"Select Phone Number"
);
}
else
if
(
_paymentModeID
==
null
||
_paymentModeID
==
""
)
{
toast
(
context
,
"Select Payment Mode"
);
}
else
if
(
amount
.
isEmpty
)
{
toast
(
context
,
"Enter Amount"
);
}
else
if
(
_image
==
""
||
_image
==
null
||
_image_picked
==
0
)
{
toast
(
context
,
"Select Attachment"
);
}
else
{
PaymentUpdateAPI
(
context
,
reference
,
amount
);
}
}
String
_saveAgainst
=
""
;
String
_genId
=
""
;
String
_accountId
=
""
;
String
get
saveAgainst
=>
_saveAgainst
;
String
get
genId
=>
_genId
;
String
get
accountId
=>
_accountId
;
set
saveAgainst
(
value
){
_saveAgainst
=
value
;
notifyListeners
();
}
set
genId
(
value
){
_genId
=
value
;
notifyListeners
();
}
set
accountId
(
value
){
_accountId
=
value
;
}
Future
<
void
>
AddContactAPIFunction
(
BuildContext
context
,
actName
,
generatorID
,
name
,
designation
,
mobile
,
altMobile
,
telephone
,
email
)
async
{
if
(
actName
==
"Generator"
)
{
_saveAgainst
=
"Generator"
;
_genId
=
generatorID
;
}
else
{
_saveAgainst
=
"account"
;
_accountId
=
generatorID
;
}
try
{
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
,
);
final
data
=
await
ApiCalling
.
AddContactAPI
(
homeProvider
.
empId
,
homeProvider
.
session
,
_genId
,
name
,
designation
,
mobile
,
altMobile
,
telephone
,
email
,
_saveAgainst
,
_accountId
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
if
(
data
.
error
==
0
)
{
toast
(
context
,
data
.
message
);
Navigator
.
pop
(
context
,
true
);
}
else
if
(
data
.
error
==
1
)
{
toast
(
context
,
data
.
message
);
}
}
else
{
SharedpreferencesService
().
clearPreferences
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Splash
()));
}
}
}
on
Error
catch
(
e
)
{
print
(
e
.
toString
());
}
}
}
lib/Notifiers/PendingComplaintsProvider.dart
0 → 100644
View file @
b269a97b
import
'dart:io'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_image_compress/flutter_image_compress.dart'
;
import
'package:generp/Models/TechniciansPendingComplaintsResponse.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Utils/SharedpreferencesService.dart'
;
import
'package:generp/screens/serviceEngineer/serviceEngineerDashboard.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:image_picker/image_picker.dart'
;
import
'package:provider/provider.dart'
;
import
'../Utils/commonServices.dart'
;
import
'../screens/splash.dart'
;
class
Pendingcomplaintsprovider
extends
ChangeNotifier
{
TextEditingController
fsrNumberController
=
TextEditingController
();
TextEditingController
runningHoursController
=
TextEditingController
();
TextEditingController
feedbackController
=
TextEditingController
();
List
<
TP_List
>
_technician_complaint_list
=
[];
bool
_isLoading
=
false
;
String
?
_statusId
;
String
?
_selectedValue
;
TimeOfDay
_selectedTime
=
TimeOfDay
.
now
();
String
_formattedTime
=
""
;
final
ImagePicker
_picker
=
ImagePicker
();
File
?
_image
;
var
_image_picked
=
0
;
List
<
TP_List
>
get
technician_complaint_list
=>
_technician_complaint_list
;
bool
get
isLoading
=>
_isLoading
;
String
?
get
statusID
=>
_statusId
;
String
?
get
selectedValue
=>
_selectedValue
;
TimeOfDay
get
selectedTime
=>
_selectedTime
;
String
get
formattedTime
=>
_formattedTime
;
int
get
imagePicked
=>
_image_picked
;
set
statusID
(
String
?
value
){
_statusId
=
value
;
notifyListeners
();
}
Future
<
void
>
TechnicianPendingComplaints
(
BuildContext
context
)
async
{
var
HomeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
try
{
final
data
=
await
ApiCalling
.
LoadTechnicianComplaintsAPI
(
HomeProvider
.
empId
,
HomeProvider
.
session
,
);
//await UserApi.LoadTechnicianComplaintsAPI("752","bb1bd615748920990e679a575b0684cf3f53367620dd775a47e4a771bde22f313f4d7722ce131d65427ce054053aed8eb0ca").then((data) => {
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
if
(
data
.
error
==
0
)
{
_technician_complaint_list
=
data
.
list
!;
_isLoading
=
false
;
notifyListeners
();
}
else
{
_isLoading
=
false
;
}
}
else
{
SharedpreferencesService
().
clearPreferences
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Splash
()),
);
}
}
}
on
Error
catch
(
e
)
{
debugPrint
(
e
.
toString
());
}
}
Future
TimePicker
(
context
)
async
{
return
await
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
=>
AlertDialog
(
content:
TimePickerDialog
(
initialTime:
TimeOfDay
.
now
(),
initialEntryMode:
TimePickerEntryMode
.
input
,
),
),
)
??
false
;
}
Future
<
void
>
selectTime
(
BuildContext
context
)
async
{
final
TimeOfDay
?
picked
=
await
showTimePicker
(
context:
context
,
initialTime:
_selectedTime
,
);
if
(
picked
!=
null
&&
picked
!=
_selectedTime
)
_selectedTime
=
picked
;
_formattedTime
=
_selectedTime
.
hour
.
toString
()
+
":"
+
_selectedTime
.
minute
.
toString
();
}
String
formatTime
(
int
hour
,
int
minute
)
{
String
period
=
(
hour
>=
12
)
?
'pm'
:
'am'
;
if
(
hour
==
0
)
{
hour
=
12
;
}
else
if
(
hour
>
12
)
{
hour
-=
12
;
}
String
formattedHour
=
(
hour
<
10
)
?
'0
$hour
'
:
'
$hour
'
;
String
formattedMinute
=
(
minute
<
10
)
?
'0
$minute
'
:
'
$minute
'
;
print
(
"formattedTime:
$formattedHour
:
$formattedMinute
$period
"
);
return
'
$formattedHour
:
$formattedMinute
$period
'
;
}
Future
<
void
>
UpdateComplaintAPIFunction
(
BuildContext
context
,
complaint_id
,
feedback
,
fsrNumber
,
runningHr
,
statusId
,
)
async
{
var
HomeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
try
{
final
data
=
await
ApiCalling
.
UpdateComplaintAPI
(
HomeProvider
.
empId
,
HomeProvider
.
session
,
complaint_id
,
_selectedTime
.
hour
.
toString
()
+
":"
+
_selectedTime
.
minute
.
toString
(),
feedback
,
fsrNumber
,
runningHr
,
statusId
,
_image
,
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
if
(
data
.
error
==
0
)
{
toast
(
context
,
"Complaint Status Updated!"
);
Navigator
.
pop
(
context
);
}
else
if
(
data
.
error
==
1
)
{
toast
(
context
,
"Something Went Wrong, please try again later!"
);
}
else
if
(
data
.
error
==
2
)
{
toast
(
context
,
"Tag Generator before updating visit !"
);
}
else
if
(
data
.
error
==
3
)
{
toast
(
context
,
"Tag Location before updating visit !"
);
}
else
{
toast
(
context
,
"Something Went Wrong, please try again later!"
);
}
}
else
{
SharedpreferencesService
().
clearPreferences
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Splash
()),
);
}
}
}
on
Error
catch
(
e
)
{
print
(
e
.
toString
());
}
}
Future
SelectAttachmentDialogue
(
BuildContext
context
)
async
{
return
await
showDialog
(
context:
context
,
builder:
(
context
)
=>
AlertDialog
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
5.0
),
),
elevation:
20
,
shadowColor:
Colors
.
black
,
title:
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
"Select Source"
,
style:
TextStyle
(
color:
Colors
.
black
,
fontWeight:
FontWeight
.
w500
,
decoration:
TextDecoration
.
underline
,
),
),
),
content:
Container
(
height:
85
,
child:
Column
(
children:
[
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
imgFromGallery
();
},
child:
Container
(
height:
35
,
child:
Text
(
"Select photo from gallery"
),
),
),
SizedBox
(
height:
10
),
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
imgFromCamera
(
);
},
child:
Container
(
height:
35
,
child:
Text
(
"Capture photo from camera"
),
),
),
],
),
),
),
barrierDismissible:
true
,
)
??
false
;
}
imgFromCamera
(
)
async
{
// Capture a photo
try
{
final
XFile
?
galleryImage
=
await
_picker
.
pickImage
(
source
:
ImageSource
.
camera
,
imageQuality:
50
,
);
print
(
"added"
);
_image
=
File
(
galleryImage
!.
path
);
_image_picked
=
1
;
notifyListeners
();
}
catch
(
e
)
{
debugPrint
(
"mmmm:
${e.toString()}
"
);
}
}
imgFromGallery
(
)
async
{
// Pick an image
try
{
final
XFile
?
galleryImage
=
await
_picker
.
pickImage
(
source
:
ImageSource
.
gallery
,
);
final
bytes
=
(
await
galleryImage
?.
readAsBytes
())?.
lengthInBytes
;
final
kb
=
bytes
!
/
1024
;
final
mb
=
kb
/
1024
;
debugPrint
(
"Jenny: bytes:
$bytes
, kb:
$kb
, mb:
$mb
"
);
_image
=
File
(
galleryImage
!.
path
);
_image_picked
=
1
;
notifyListeners
();
}
catch
(
e
)
{
debugPrint
(
"mmmm:
${e.toString()}
"
);
}
}
}
lib/Notifiers/ServiceEngineerDashboardProvider.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Utils/SharedpreferencesService.dart'
;
import
'package:generp/screens/LoginScreen.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:provider/provider.dart'
;
class
Serviceengineerdashboardprovider
extends
ChangeNotifier
{
int
_avgRating
=
0
;
int
_pendingComplaints
=
0
;
int
_todayVisits
=
0
;
int
_thisMonthsVisits
=
0
;
String
_paymentCollectionWalletBalanceAmount
=
""
;
String
_monthlyPaymentCollectionAmount
=
""
;
bool
_isLoading
=
false
;
int
get
avgRating
=>
_avgRating
;
int
get
pendingComplaints
=>
_pendingComplaints
;
int
get
todayVisits
=>
_todayVisits
;
int
get
thisMonthsVisits
=>
_thisMonthsVisits
;
String
get
paymentCollectionWalletBalanceAmount
=>
_paymentCollectionWalletBalanceAmount
;
String
get
monthlyPaymentCollectionAmount
=>
_monthlyPaymentCollectionAmount
;
bool
get
isLoading
=>
_isLoading
;
Future
<
void
>
LoadTechnicianDashboard
(
BuildContext
context
)
async
{
var
HomeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
try
{
final
data
=
await
ApiCalling
.
loadTechnicianDashboardApi
(
HomeProvider
.
empId
,
HomeProvider
.
session
,
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
if
(
data
.
error
==
0
)
{
_avgRating
=
data
.
avgRating
!;
_pendingComplaints
=
data
.
pendingComplaints
!;
_todayVisits
=
data
.
todayVisits
!;
_thisMonthsVisits
=
data
.
thisMonthsVisits
!;
_paymentCollectionWalletBalanceAmount
=
data
.
paymentCollectionWalletBalanceAmount
!;
_monthlyPaymentCollectionAmount
=
data
.
monthlyPaymentCollectionAmount
!;
_isLoading
=
false
;
notifyListeners
();
}
else
{}
}
else
if
(
data
.
sessionExists
==
0
)
{
SharedpreferencesService
().
clearPreferences
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LoginScreen
()),
);
}
}
else
{
print
(
"Something went wrong, Please try again."
);
}
}
on
Exception
catch
(
e
)
{
print
(
"
$e
"
);
}
}
}
lib/Notifiers/TodayMontlyVisitsProvider.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Utils/SharedpreferencesService.dart'
;
import
'package:generp/screens/LoginScreen.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:provider/provider.dart'
;
import
'../Models/TodayVisitResponse.dart'
;
class
Todaymontlyvisitsprovider
extends
ChangeNotifier
{
List
<
Visitlist
>
_visitsList
=
[];
bool
_isLoading
=
false
;
String
_title
=
""
;
List
<
Visitlist
>
get
visitsList
=>
_visitsList
;
bool
get
isLoading
=>
_isLoading
;
String
get
title
=>
_title
;
set
title
(
String
value
){
_title
=
value
;
}
Future
<
void
>
LoadMonthVisitsListAPI
(
BuildContext
context
)
async
{
try
{
var
HomeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
,
);
final
data
=
await
ApiCalling
.
getMonthVisitsListAPI
(
HomeProvider
.
empId
,
HomeProvider
.
session
,
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
if
(
data
.
error
==
0
)
{
_visitsList
=
data
.
list
!;
_isLoading
=
false
;
}
else
{
_isLoading
=
false
;
}
notifyListeners
();
}
else
{
SharedpreferencesService
().
clearPreferences
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LoginScreen
()),
);
}
// toast(context, monthvisitlist.length.toString());
}
else
{
print
(
"Something went wrong, Please try again."
);
}
}
on
Exception
catch
(
e
)
{
print
(
"
$e
"
);
}
}
Future
<
void
>
LoadTodayVisitsListAPI
(
BuildContext
context
)
async
{
try
{
var
HomeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
,
);
final
data
=
await
ApiCalling
.
getTodayVisitsListAPI
(
HomeProvider
.
empId
,
HomeProvider
.
session
,
);
if
(
data
!=
null
)
{
if
(
data
.
sessionExists
==
1
)
{
if
(
data
.
error
==
0
)
{
_visitsList
=
data
.
list
!;
_isLoading
=
false
;
}
else
{
_isLoading
=
false
;
}
notifyListeners
();
}
else
{
SharedpreferencesService
().
clearPreferences
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LoginScreen
()),
);
}
}
else
{
print
(
"Something went wrong, Please try again."
);
}
}
on
Exception
catch
(
e
)
{
print
(
"
$e
"
);
}
}
}
lib/Notifiers/VisitDetailsProvider.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:provider/provider.dart'
;
import
'../Models/FollowUpResponse.dart'
;
import
'../Models/ViewVisitDetailsResponseNew.dart'
;
import
'../Utils/commonServices.dart'
;
class
Visitdetailsprovider
extends
ChangeNotifier
{
CustomerDetails
_customerDetails
=
CustomerDetails
();
GeneratorDetails
_generatorDetails
=
GeneratorDetails
();
ComplaintDetailsNew
_complaintDetailsNew
=
ComplaintDetailsNew
();
List
<
Followuplist
>
_followupList
=
[];
bool
_isLoading
=
false
;
CustomerDetails
get
customerDetails
=>
_customerDetails
;
GeneratorDetails
get
generatorDetails
=>
_generatorDetails
;
ComplaintDetailsNew
get
complaintDetailsNew
=>
_complaintDetailsNew
;
List
<
Followuplist
>
get
followUpList
=>
_followupList
;
bool
get
isLoading
=>
_isLoading
;
Future
<
void
>
LoadVisitDetailsAPI
(
BuildContext
context
,
ComplaintID
)
async
{
try
{
var
HomeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
final
data
=
await
ApiCalling
.
loadVisitDetailsAPI
(
HomeProvider
.
empId
,
HomeProvider
.
session
,
ComplaintID
);
if
(
data
!=
null
)
{
if
(
data
.
error
==
0
)
{
// complaintdetails = data.complaintDetails!;
_customerDetails
=
data
.
customerDetails
!;
_generatorDetails
=
data
.
generatorDetails
!;
_complaintDetailsNew
=
data
.
complaintDetailsNew
!;
_isLoading
=
false
;
notifyListeners
();
}
else
{
toast
(
context
,
"Something Went Wrong, Please try again!"
);
print
(
"error"
);
}
}
else
{
toast
(
context
,
"No response From the server, Please try Again!"
);
print
(
"error2"
);
}
}
on
Error
catch
(
e
)
{
print
(
e
.
toString
());
}
}
Future
<
void
>
LoadFollowupListAPI
(
BuildContext
context
,
ComplaintID
)
async
{
try
{
var
HomeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
final
data
=
await
ApiCalling
.
loadFollowupListAPI
(
HomeProvider
.
empId
,
HomeProvider
.
session
,
ComplaintID
);
if
(
data
!=
null
)
{
if
(
data
.
error
==
0
)
{
// complaintdetails = data.complaintDetails!;
_followupList
=
data
.
list
!;
_isLoading
=
false
;
notifyListeners
();
}
else
{
toast
(
context
,
"Something Went Wrong, Please try again!"
);
print
(
"error"
);
}
}
else
{
toast
(
context
,
"No response From the server, Please try Again!"
);
print
(
"error2"
);
}
}
on
Error
catch
(
e
)
{
print
(
e
.
toString
());
}
}
}
\ No newline at end of file
lib/Utils/commonWidgets.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'app_colors.dart'
;
PreferredSizeWidget
appbar
(
BuildContext
context
,
title
)
{
return
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/app_bar_back.svg"
,
height:
25
),
),
Text
(
title
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
],
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
);
}
lib/main.dart
View file @
b269a97b
...
...
@@ -12,7 +12,14 @@ import 'package:generp/Notifiers/Counter.dart';
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Notifiers/InventoryProvider.dart'
;
import
'package:generp/Notifiers/LogoutNotifier.dart'
;
import
'package:generp/Notifiers/PCWalletProvider.dart'
;
import
'package:generp/Notifiers/PaymentCollectionProvider.dart'
;
import
'package:generp/Notifiers/PaymentDetailsProvider.dart'
;
import
'package:generp/Notifiers/PendingComplaintsProvider.dart'
;
import
'package:generp/Notifiers/ProfileNotifier.dart'
;
import
'package:generp/Notifiers/ServiceEngineerDashboardProvider.dart'
;
import
'package:generp/Notifiers/TodayMontlyVisitsProvider.dart'
;
import
'package:generp/Notifiers/VisitDetailsProvider.dart'
;
import
'package:generp/Notifiers/loginNotifier.dart'
;
import
'package:generp/Notifiers/splashVersionNotifier.dart'
;
import
'package:generp/Utils/SharedpreferencesService.dart'
;
...
...
@@ -180,6 +187,13 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider
(
create:
(
_
)=>
AttendanceNotifier
()),
ChangeNotifierProvider
(
create:
(
_
)=>
CheckInOutProvider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
InventoryProvider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Serviceengineerdashboardprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Pendingcomplaintsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Todaymontlyvisitsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Paymentcollectionprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Visitdetailsprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Pcwalletprovider
()),
ChangeNotifierProvider
(
create:
(
_
)=>
Paymentdetailsprovider
()),
],
child:
Builder
(
builder:
(
BuildContext
context
){
...
...
lib/screens/AttendanceScreen.dart
View file @
b269a97b
...
...
@@ -3,6 +3,7 @@ import 'package:flutter_svg/svg.dart';
import
'package:generp/Notifiers/AttendanceNotifier.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/CheckInScreen.dart'
;
import
'package:intl/intl.dart'
;
import
'package:provider/provider.dart'
;
...
...
@@ -34,14 +35,14 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
return
Consumer
<
AttendanceNotifier
>(
builder:
(
context
,
attendance
,
index
)
{
final
timeString
=
attendance
.
attendanceHistory
.
firstOrNull
?
.
check
InT
ime
.
toString
()
??
""
;
attendance
.
attendanceHistory
.
firstOrNull
?
[
'
check
_in_t
ime
'
]
.
toString
()
??
""
;
final
match
=
RegExp
(
r'^(\d{1,2}:\d{2})(am|pm)$'
,
caseSensitive:
false
,
).
firstMatch
(
timeString
.
replaceAll
(
' '
,
''
).
toLowerCase
());
final
timeString2
=
attendance
.
attendanceHistory
.
firstOrNull
?
.
check
OutT
ime
.
toString
()
??
""
;
attendance
.
attendanceHistory
.
firstOrNull
?
[
'
check
_out_t
ime
'
]
.
toString
()
??
""
;
final
match2
=
RegExp
(
r'^(\d{1,2}:\d{2})(am|pm)$'
,
caseSensitive:
false
,
...
...
@@ -52,6 +53,10 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
String
formattedTime2
=
match2
?.
group
(
1
)
??
"-"
;
String
period2
=
match2
?.
group
(
2
)?.
toUpperCase
()
??
""
;
print
(
attendance
.
attendanceHistory
.
firstOrNull
);
final
dateArrayList
=
attendance
.
dateArrayList
;
final
penalityArrayList
=
attendance
.
penalityArrayList
;
var
selectedIndex
=
attendance
.
selectedIndex
;
...
...
@@ -71,7 +76,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
A
pp
B
ar
(
automaticallyImplyLeading:
false
),
appBar:
a
pp
b
ar
(
context
,
"Attendance"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
...
...
@@ -121,14 +126,14 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
text:
TextSpan
(
children:
[
TextSpan
(
text:
"
$
{
formattedTime
}
"
,
text:
"
$formattedTime
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
18
,
),
),
TextSpan
(
text:
"
$
{
period
}
"
,
text:
"
$period
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
),
...
...
@@ -136,7 +141,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
],
),
),
Text
(
"
Head Office
"
),
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_in_location']}
"
),
],
),
),
...
...
@@ -150,14 +155,14 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
text:
TextSpan
(
children:
[
TextSpan
(
text:
"
$
{
formattedTime2
}
"
,
text:
"
$formattedTime2
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
18
,
),
),
TextSpan
(
text:
"
$
{
period2
}
"
,
text:
"
$period2
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
),
...
...
@@ -165,7 +170,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
],
),
),
Text
(
"
Head Office
"
),
Text
(
"
${attendance.attendanceHistory.firstOrNull?['check_out_location']}
"
),
],
),
),
...
...
@@ -439,7 +444,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
center
Docked
,
floatingActionButtonLocation:
FloatingActionButtonLocation
.
center
Float
,
);
},
);
...
...
lib/screens/CheckInScreen.dart
View file @
b269a97b
...
...
@@ -6,6 +6,7 @@ import 'package:flutter_image_compress/flutter_image_compress.dart';
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:generp/Utils/SharedpreferencesService.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:geolocator/geolocator.dart'
;
import
'package:geolocator_platform_interface/src/enums/location_accuracy.dart'
as
geo_location
;
...
...
@@ -48,39 +49,11 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
return
Consumer
<
CheckInOutProvider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
appBar:
appbar
(
context
,
widget
.
getAttendanceStatus
==
0
?
"Check In"
:
"Check Out"
),
body:
Container
(
child:
SafeArea
(
child:
Column
(
children:
[
Container
(
alignment:
Alignment
.
topCenter
,
height:
50
,
child:
Row
(
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
20
)),
InkWell
(
onTap:
()
{
Navigator
.
pop
(
context
,
true
);
},
child:
SvgPicture
.
asset
(
"assets/back_icon.svg"
,
height:
29
,
width:
29
,
),
),
SizedBox
(
width:
20
),
Center
(
child:
Text
(
widget
.
getAttendanceStatus
==
0
?
"Check In"
:
"Check Out"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
white
,
),
),
),
],
),
),
Expanded
(
child:
ClipRRect
(
borderRadius:
BorderRadius
.
only
(
...
...
lib/screens/HomeScreen.dart
View file @
b269a97b
...
...
@@ -10,6 +10,7 @@ import 'package:generp/Notifiers/ProfileNotifier.dart';
import
'package:generp/screens/LoginScreen.dart'
;
import
'package:generp/screens/WebERPScreen.dart'
;
import
'package:generp/screens/WebWhizzdomScreen.dart'
;
import
'package:generp/screens/serviceEngineer/serviceEngineerDashboard.dart'
;
import
'package:provider/provider.dart'
;
import
'../Utils/app_colors.dart'
;
...
...
@@ -167,7 +168,7 @@ class _MyHomePageState extends State<MyHomePage> {
height:
15
,
child:
Center
(
child:
SvgPicture
.
asset
(
"assets/
images
/next_button.svg"
,
"assets/
svg
/next_button.svg"
,
),
),
),
...
...
@@ -224,7 +225,7 @@ class _MyHomePageState extends State<MyHomePage> {
// Navigator.push(context, MaterialPageRoute(builder: (context)=>GenTrackerDashboard()));
break
;
case
"Service Engineer"
:
//
Navigator.push(context, MaterialPageRoute(builder: (context)=>
GenTechnicianD
ashboard()));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Serviceengineerd
ashboard
()));
break
;
case
"Nearby"
:
// Navigator.push(context, MaterialPageRoute(builder: (context)=>NearByGeneratorsScreen()));
...
...
@@ -256,7 +257,7 @@ class _MyHomePageState extends State<MyHomePage> {
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/
images
/home_icons_
${index + 1}
.svg"
,
"assets/
svg
/home_icons_
${index + 1}
.svg"
,
),
Text
(
names
[
index
]),
],
...
...
@@ -323,7 +324,7 @@ class _MyHomePageState extends State<MyHomePage> {
height:
25
,
width:
25
,
child:
SvgPicture
.
asset
(
"assets/
images
/scanner.svg"
,
"assets/
svg
/scanner.svg"
,
),
),
],
...
...
lib/screens/WebERPScreen.dart
View file @
b269a97b
...
...
@@ -7,6 +7,7 @@ import 'package:flutter_downloader/flutter_downloader.dart';
import
'package:flutter_inappwebview/flutter_inappwebview.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
import
'dart:math'
;
...
...
@@ -79,33 +80,7 @@ class _WebErpScreenState extends State<WebErpScreen> {
return
true
;
// Allow default back button behavior
},
child:
Scaffold
(
appBar:
AppBar
(
elevation:
0
,
title:
Container
(
child:
Row
(
children:
[
SizedBox
(
width:
10
),
Container
(
child:
InkWell
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"ERP"
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
18
,
)),
),
),
],
)),
titleSpacing:
0
,
leading:
Container
(
width:
10
,
),
leadingWidth:
20
,
),
appBar:
appbar
(
context
,
"Web ERP"
),
body:
Container
(
child:
Column
(
children:
<
Widget
>[
Expanded
(
...
...
Prev
1
2
3
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