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
a5820eb1
Commit
a5820eb1
authored
Aug 07, 2025
by
Sai Srinivas
Browse files
05-08-2025 By Sai Srinivas
Finance Test cases and Order Module - List and Details.
parent
402026c6
Changes
22
Hide whitespace changes
Inline
Side-by-side
assets/svg/order/main_dashboard.png
0 → 100644
View file @
a5820eb1
140 KB
assets/svg/order/payment_history_ic.svg
0 → 100644
View file @
a5820eb1
<svg
width=
"37"
height=
"37"
viewBox=
"0 0 37 37"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<circle
cx=
"18.208"
cy=
"18.208"
r=
"18.208"
fill=
"#E6F6FF"
/>
<g
clip-path=
"url(#clip0_592_4726)"
>
<path
d=
"M26.3123 13.0729C25.9964 11.6469 24.614 10.3405 23.184 10.0631C22.3129 9.8889 19.8826 9.67374 18.2752 9.69146C16.6677 9.67374 14.2374 9.8889 13.3663 10.0631C11.9363 10.3405 10.5539 11.6469 10.238 13.0729C10.0583 13.9388 9.88153 15.1169 9.87891 16.7246C9.88153 18.3327 10.0583 19.5105 10.238 20.3763C10.5539 21.8024 11.9363 23.1087 13.3663 23.3862C13.8366 23.4803 14.7619 23.5863 15.7661 23.661C15.8799 23.8398 16.0032 24.03 16.1367 24.2317C16.6697 25.0389 17.0777 25.6014 17.3867 25.9933C17.9009 26.6456 18.6497 26.6456 19.164 25.9933C19.4729 25.6014 19.8806 25.0389 20.4139 24.2317C20.5474 24.0297 20.6704 23.8398 20.7845 23.661C21.7891 23.5863 22.714 23.4803 23.1847 23.3862C24.6147 23.1087 25.9971 21.8024 26.3129 20.3763C26.4927 19.5105 26.6694 18.3327 26.6721 16.7246C26.6694 15.1165 26.4927 13.9388 26.3129 13.0729H26.3123ZM20.3611 13.1697L20.6766 12.7348C20.8026 12.5613 21.0453 12.5226 21.2191 12.6485C21.3926 12.7745 21.4313 13.0172 21.3053 13.191L20.9898 13.6259C20.9137 13.7305 20.7953 13.7863 20.6753 13.7863C20.5963 13.7863 20.5166 13.7623 20.4477 13.7121C20.2742 13.5862 20.2355 13.3435 20.3614 13.1697H20.3611ZM15.3824 12.6488C15.5559 12.5229 15.7989 12.5616 15.9249 12.7351L16.2407 13.1703C16.3666 13.3438 16.3279 13.5869 16.1544 13.7128C16.0856 13.7627 16.0059 13.7869 15.9268 13.7869C15.8068 13.7869 15.6881 13.7315 15.6123 13.6265L15.2965 13.1913C15.1705 13.0178 15.2092 12.7748 15.3827 12.6488H15.3824ZM14.5811 18.2832L14.0675 18.4495C14.0278 18.4623 13.9875 18.4685 13.9478 18.4685C13.7838 18.4685 13.6316 18.3639 13.5785 18.1999C13.5126 17.9959 13.6244 17.7768 13.8284 17.7109L14.342 17.5446C14.546 17.4783 14.7651 17.5902 14.8311 17.7942C14.897 17.9982 14.7851 18.2173 14.5811 18.2832ZM18.6891 21.2425C18.6891 21.457 18.5152 21.6309 18.3007 21.6309C18.0862 21.6309 17.9124 21.457 17.9124 21.2425V20.7309C17.9124 20.5164 18.0862 20.3426 18.3007 20.3426C18.5152 20.3426 18.6891 20.5164 18.6891 20.7309V21.2425ZM20.8019 17.6377C20.8009 18.2218 20.7881 18.805 20.7632 19.3878C20.7458 19.7443 20.3844 20.0287 20.0662 19.926C19.5444 19.7581 19.0111 19.5715 18.469 19.3734C18.3604 19.3337 18.241 19.3337 18.1322 19.3734C17.59 19.5715 17.057 19.7578 16.5349 19.926C16.2168 20.0287 15.8553 19.7443 15.8379 19.3878C15.8127 18.805 15.8002 18.2215 15.7992 17.6374C15.7992 17.5203 15.7582 17.4045 15.6831 17.3104C15.3089 16.8404 14.938 16.3793 14.5795 15.9339C14.3584 15.6616 14.5116 15.2599 14.8661 15.147C15.4434 14.966 16.0187 14.7817 16.5903 14.6003C16.7051 14.5639 16.8055 14.4898 16.8747 14.3901C17.22 13.8925 17.5618 13.392 17.8901 12.8945C18.0921 12.5882 18.5087 12.5882 18.7107 12.8945C19.039 13.392 19.3808 13.8925 19.7261 14.3901C19.7953 14.4898 19.8957 14.5639 20.0105 14.6003C20.5822 14.7817 21.1574 14.9657 21.7347 15.147C22.0892 15.2599 22.2421 15.6613 22.0213 15.9339C21.6628 16.3793 21.2919 16.8401 20.9177 17.3101C20.8426 17.4042 20.8019 17.52 20.8016 17.6374L20.8019 17.6377ZM23.023 18.1999C22.9698 18.3642 22.8173 18.4685 22.6537 18.4685C22.614 18.4685 22.5736 18.4623 22.534 18.4495L22.0207 18.2832C21.8167 18.2173 21.7048 17.9982 21.7708 17.7942C21.837 17.5902 22.0558 17.4783 22.2598 17.5442L22.7731 17.7105C22.9771 17.7765 23.0889 17.9955 23.023 18.1995V18.1999Z"
fill=
"url(#paint0_linear_592_4726)"
/>
</g>
<defs>
<linearGradient
id=
"paint0_linear_592_4726"
x1=
"9.87891"
y1=
"18.0867"
x2=
"26.6714"
y2=
"18.0867"
gradientUnits=
"userSpaceOnUse"
>
<stop
stop-color=
"#ED6C14"
/>
<stop
offset=
"0.6"
stop-color=
"#FF9045"
/>
<stop
offset=
"1"
stop-color=
"#FFB54A"
/>
</linearGradient>
<clipPath
id=
"clip0_592_4726"
>
<rect
width=
"16.7925"
height=
"16.7925"
fill=
"white"
transform=
"translate(9.87891 9.69043)"
/>
</clipPath>
</defs>
</svg>
assets/svg/order/pending_tasks_ic.svg
0 → 100644
View file @
a5820eb1
<svg
width=
"40"
height=
"40"
viewBox=
"0 0 40 40"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<circle
cx=
"20"
cy=
"20"
r=
"20"
fill=
"white"
/>
<g
clip-path=
"url(#clip0_171_1058)"
>
<path
d=
"M10.2983 16.7082C10.3096 16.6355 10.3217 16.5613 10.3338 16.484L10.3385 16.4559C10.4862 15.5277 10.9803 14.6098 11.7006 13.857C12.4209 13.1043 13.3338 12.5582 14.2713 12.3633C14.4955 12.3168 14.7428 12.2711 15.0088 12.2273C15.0195 12.0237 15.0307 11.8202 15.0424 11.6168C15.0725 11.1016 15.485 10.6402 15.9588 10.5992C16.4326 10.5582 16.801 10.9566 16.783 11.4809C16.7768 11.654 16.7707 11.827 16.7647 11.9996C17.5221 11.925 18.335 11.8738 19.1475 11.8531C19.1475 11.6969 19.1489 11.5418 19.1518 11.3879C19.158 10.859 19.5483 10.4219 20.0229 10.4219C20.4975 10.4219 20.8885 10.8598 20.8944 11.3879C20.8959 11.5441 20.8974 11.6992 20.8987 11.8531C21.7088 11.8738 22.5182 11.9246 23.2729 11.9988C23.2666 11.8262 23.2605 11.6534 23.2545 11.4805C23.2365 10.9559 23.6061 10.5563 24.0787 10.5984C24.5514 10.6406 24.9651 11.1008 24.9951 11.616C25.0069 11.8191 25.0181 12.0224 25.0287 12.2258C25.2983 12.2699 25.549 12.3164 25.7756 12.3633C26.7131 12.5586 27.6248 13.1055 28.3463 13.857C29.0678 14.6086 29.5608 15.5277 29.7084 16.4559L29.7131 16.4844C29.7256 16.5625 29.7373 16.6355 29.7487 16.7082C23.274 16.2301 16.7729 16.2301 10.2983 16.7082ZM30.0225 20.5363C29.9901 22.8898 29.8252 23.6613 29.6342 24.8004C29.6342 24.8102 29.6311 24.8195 29.6291 24.8293C29.4647 25.7621 28.9584 26.6937 28.2362 27.4648C27.5139 28.2359 26.6088 28.8 25.685 29.0098C24.3252 29.3254 22.1057 29.5875 20.0237 29.5785C17.9416 29.5875 15.7217 29.3254 14.3619 29.0098C13.4373 28.8004 12.5342 28.234 11.8108 27.4652C11.0873 26.6965 10.5822 25.7625 10.4178 24.8297C10.4178 24.8203 10.4143 24.8105 10.4127 24.8012C10.2217 23.6613 10.0572 22.891 10.0244 20.5367C10.0162 19.3621 10.0596 18.6336 10.1147 18.0566C16.7061 17.7645 23.3408 17.7645 29.9322 18.0566C29.9877 18.6332 30.0307 19.3621 30.0225 20.5367V20.5363ZM16.4147 23.1105C16.4037 22.2992 15.767 21.6352 14.9873 21.623C14.8036 21.6187 14.6209 21.6519 14.4505 21.7206C14.28 21.7892 14.1253 21.892 13.9959 22.0225C13.8665 22.153 13.7651 22.3085 13.6979 22.4795C13.6306 22.6506 13.599 22.8335 13.6049 23.0172C13.6268 23.7984 14.2768 24.4777 15.0455 24.518C15.8143 24.5582 16.4252 23.9215 16.4147 23.1105ZM21.4862 23.1469C21.4916 22.3285 20.8612 21.668 20.0799 21.6676C19.2987 21.6672 18.669 22.3293 18.6737 23.1477C18.6783 23.966 19.3096 24.6406 20.0799 24.6402C20.8502 24.6398 21.4803 23.9648 21.4862 23.1469ZM26.6369 23.0082C26.6429 22.8248 26.6112 22.6422 26.544 22.4715C26.4768 22.3008 26.3754 22.1456 26.2461 22.0155C26.1167 21.8854 25.9622 21.7831 25.7919 21.7148C25.6215 21.6466 25.4391 21.6139 25.2557 21.6187C24.4744 21.6312 23.8393 22.2945 23.8276 23.1031C23.8158 23.9117 24.426 24.5484 25.1947 24.5059C25.9635 24.4633 26.6151 23.7895 26.6369 23.0082Z"
fill=
"url(#paint0_linear_171_1058)"
/>
<path
d=
"M10.2983 16.7082C10.3096 16.6355 10.3217 16.5613 10.3338 16.484L10.3385 16.4559C10.4862 15.5277 10.9803 14.6098 11.7006 13.857C12.4209 13.1043 13.3338 12.5582 14.2713 12.3633C14.4955 12.3168 14.7428 12.2711 15.0088 12.2273C15.0195 12.0237 15.0307 11.8202 15.0424 11.6168C15.0725 11.1016 15.485 10.6402 15.9588 10.5992C16.4326 10.5582 16.801 10.9566 16.783 11.4809C16.7768 11.654 16.7707 11.827 16.7647 11.9996C17.5221 11.925 18.335 11.8738 19.1475 11.8531C19.1475 11.6969 19.1489 11.5418 19.1518 11.3879C19.158 10.859 19.5483 10.4219 20.0229 10.4219C20.4975 10.4219 20.8885 10.8598 20.8944 11.3879C20.8959 11.5441 20.8974 11.6992 20.8987 11.8531C21.7088 11.8738 22.5182 11.9246 23.2729 11.9988C23.2666 11.8262 23.2605 11.6534 23.2545 11.4805C23.2365 10.9559 23.6061 10.5563 24.0787 10.5984C24.5514 10.6406 24.9651 11.1008 24.9951 11.616C25.0069 11.8191 25.0181 12.0224 25.0287 12.2258C25.2983 12.2699 25.549 12.3164 25.7756 12.3633C26.7131 12.5586 27.6248 13.1055 28.3463 13.857C29.0678 14.6086 29.5608 15.5277 29.7084 16.4559L29.7131 16.4844C29.7256 16.5625 29.7373 16.6355 29.7487 16.7082C23.274 16.2301 16.7729 16.2301 10.2983 16.7082ZM30.0225 20.5363C29.9901 22.8898 29.8252 23.6613 29.6342 24.8004C29.6342 24.8102 29.6311 24.8195 29.6291 24.8293C29.4647 25.7621 28.9584 26.6937 28.2362 27.4648C27.5139 28.2359 26.6088 28.8 25.685 29.0098C24.3252 29.3254 22.1057 29.5875 20.0237 29.5785C17.9416 29.5875 15.7217 29.3254 14.3619 29.0098C13.4373 28.8004 12.5342 28.234 11.8108 27.4652C11.0873 26.6965 10.5822 25.7625 10.4178 24.8297C10.4178 24.8203 10.4143 24.8105 10.4127 24.8012C10.2217 23.6613 10.0572 22.891 10.0244 20.5367C10.0162 19.3621 10.0596 18.6336 10.1147 18.0566C16.7061 17.7645 23.3408 17.7645 29.9322 18.0566C29.9877 18.6332 30.0307 19.3621 30.0225 20.5367V20.5363ZM16.4147 23.1105C16.4037 22.2992 15.767 21.6352 14.9873 21.623C14.8036 21.6187 14.6209 21.6519 14.4505 21.7206C14.28 21.7892 14.1253 21.892 13.9959 22.0225C13.8665 22.153 13.7651 22.3085 13.6979 22.4795C13.6306 22.6506 13.599 22.8335 13.6049 23.0172C13.6268 23.7984 14.2768 24.4777 15.0455 24.518C15.8143 24.5582 16.4252 23.9215 16.4147 23.1105ZM21.4862 23.1469C21.4916 22.3285 20.8612 21.668 20.0799 21.6676C19.2987 21.6672 18.669 22.3293 18.6737 23.1477C18.6783 23.966 19.3096 24.6406 20.0799 24.6402C20.8502 24.6398 21.4803 23.9648 21.4862 23.1469ZM26.6369 23.0082C26.6429 22.8248 26.6112 22.6422 26.544 22.4715C26.4768 22.3008 26.3754 22.1456 26.2461 22.0155C26.1167 21.8854 25.9622 21.7831 25.7919 21.7148C25.6215 21.6466 25.4391 21.6139 25.2557 21.6187C24.4744 21.6312 23.8393 22.2945 23.8276 23.1031C23.8158 23.9117 24.426 24.5484 25.1947 24.5059C25.9635 24.4633 26.6151 23.7895 26.6369 23.0082Z"
fill=
"#ED3424"
/>
<path
d=
"M10.2983 16.7082C10.3096 16.6355 10.3217 16.5613 10.3338 16.484L10.3385 16.4559C10.4862 15.5277 10.9803 14.6098 11.7006 13.857C12.4209 13.1043 13.3338 12.5582 14.2713 12.3633C14.4955 12.3168 14.7428 12.2711 15.0088 12.2273C15.0195 12.0237 15.0307 11.8202 15.0424 11.6168C15.0725 11.1016 15.485 10.6402 15.9588 10.5992C16.4326 10.5582 16.801 10.9566 16.783 11.4809C16.7768 11.654 16.7707 11.827 16.7647 11.9996C17.5221 11.925 18.335 11.8738 19.1475 11.8531C19.1475 11.6969 19.1489 11.5418 19.1518 11.3879C19.158 10.859 19.5483 10.4219 20.0229 10.4219C20.4975 10.4219 20.8885 10.8598 20.8944 11.3879C20.8959 11.5441 20.8974 11.6992 20.8987 11.8531C21.7088 11.8738 22.5182 11.9246 23.2729 11.9988C23.2666 11.8262 23.2605 11.6534 23.2545 11.4805C23.2365 10.9559 23.6061 10.5563 24.0787 10.5984C24.5514 10.6406 24.9651 11.1008 24.9951 11.616C25.0069 11.8191 25.0181 12.0224 25.0287 12.2258C25.2983 12.2699 25.549 12.3164 25.7756 12.3633C26.7131 12.5586 27.6248 13.1055 28.3463 13.857C29.0678 14.6086 29.5608 15.5277 29.7084 16.4559L29.7131 16.4844C29.7256 16.5625 29.7373 16.6355 29.7487 16.7082C23.274 16.2301 16.7729 16.2301 10.2983 16.7082ZM30.0225 20.5363C29.9901 22.8898 29.8252 23.6613 29.6342 24.8004C29.6342 24.8102 29.6311 24.8195 29.6291 24.8293C29.4647 25.7621 28.9584 26.6937 28.2362 27.4648C27.5139 28.2359 26.6088 28.8 25.685 29.0098C24.3252 29.3254 22.1057 29.5875 20.0237 29.5785C17.9416 29.5875 15.7217 29.3254 14.3619 29.0098C13.4373 28.8004 12.5342 28.234 11.8108 27.4652C11.0873 26.6965 10.5822 25.7625 10.4178 24.8297C10.4178 24.8203 10.4143 24.8105 10.4127 24.8012C10.2217 23.6613 10.0572 22.891 10.0244 20.5367C10.0162 19.3621 10.0596 18.6336 10.1147 18.0566C16.7061 17.7645 23.3408 17.7645 29.9322 18.0566C29.9877 18.6332 30.0307 19.3621 30.0225 20.5367V20.5363ZM16.4147 23.1105C16.4037 22.2992 15.767 21.6352 14.9873 21.623C14.8036 21.6187 14.6209 21.6519 14.4505 21.7206C14.28 21.7892 14.1253 21.892 13.9959 22.0225C13.8665 22.153 13.7651 22.3085 13.6979 22.4795C13.6306 22.6506 13.599 22.8335 13.6049 23.0172C13.6268 23.7984 14.2768 24.4777 15.0455 24.518C15.8143 24.5582 16.4252 23.9215 16.4147 23.1105ZM21.4862 23.1469C21.4916 22.3285 20.8612 21.668 20.0799 21.6676C19.2987 21.6672 18.669 22.3293 18.6737 23.1477C18.6783 23.966 19.3096 24.6406 20.0799 24.6402C20.8502 24.6398 21.4803 23.9648 21.4862 23.1469ZM26.6369 23.0082C26.6429 22.8248 26.6112 22.6422 26.544 22.4715C26.4768 22.3008 26.3754 22.1456 26.2461 22.0155C26.1167 21.8854 25.9622 21.7831 25.7919 21.7148C25.6215 21.6466 25.4391 21.6139 25.2557 21.6187C24.4744 21.6312 23.8393 22.2945 23.8276 23.1031C23.8158 23.9117 24.426 24.5484 25.1947 24.5059C25.9635 24.4633 26.6151 23.7895 26.6369 23.0082Z"
fill=
"url(#paint1_linear_171_1058)"
/>
</g>
<defs>
<linearGradient
id=
"paint0_linear_171_1058"
x1=
"21.387"
y1=
"32.6081"
x2=
"6.74923"
y2=
"13.1978"
gradientUnits=
"userSpaceOnUse"
>
<stop
stop-color=
"#498D1E"
/>
<stop
offset=
"1"
stop-color=
"#81C320"
/>
</linearGradient>
<linearGradient
id=
"paint1_linear_171_1058"
x1=
"-1.08928"
y1=
"9.46403"
x2=
"28.8783"
y2=
"27.3076"
gradientUnits=
"userSpaceOnUse"
>
<stop
stop-color=
"#CE7138"
/>
<stop
offset=
"0.6"
stop-color=
"#CE7138"
/>
<stop
offset=
"1"
stop-color=
"#91481B"
/>
</linearGradient>
<clipPath
id=
"clip0_171_1058"
>
<rect
width=
"20"
height=
"20"
fill=
"white"
transform=
"translate(10 10)"
/>
</clipPath>
</defs>
</svg>
lib/Notifiers/VisitDetailsProvider.dart
View file @
a5820eb1
...
@@ -10,6 +10,8 @@ import '../Utils/commonServices.dart';
...
@@ -10,6 +10,8 @@ import '../Utils/commonServices.dart';
class
Visitdetailsprovider
extends
ChangeNotifier
{
class
Visitdetailsprovider
extends
ChangeNotifier
{
bool
_showMoreDetails
=
false
;
CustomerDetails
_customerDetails
=
CustomerDetails
();
CustomerDetails
_customerDetails
=
CustomerDetails
();
GeneratorDetails
_generatorDetails
=
GeneratorDetails
();
GeneratorDetails
_generatorDetails
=
GeneratorDetails
();
ComplaintDetailsNew
_complaintDetailsNew
=
ComplaintDetailsNew
();
ComplaintDetailsNew
_complaintDetailsNew
=
ComplaintDetailsNew
();
...
@@ -21,6 +23,12 @@ class Visitdetailsprovider extends ChangeNotifier{
...
@@ -21,6 +23,12 @@ class Visitdetailsprovider extends ChangeNotifier{
ComplaintDetailsNew
get
complaintDetailsNew
=>
_complaintDetailsNew
;
ComplaintDetailsNew
get
complaintDetailsNew
=>
_complaintDetailsNew
;
List
<
Followuplist
>
get
followUpList
=>
_followupList
;
List
<
Followuplist
>
get
followUpList
=>
_followupList
;
bool
get
isLoading
=>
_isLoading
;
bool
get
isLoading
=>
_isLoading
;
bool
get
showMoreDetails
=>
_showMoreDetails
;
set
showMoreDetails
(
bool
value
){
_showMoreDetails
=
value
;
notifyListeners
();
}
Future
<
void
>
LoadVisitDetailsAPI
(
BuildContext
context
,
ComplaintID
)
async
{
Future
<
void
>
LoadVisitDetailsAPI
(
BuildContext
context
,
ComplaintID
)
async
{
try
{
try
{
...
...
lib/Notifiers/financeProvider/RequesitionLidtDetailsProvider.dart
View file @
a5820eb1
...
@@ -8,6 +8,7 @@ import 'package:generp/Notifiers/HomeScreenNotifier.dart';
...
@@ -8,6 +8,7 @@ import 'package:generp/Notifiers/HomeScreenNotifier.dart';
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:image_picker/image_picker.dart'
;
import
'package:image_picker/image_picker.dart'
;
import
'package:intl/intl.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
import
'approveRejectPaymentRequestResponse.dart'
;
import
'approveRejectPaymentRequestResponse.dart'
;
...
@@ -387,6 +388,14 @@ String? proposedAmountError;
...
@@ -387,6 +388,14 @@ String? proposedAmountError;
notifyListeners
();
notifyListeners
();
return
;
return
;
}
}
final
numberFormat
=
NumberFormat
.
decimalPattern
();
if
(
numberFormat
.
parse
(
approvedAmount
.
text
)
>
numberFormat
.
parse
(
requestedAmount
.
text
)){
ApprovedAmountError
=
"Approved Amount should not be greater than requested amount"
;
return
;
}
else
{
ApprovedAmountError
=
null
;
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
if
(
data
.
error
==
"0"
)
{
if
(
data
.
error
==
"0"
)
{
paymentRequesitionDetails
(
context
,
payment_request_id
);
paymentRequesitionDetails
(
context
,
payment_request_id
);
...
@@ -460,6 +469,17 @@ String? proposedAmountError;
...
@@ -460,6 +469,17 @@ String? proposedAmountError;
}
}
onChangeApprov
(
value
){
final
numberFormat
=
NumberFormat
.
decimalPattern
();
if
(
numberFormat
.
parse
(
approvedAmount
.
text
)
>
numberFormat
.
parse
(
requestedAmount
.
text
)){
ApprovedAmountError
=
"Approved Amount should not be greater than requested amount"
;
}
else
{
ApprovedAmountError
=
null
;
}
notifyListeners
();
}
void
checkDropDownReset
()
{
void
checkDropDownReset
()
{
if
(!
_paymentAccounts
.
contains
(
_selectedPaymentAccounts
)
&&
if
(!
_paymentAccounts
.
contains
(
_selectedPaymentAccounts
)
&&
_selectedPaymentAccounts
!=
null
)
{
_selectedPaymentAccounts
!=
null
)
{
...
...
lib/Notifiers/ordersProvider/pagesDashboardProvider.dart
View file @
a5820eb1
...
@@ -30,6 +30,7 @@ class Pagesdashboardprovider extends ChangeNotifier {
...
@@ -30,6 +30,7 @@ class Pagesdashboardprovider extends ChangeNotifier {
String
?
saleOrderNumberError
;
String
?
saleOrderNumberError
;
String
?
companyNameError
;
String
?
companyNameError
;
List
<
PagesAccessible
>
_ordersAccessiblePagesList
=
[];
List
<
PagesAccessible
>
_ordersAccessiblePagesList
=
[];
List
<
PagesAccessible
>
_ordersAccessiblePagesList2
=
[];
List
<
Employees
>
_employeesList
=
[];
List
<
Employees
>
_employeesList
=
[];
List
<
String
>
_leadStatus
=
[];
List
<
String
>
_leadStatus
=
[];
List
<
OrderList
>
_ordersList
=
[];
List
<
OrderList
>
_ordersList
=
[];
...
@@ -106,6 +107,9 @@ class Pagesdashboardprovider extends ChangeNotifier {
...
@@ -106,6 +107,9 @@ class Pagesdashboardprovider extends ChangeNotifier {
List
<
PagesAccessible
>
get
ordersAccessiblePagesList
=>
List
<
PagesAccessible
>
get
ordersAccessiblePagesList
=>
_ordersAccessiblePagesList
;
_ordersAccessiblePagesList
;
List
<
PagesAccessible
>
get
ordersAccessiblePagesList2
=>
_ordersAccessiblePagesList2
;
List
<
Employees
>
get
employeesList
=>
_employeesList
;
List
<
Employees
>
get
employeesList
=>
_employeesList
;
List
<
OrderList
>
get
ordersList
=>
_ordersList
;
List
<
OrderList
>
get
ordersList
=>
_ordersList
;
...
@@ -270,6 +274,23 @@ class Pagesdashboardprovider extends ChangeNotifier {
...
@@ -270,6 +274,23 @@ class Pagesdashboardprovider extends ChangeNotifier {
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
if
(
data
.
error
==
"0"
)
{
if
(
data
.
error
==
"0"
)
{
_ordersAccessiblePagesList
=
data
.
pagesAccessible
!;
_ordersAccessiblePagesList
=
data
.
pagesAccessible
!;
print
(
data
.
pagesAccessible
!.
map
((
e
)
=>
e
.
pageName
,));
notifyListeners
();
}
else
{}
}
}
catch
(
e
,
s
)
{}
}
Future
<
void
>
ordersAccessibleAddPagesAPIFunction
(
context
)
async
{
try
{
var
provider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
final
data
=
await
ApiCalling
.
ordersAccesibleAddPagesAPI
(
provider
.
empId
,
provider
.
session
,
);
if
(
data
!=
null
)
{
if
(
data
.
error
==
"0"
)
{
_ordersAccessiblePagesList2
=
data
.
pagesAccessible
!;
notifyListeners
();
notifyListeners
();
}
else
{}
}
else
{}
}
}
...
@@ -325,8 +346,9 @@ class Pagesdashboardprovider extends ChangeNotifier {
...
@@ -325,8 +346,9 @@ class Pagesdashboardprovider extends ChangeNotifier {
notifyListeners
();
notifyListeners
();
}
else
{
}
else
{
_isLoading
=
false
;
_isLoading
=
false
;
notifyListeners
();
}
}
notifyListeners
();
}
}
}
catch
(
e
,
s
)
{}
}
catch
(
e
,
s
)
{}
}
}
...
...
lib/screens/commonDateRangeFilter.dart
View file @
a5820eb1
...
@@ -71,7 +71,6 @@ class Commondaterangefilter {
...
@@ -71,7 +71,6 @@ class Commondaterangefilter {
return
[];
return
[];
}
}
// Show bottom sheet with dropdown and custom calendar for Custom
Future
<
Map
<
String
,
dynamic
>?>
showFilterBottomSheet
(
BuildContext
context
)
async
{
Future
<
Map
<
String
,
dynamic
>?>
showFilterBottomSheet
(
BuildContext
context
)
async
{
String
?
tempSelectedValue
=
selectedValue
;
String
?
tempSelectedValue
=
selectedValue
;
DateTimeRange
?
tempSelectedDateRange
=
selectedDateRange
;
DateTimeRange
?
tempSelectedDateRange
=
selectedDateRange
;
...
@@ -81,7 +80,12 @@ class Commondaterangefilter {
...
@@ -81,7 +80,12 @@ class Commondaterangefilter {
return
await
showModalBottomSheet
<
Map
<
String
,
dynamic
>>(
return
await
showModalBottomSheet
<
Map
<
String
,
dynamic
>>(
context:
context
,
context:
context
,
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
backgroundColor:
Colors
.
white
,
enableDrag:
true
,
shape:
RoundedRectangleBorder
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
20
)),
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
20
)),
),
),
...
@@ -402,126 +406,133 @@ class Commondaterangefilter {
...
@@ -402,126 +406,133 @@ class Commondaterangefilter {
],
],
);
);
}
}
return
Padding
(
return
SafeArea
(
padding:
EdgeInsets
.
all
(
16.0
),
child:
Padding
(
child:
SingleChildScrollView
(
padding:
EdgeInsets
.
only
(
child:
Column
(
top:
16
,
mainAxisSize:
MainAxisSize
.
min
,
left:
16
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
right:
16
,
children:
[
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
Text
(
),
'Select Date Range'
,
child:
SingleChildScrollView
(
style:
TextStyle
(
fontSize:
18
,
fontWeight:
FontWeight
.
bold
),
child:
Column
(
),
mainAxisSize:
MainAxisSize
.
min
,
SizedBox
(
height:
16
),
crossAxisAlignment:
CrossAxisAlignment
.
start
,
DropdownButtonHideUnderline
(
children:
[
child:
Row
(
Text
(
children:
[
'Select Date Range'
,
Expanded
(
style:
TextStyle
(
fontSize:
18
,
fontWeight:
FontWeight
.
bold
),
child:
DropdownButton2
<
String
>(
),
isExpanded:
true
,
SizedBox
(
height:
16
),
hint:
Text
(
DropdownButtonHideUnderline
(
tempSelectedValue
??
'Select Item'
,
child:
Row
(
style:
TextStyle
(
children:
[
fontSize:
14
,
Expanded
(
fontWeight:
FontWeight
.
w400
,
child:
DropdownButton2
<
String
>(
color:
Colors
.
black
,
isExpanded:
true
,
hint:
Text
(
tempSelectedValue
??
'Select Item'
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black
,
),
),
),
),
items:
filterItems
.
map
((
String
item
)
{
items:
filterItems
.
map
((
String
item
)
{
return
DropdownMenuItem
<
String
>(
return
DropdownMenuItem
<
String
>(
value:
item
,
value:
item
,
child:
Text
(
child:
Text
(
item
,
item
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
font
Size:
14
,
font
Weight:
FontWeight
.
w400
,
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
black
,
color:
Colors
.
black
,
)
,
),
),
)
,
)
;
);
}).
toList
(),
}).
toList
()
,
value:
tempSelectedValue
,
value:
tempSelectedV
alue
,
onChanged:
(
String
?
v
alue
)
{
onChanged:
(
String
?
value
)
{
if
(
value
==
null
)
return
;
if
(
value
==
null
)
return
;
setState
(()
{
setState
(()
{
tempSelectedValue
=
value
;
tempSelectedV
alue
=
value
;
if
(
v
alue
!
=
'Custom'
)
{
if
(
valu
e
!
=
'Custom'
)
{
tempSelectedDateRang
e
=
getDateRange
(
value
);
tempS
electedDateRange
=
getDateRange
(
value
)
;
tempS
tartDate
=
null
;
temp
Start
Date
=
null
;
temp
End
Date
=
null
;
tempEndDate
=
null
;
}
else
{
}
else
{
tempSelectedDateRange
=
null
;
tempS
electedDateRang
e
=
null
;
tempS
tartDat
e
=
null
;
temp
Start
Date
=
null
;
temp
End
Date
=
null
;
tempEndDate
=
null
;
}
}
}
);
}
);
}
,
}
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
butt
onStyleData:
ddtheme
.
butt
onStyleData
,
ic
onStyleData:
ddtheme
.
ic
onStyleData
,
icon
StyleData:
ddtheme
.
icon
StyleData
,
menuItem
StyleData:
ddtheme
.
menuItem
StyleData
,
menuItem
StyleData:
ddtheme
.
menuItem
StyleData
,
dropdown
StyleData:
ddtheme
.
dropdown
StyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
)
,
),
),
),
],
],
),
),
if
(
tempSelectedValue
==
'Custom'
)
...[
SizedBox
(
height:
16
),
Container
(
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
Colors
.
grey
[
300
]!),
borderRadius:
BorderRadius
.
circular
(
12
),
),
),
padding:
EdgeInsets
.
all
(
12
),
child:
buildCalendar
(),
),
),
if
(
tempSelected
DateRang
e
!
=
null
)
if
(
tempSelected
Valu
e
=
=
'Custom'
)
...[
Padding
(
SizedBox
(
height:
16
),
padding:
const
EdgeInsets
.
only
(
top:
12.0
),
Container
(
child:
Text
(
decoration:
BoxDecoration
(
'Selected:
${formatDate(tempSelectedDateRange!.start)}
to
${formatDate(tempSelectedDateRange!.end)}
'
,
border:
Border
.
all
(
color:
Colors
.
grey
[
300
]!)
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
grey
[
600
]
),
borderRadius:
BorderRadius
.
circular
(
12
),
),
),
padding:
EdgeInsets
.
all
(
12
),
child:
buildCalendar
(),
),
),
],
if
(
tempSelectedDateRange
!=
null
)
SizedBox
(
height:
16
),
Padding
(
Row
(
padding:
const
EdgeInsets
.
only
(
top:
12.0
),
mainAxisAlignment:
MainAxisAlignment
.
end
,
child:
Text
(
children:
[
'Selected:
${formatDate(tempSelectedDateRange!.start)}
to
${formatDate(tempSelectedDateRange!.end)}
'
,
TextButton
(
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
grey
[
600
]),
onPressed:
()
=>
Navigator
.
pop
(
context
),
child:
Text
(
'Cancel'
,
style:
TextStyle
(
color:
Colors
.
grey
[
600
]),
),
),
SizedBox
(
width:
8
),
ElevatedButton
(
onPressed:
tempSelectedDateRange
!=
null
&&
tempSelectedValue
!=
null
?
()
{
selectedValue
=
tempSelectedValue
;
selectedDateRange
=
tempSelectedDateRange
;
Navigator
.
pop
(
context
,
{
'selectedValue'
:
tempSelectedValue
,
'dateRange'
:
tempSelectedDateRange
,
'formatted'
:
getFormattedDateRange
(
tempSelectedDateRange
),
});
}
:
null
,
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
Colors
.
blue
[
600
],
foregroundColor:
Colors
.
white
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
),
),
),
),
child:
Text
(
'Apply'
),
),
],
],
),
SizedBox
(
height:
16
),
SizedBox
(
height:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
),
Row
(
],
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
TextButton
(
onPressed:
()
=>
Navigator
.
pop
(
context
),
child:
Text
(
'Cancel'
,
style:
TextStyle
(
color:
Colors
.
grey
[
600
]),
),
),
SizedBox
(
width:
8
),
ElevatedButton
(
onPressed:
tempSelectedDateRange
!=
null
&&
tempSelectedValue
!=
null
?
()
{
selectedValue
=
tempSelectedValue
;
selectedDateRange
=
tempSelectedDateRange
;
Navigator
.
pop
(
context
,
{
'selectedValue'
:
tempSelectedValue
,
'dateRange'
:
tempSelectedDateRange
,
'formatted'
:
getFormattedDateRange
(
tempSelectedDateRange
),
});
}
:
null
,
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
Colors
.
blue
[
600
],
foregroundColor:
Colors
.
white
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
),
),
child:
Text
(
'Apply'
),
),
],
),
SizedBox
(
height:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
),
],
),
),
),
),
),
);
);
...
...
lib/screens/crm/crmDashboard.dart
View file @
a5820eb1
...
@@ -248,8 +248,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
...
@@ -248,8 +248,9 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
0xFF605C00
,
0xFF605C00
,
0xFF91481B
,
0xFF91481B
,
0xFFED3424
,
0xFFED3424
,
0xFF586000
,
0xFF326D72
,
0xFF326D72
,
0xFF586000
,
];
];
return
InkResponse
(
return
InkResponse
(
...
...
lib/screens/finance/AllPaymentRequesitionListsByModes.dart
View file @
a5820eb1
import
'dart:io'
;
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_slidable/flutter_slidable.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/financeProvider/RequestionListProvider.dart'
;
import
'package:generp/Notifiers/financeProvider/RequestionListProvider.dart'
;
import
'package:generp/Notifiers/financeProvider/approveRejectPaymentRequestResponse.dart'
;
import
'package:generp/Utils/GlobalConstants.dart'
;
import
'package:generp/Utils/GlobalConstants.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/finance/FileViewer.dart'
;
import
'package:generp/screens/finance/FileViewer.dart'
;
import
'package:intl/intl.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Notifiers/financeProvider/RequesitionLidtDetailsProvider.dart'
;
import
'../../Utils/commonServices.dart'
;
import
'../../Utils/commonServices.dart'
;
import
'../../Utils/dropdownTheme.dart'
;
import
'../commonDateRangeFilter.dart'
;
import
'../commonDateRangeFilter.dart'
;
import
'PaymentRequestionListDetails.dart'
;
import
'PaymentRequestionListDetails.dart'
;
...
@@ -33,10 +39,23 @@ class Allpaymentrequesitionlistsbymodes extends StatefulWidget {
...
@@ -33,10 +39,23 @@ class Allpaymentrequesitionlistsbymodes extends StatefulWidget {
class
_AllpaymentrequesitionlistsbymodesState
class
_AllpaymentrequesitionlistsbymodesState
extends
State
<
Allpaymentrequesitionlistsbymodes
>
{
extends
State
<
Allpaymentrequesitionlistsbymodes
>
{
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
10
,
(
index
)
=>
FocusNode
());
Dropdowntheme
ddtheme
=
Dropdowntheme
();
TextEditingController
approvedAmount
=
TextEditingController
();
TextEditingController
remarks
=
TextEditingController
();
TextEditingController
paymentReferenceNumber
=
TextEditingController
();
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
late
Commondaterangefilter
cf
;
late
Commondaterangefilter
cf
;
bool
isLevel1Finalized
=
false
;
bool
isLevel2Finalized
=
false
;
// Final decision on whether to show buttons
bool
shouldShowButtons
=
false
;
final
numberFormat
=
NumberFormat
.
decimalPattern
();
@override
@override
void
initState
()
{
void
initState
()
{
...
@@ -141,19 +160,19 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -141,19 +160,19 @@ class _AllpaymentrequesitionlistsbymodesState
var
text
=
"A"
;
var
text
=
"A"
;
switch
(
value
){
switch
(
value
){
case
'Requested'
:
case
'Requested'
:
return
1
8
.0
;
return
1
6
.0
;
case
'Level 1 Approved'
:
case
'Level 1 Approved'
:
return
1
4
.0
;
return
1
3
.0
;
case
'Level 1 Rejected'
:
case
'Level 1 Rejected'
:
return
1
4
.0
;
return
1
3
.0
;
case
'Level 2 Approved'
:
case
'Level 2 Approved'
:
return
1
4
.0
;
return
1
3
.0
;
case
'Level 2 Rejected'
:
case
'Level 2 Rejected'
:
return
1
4
.0
;
return
1
3
.0
;
case
'Processed'
:
case
'Processed'
:
return
1
8
.0
;
return
1
6
.0
;
case
'Payment Rejected'
:
case
'Payment Rejected'
:
return
1
8
.0
;
return
1
6
.0
;
}
}
return
18.0
;
return
18.0
;
...
@@ -195,9 +214,59 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -195,9 +214,59 @@ class _AllpaymentrequesitionlistsbymodesState
:
NoNetwork
(
context
);
:
NoNetwork
(
context
);
}
}
bool
shouldShowSwipeButtons
(
status
){
isLevel1Finalized
=
[
"Level 1 Approved"
,
"Level 1 Rejected"
,
"Level 1 approved"
,
"Level 1 rejected"
,
].
contains
(
status
);
isLevel2Finalized
=
[
"Level 2 Approved"
,
"Level 2 Rejected"
,
"Level 2 approved"
,
"Level 2 rejected"
,
].
contains
(
status
);
if
(
widget
.
mode
==
"apr_lvl1"
)
{
shouldShowButtons
=
!
isLevel1Finalized
;
}
else
if
(
widget
.
mode
==
"apr_lvl2"
)
{
shouldShowButtons
=
!
isLevel2Finalized
&&
[
"Requested"
,
"Level 1 Approved"
,
"Level 1 approved"
,
].
contains
(
status
);
}
else
if
(
widget
.
mode
==
"process"
)
{
shouldShowButtons
=
[
"Level 2 Approved"
,
"Level 2 approved"
,
].
contains
(
status
);
}
else
if
(
widget
.
mode
==
"self_apr_lvl2"
)
{
shouldShowButtons
=
[
"Requested"
].
contains
(
status
);
}
return
shouldShowButtons
;
}
Widget
_scaffold
(
BuildContext
context
)
{
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Requestionlistprovider
>(
// isLevel1Finalized = [
builder:
(
context
,
provider
,
child
)
{
// "Level 1 Approved",
// "Level 1 Rejected",
// "Level 1 approved",
// "Level 1 rejected",
// ].contains(req_det.status);
//
// isLevel2Finalized = [
// "Level 2 Approved",
// "Level 2 Rejected",
// "Level 2 approved",
// "Level 2 rejected",
// ].contains(req_det.status);
return
Consumer2
<
Requestionlistprovider
,
Requesitionlidtdetailsprovider
>(
builder:
(
context
,
provider
,
detailsProvider
,
child
)
{
final
requestLists
=
provider
.
requisitionList
;
final
requestLists
=
provider
.
requisitionList
;
return
Scaffold
(
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
...
@@ -272,6 +341,7 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -272,6 +341,7 @@ class _AllpaymentrequesitionlistsbymodesState
shrinkWrap:
true
,
shrinkWrap:
true
,
physics:
AlwaysScrollableScrollPhysics
(),
physics:
AlwaysScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
itemBuilder:
(
context
,
index
)
{
shouldShowSwipeButtons
(
requestLists
[
index
].
status
);
if
(
requestLists
.
isEmpty
)
{
if
(
requestLists
.
isEmpty
)
{
return
SizedBox
(
return
SizedBox
(
child:
Center
(
child:
Text
(
"No Data Available"
)),
child:
Center
(
child:
Text
(
"No Data Available"
)),
...
@@ -306,10 +376,7 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -306,10 +376,7 @@ class _AllpaymentrequesitionlistsbymodesState
}
}
},
},
child:
Container
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
horizontal:
10
,
vertical:
5
,
vertical:
5
,
...
@@ -318,79 +385,176 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -318,79 +385,176 @@ class _AllpaymentrequesitionlistsbymodesState
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
),
child:
Column
(
child:
ClipRRect
(
children:
[
borderRadius:
BorderRadius
.
circular
(
20
),
Row
(
child:
Slidable
(
children:
[
startActionPane:
shouldShowButtons
?
ActionPane
(
Expanded
(
motion:
const
ScrollMotion
(),
flex:
1
,
dragDismissible:
false
,
child:
Container
(
// dismissible: DismissiblePane(onDismissed: () {}),
height:
50
,
width:
50
,
children:
[
padding:
EdgeInsets
.
all
(
8.0
),
if
(
shouldShowButtons
&&
![
"admin"
,
"self"
].
contains
(
widget
.
mode
))...[
decoration:
BoxDecoration
(
SlidableAction
(
color:
getDecorationColor
(
requestLists
[
index
].
status
),
onPressed:
(
context
)
{
shape:
BoxShape
.
circle
),
_showLevelRejectionSheet
(
child:
Center
(
context
,
child:
Text
(
requestLists
[
index
].
id
,
getText
(
requestLists
[
index
].
status
),
);
style:
TextStyle
(
},
color:
getTextColor
(
requestLists
[
index
].
status
),
backgroundColor:
Color
(
0xFFFFE5E5
),
fontSize:
getSize
(
requestLists
[
index
].
status
),
foregroundColor:
Color
(
0xFFEF3739
),
fontFamily:
"JakartaBold"
icon:
Icons
.
clear
,
label:
'Reject'
,
),
],
if
(
widget
.
mode
==
"process"
)...[
SlidableAction
(
onPressed:
(
context
)
{
detailsProvider
.
approveRejectPaymentRequestAPIFunction
(
context
,
requestLists
[
index
].
id
,
);
detailsProvider
.
preValues
();
_showAddPaymentSheet
(
context
,
requestLists
[
index
].
id
,
);
},
backgroundColor:
Color
(
0xFFFFF8E5
),
foregroundColor:
Color
(
0xFFFFB600
),
icon:
Icons
.
add
,
label:
'Add Payment'
,
),
],
],
):
null
,
endActionPane:
shouldShowButtons
?
ActionPane
(
motion:
const
ScrollMotion
(),
key:
ValueKey
(
requestLists
[
index
].
id
),
dragDismissible:
false
,
// dismissible: DismissiblePane(
//
// onDismissed: () {},
// closeOnCancel: true,
// resizeDuration: Duration(milliseconds: 300),),
children:
[
if
([
"apr_lvl1"
,
"apr_lvl2"
,
"self_apr_lvl2"
,
].
contains
(
widget
.
mode
))...[
SlidableAction
(
onPressed:
(
context
)
{
detailsProvider
.
paymentRequesitionDetails
(
context
,
requestLists
[
index
].
id
);
detailsProvider
.
preValues
();
detailsProvider
.
approveRejectPaymentRequestAPIFunction
(
context
,
requestLists
[
index
].
id
,
);
_showLevelApprovalSheet
(
context
,
requestLists
[
index
].
id
,
);
},
backgroundColor:
Color
(
0xFFE9FFE8
),
foregroundColor:
Color
(
0xFF4CB443
),
icon:
Icons
.
check
,
label:
'Approve'
,
),
],
],
):
null
,
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Column
(
children:
[
Row
(
children:
[
Expanded
(
flex:
1
,
child:
Container
(
height:
50
,
width:
50
,
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
color:
getDecorationColor
(
requestLists
[
index
].
status
),
shape:
BoxShape
.
circle
),
child:
Center
(
child:
Text
(
getText
(
requestLists
[
index
].
status
),
style:
TextStyle
(
color:
getTextColor
(
requestLists
[
index
].
status
),
fontSize:
getSize
(
requestLists
[
index
].
status
),
fontFamily:
"JakartaBold"
),
),
),
),
),
),
),
),
SizedBox
(
width:
10
),
),
Expanded
(
),
flex:
4
,
SizedBox
(
width:
10
),
child:
SizedBox
(
Expanded
(
child:
Column
(
flex:
4
,
crossAxisAlignment:
child:
SizedBox
(
CrossAxisAlignment
.
start
,
child:
Column
(
children:
[
crossAxisAlignment:
Text
(
CrossAxisAlignment
.
start
,
requestLists
[
index
]
children:
[
.
accountName
!,
Text
(
maxLines:
1
,
requestLists
[
index
]
overflow:
TextOverflow
.
ellipsis
,
.
accountName
!,
style:
TextStyle
(
maxLines:
1
,
fontFamily:
"JakartaRegular"
,
overflow:
TextOverflow
.
ellipsis
,
fontSize:
14
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaRegular"
,
),
fontSize:
14
,
),
color:
AppColors
.
semi_black
,
Text
(
"
${requestLists[index].date}
"
,
style:
TextStyle
(
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
],
),
),
),
),
Text
(
),
"
${requestLists[index].date}
"
,
Expanded
(
flex:
3
,
child:
Text
(
maxLines:
1
,
"₹
${requestLists[index].amount!}
"
,
textAlign:
TextAlign
.
right
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
"Jakarta
Regular
"
,
fontFamily:
"Jakarta
Medium
"
,
fontSize:
14
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
),
),
),
),
],
),
),
],
),
),
Expanded
(
flex:
3
,
child:
Text
(
maxLines:
1
,
"₹
${requestLists[index].amount!}
"
,
textAlign:
TextAlign
.
right
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
),
)
,
]
,
]
,
)
,
),
),
]
,
)
,
),
),
),
),
);
);
...
@@ -494,4 +658,979 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -494,4 +658,979 @@ class _AllpaymentrequesitionlistsbymodesState
},
},
);
);
}
}
Future
<
void
>
_showLevelApprovalSheet
(
BuildContext
context
,
paymentID
)
{
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
<
Requesitionlidtdetailsprovider
>(
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
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
if
(
widget
.
mode
==
"apr_lvl1"
)
...[
Align
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Level 1 Approval"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
]
else
if
(
widget
.
mode
==
"apr_lvl2"
)
...[
Align
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Level 2 Approval"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
],
textControllerWidget
(
context
,
provider
.
requestedAmount
,
"Requested Amount"
,
"Enter Requested Amount"
,
(
p0
)
{},
TextInputType
.
numberWithOptions
(),
true
,
null
,
null
,
null
,
null
,
),
textControllerWidget
(
context
,
provider
.
approvedAmount
,
"Approved Amount"
,
"Enter Approved Amount"
,
(
p0
)
{
provider
.
onChangeApprov
(
p0
);
},
TextInputType
.
numberWithOptions
(),
false
,
null
,
focusNodes
[
0
],
focusNodes
[
1
],
TextInputAction
.
next
,
),
if
(
provider
.
ApprovedAmountError
!=
null
)...[
errorWidget
(
context
,
provider
.
ApprovedAmountError
),
],
textControllerWidget
(
context
,
remarks
,
"Remarks"
,
"Enter Remarks"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
null
,
focusNodes
[
1
],
null
,
TextInputAction
.
done
,
),
errorWidget
(
context
,
provider
.
remarksError
),
TextWidget
(
context
,
"Proposed Payment Account"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
PaymentAccounts
>(
isExpanded:
true
,
hint:
Text
(
'Select Payment Account'
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
paymentsAccounts
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
PaymentAccounts
>(
value:
paymenents
,
child:
Text
(
paymenents
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedPaymentAccounts
,
onChanged:
(
PaymentAccounts
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
paymentsAccounts
.
isNotEmpty
)
{
provider
.
selectedPaymentAccounts
=
value
;
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
provider
.
selectedID
=
value
.
id
!;
provider
.
selectedValue
=
value
.
name
!;
print
(
"hfjkshfg"
+
provider
.
selectedID
.
toString
(),
);
}
}
},
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
paymentAccountSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
paymentAccountSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
},
// Optional: clear search text when dropdown closes
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
provider
.
paymentAccountSearchController
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
InkWell
(
onTap:
()
{
provider
.
paymentrequisitionApproveSubmitAPIFunction
(
context
,
widget
.
mode
,
paymentID
,
provider
.
approvedAmount
.
text
,
remarks
.
text
,
provider
.
selectedID
,
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
///approve
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
],
),
),
);
},
),
);
},
);
},
).
whenComplete
(()
{
print
(
"closing Sheet"
);
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
);
final
detailsprov
=
Provider
.
of
<
Requesitionlidtdetailsprovider
>(
context
,
listen:
false
);
detailsprov
.
resetAll
();
provider
.
paymentRequestionListsAPIFunction
(
context
,
widget
.
mode
,
""
,
""
);
});
},);
}
Future
<
void
>
_showLevelRejectionSheet
(
BuildContext
context
,
paymentID
)
{
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
<
Requesitionlidtdetailsprovider
>(
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
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
if
(
widget
.
mode
==
"apr_lvl1"
)
...[
Align
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Level 1 Rejection"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
]
else
if
(
widget
.
mode
==
"apr_lvl2"
)
...[
Align
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Level 2 Rejection"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
],
textControllerReadonlyWidget
(
context
,
provider
.
requestedAmount
,
"Requested Amount"
,
(
p0
)
{},
),
textControllerWidget
(
context
,
remarks
,
"Remarks"
,
"Enter Remarks"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
null
,
focusNodes
[
2
],
null
,
TextInputAction
.
done
,
),
errorWidget
(
context
,
provider
.
remarksError
),
InkWell
(
onTap:
()
{
provider
.
paymentrequisitionRejectSubmitAPIFunction
(
context
,
widget
.
mode
,
paymentID
,
remarks
.
text
,
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
///reject
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
],
),
),
);
},
),
);
},
);
},
).
whenComplete
(()
{
print
(
"closing Sheet"
);
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
);
final
detailsprov
=
Provider
.
of
<
Requesitionlidtdetailsprovider
>(
context
,
listen:
false
);
detailsprov
.
resetAll
();
provider
.
paymentRequestionListsAPIFunction
(
context
,
widget
.
mode
,
""
,
""
);
});
},);
}
Future
<
void
>
_showAddPaymentSheet
(
BuildContext
context
,
paymentID
)
{
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
<
Requesitionlidtdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
// Fallback UI if provider data is not ready
if
(
provider
.
paymentsAccounts
==
null
)
{
return
Center
(
child:
CircularProgressIndicator
());
}
return
Container
(
// Constrain the height to avoid overflow
constraints:
BoxConstraints
(
maxHeight:
MediaQuery
.
of
(
context
).
size
.
height
*
0.8
,
),
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
child:
Column
(
children:
[
// Scrollable content
Expanded
(
child:
SingleChildScrollView
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Row
(
children:
[
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Align
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Add Approval"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
textControllerReadonlyWidget
(
context
,
provider
.
proposedPaymentAccount
,
"Enter Proposed Payment Account"
,
(
p0
)
{},
),
TextWidget
(
context
,
"Payment Account"
,
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
PaymentAccounts
>(
isExpanded:
true
,
hint:
Text
(
'Select Account'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
paymentsAccounts
.
map
(
(
paymenents
,
)
=>
DropdownMenuItem
<
PaymentAccounts
>(
value:
paymenents
,
child:
Text
(
paymenents
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedPaymentAccounts
,
onChanged:
(
PaymentAccounts
?
value
,
)
{
if
(
value
!=
null
&&
provider
.
paymentsAccounts
.
isNotEmpty
)
{
setState
(()
{
provider
.
selectedPaymentAccounts
=
value
;
provider
.
selectedID
=
value
.
id
!;
provider
.
selectedValue
=
value
.
name
!;
print
(
"Selected Account:
${value.name}
, ID:
${value.id}
"
,
);
});
}
},
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
paymentAccountSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
,
),
child:
TextFormField
(
controller:
provider
.
paymentAccountSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
,
)
{
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
},
),
onMenuStateChange:
(
isOpen
,
)
{
if
(!
isOpen
)
{
provider
.
paymentAccountSearchController
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
textControllerReadonlyWidget
(
context
,
provider
.
approvedAmountReadonly
,
"Approved Amount"
,
(
p0
)
{},
),
textControllerWidget
(
context
,
provider
.
approvedAmount
,
"Payment Amount"
,
"Enter Payment Amount"
,
(
p0
)
{
if
(
numberFormat
.
parse
(
provider
.
approvedAmountReadonly
.
text
,
)
<
numberFormat
.
parse
(
provider
.
approvedAmount
.
text
,
))
{
provider
.
proposedAmountError
=
"Amount should not be greater than Approved amount"
;
}
else
{
provider
.
proposedAmountError
=
""
;
}
},
TextInputType
.
numberWithOptions
(),
false
,
null
,
),
errorWidget
(
context
,
provider
.
proposedAmountError
,
),
textControllerWidget
(
context
,
paymentReferenceNumber
,
"Enter Payment Reference Number"
,
"Payment Reference Number"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
,
),
textControllerWidget
(
context
,
remarks
,
"Remarks"
,
"Enter Remarks"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
null
,
focusNodes
[
4
],
null
,
TextInputAction
.
done
,
),
InkResponse
(
onTap:
()
{
_showAttachmentSheet
(
context
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
,
),
height:
45
,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
),
),
child:
Center
(
child:
Text
(
"Add Attachment"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
),
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
,
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
),
),
InkResponse
(
onTap:
()
{
setState
(()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
});
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
],
),
),
],
textControllerReadonlyWidget
(
context
,
provider
.
accountName
,
"Enter Account Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
branch
,
"Enter Branch Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
requestingPurpose
,
"Enter Requesting Purpose"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
description
,
"Enter Description"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
amount
,
"Enter Amount"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
paymentMode
,
"Enter Payment Mode"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankHolderName
,
"Bank Account Holder Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankAccountNumber
,
"Bank Account Number"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankName
,
"Bank Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankBranchName
,
"Bank Branch Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankIfscCode
,
"Bank IFSC Code"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankUpiID
,
"Bank UPI ID"
,
(
p0
)
{},
),
],
),
),
],
),
],
),
),
),
),
// Sticky Submit Button
Padding
(
padding:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
child:
InkWell
(
onTap:
()
{
provider
.
paymentrequisitionProcessSubmitAPIFunction
(
context
,
widget
.
mode
,
paymentReferenceNumber
.
text
,
provider
.
approvedAmount
.
text
,
paymentID
,
provider
.
selectedID
,
remarks
.
text
,
provider
.
imagePath
,
);
},
child:
Container
(
height:
45
,
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
),
],
),
);
},
),
);
},
);
},
).
whenComplete
(()
{
print
(
"closing Sheet"
);
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
);
final
detailsprov
=
Provider
.
of
<
Requesitionlidtdetailsprovider
>(
context
,
listen:
false
);
detailsprov
.
resetAll
();
provider
.
paymentRequestionListsAPIFunction
(
context
,
widget
.
mode
,
""
,
""
);
});
},);
}
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
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
<
Requesitionlidtdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
,
).
viewInsets
.
bottom
,
// This handles keyboard
),
child:
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
"Select Source"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
SizedBox
(
height:
15
),
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromGallery
(
context
);
},
child:
Container
(
height:
35
,
child:
Text
(
"Select photo from gallery"
),
),
),
SizedBox
(
height:
10
),
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromCamera
(
context
);
},
child:
Container
(
height:
35
,
child:
Text
(
"Capture photo from camera"
),
),
),
],
),
),
),
);
},
),
);
},
);
},
);
}
}
}
lib/screens/finance/PaymentRequestionListDetails.dart
View file @
a5820eb1
...
@@ -1300,10 +1300,12 @@ class _PaymentrequestionlistdetailsState
...
@@ -1300,10 +1300,12 @@ class _PaymentrequestionlistdetailsState
),
),
textControllerWidget
(
textControllerWidget
(
context
,
context
,
approvedAmount
,
provider
.
approvedAmount
,
"Approved Amount"
,
"Approved Amount"
,
"Enter Approved Amount"
,
"Enter Approved Amount"
,
(
p0
)
{},
(
p0
)
{
provider
.
onChangeApprov
(
p0
);
},
TextInputType
.
numberWithOptions
(),
TextInputType
.
numberWithOptions
(),
false
,
false
,
null
,
null
,
...
@@ -1437,7 +1439,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -1437,7 +1439,7 @@ class _PaymentrequestionlistdetailsState
context
,
context
,
widget
.
mode
,
widget
.
mode
,
paymentID
,
paymentID
,
approvedAmount
.
text
,
provider
.
approvedAmount
.
text
,
remarks
.
text
,
remarks
.
text
,
provider
.
selectedID
,
provider
.
selectedID
,
);
);
...
...
lib/screens/finance/submitPaymentRequestionListsByMode.dart
View file @
a5820eb1
...
@@ -645,6 +645,7 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -645,6 +645,7 @@ class _SubmitpaymentrequestionlistsbymodeState
"IMPS"
,
"IMPS"
,
"NEFT"
,
"NEFT"
,
].
contains
(
provider
.
paymentModeValue
))
...[
].
contains
(
provider
.
paymentModeValue
))
...[
SizedBox
(
height:
3
,
key:
_globalKey
),
SizedBox
(
height:
3
,
key:
_globalKey
),
textControllerWidget
(
textControllerWidget
(
context
,
context
,
...
@@ -727,7 +728,8 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -727,7 +728,8 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction
.
done
,
TextInputAction
.
done
,
),
),
errorWidget
(
context
,
provider
.
bankHolderError
),
errorWidget
(
context
,
provider
.
bankHolderError
),
]
else
if
(
provider
.
paymentModeValue
==
"UPI"
)
...[
],
if
(
provider
.
paymentModeValue
==
"UPI"
)
...[
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankUpiController
,
provider
.
bankUpiController
,
...
...
lib/screens/order/orderDetailsFeedbackHistory.dart
View file @
a5820eb1
...
@@ -62,13 +62,13 @@ class _OrderdetailsfeedbackhistoryState extends State<Orderdetailsfeedbackhistor
...
@@ -62,13 +62,13 @@ class _OrderdetailsfeedbackhistoryState extends State<Orderdetailsfeedbackhistor
),
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
6
,
(
j
)
{
children:
List
.
generate
(
5
,
(
j
)
{
final
textheads
=
[
final
textheads
=
[
"
<th>
Employee
</th>
"
,
"Employee"
,
"
<th>
Feedback
</th>
"
,
"Feedback"
,
"
<th>
Attachment
</th>
"
,
"Attachment"
,
"
<th>
Status
</th>
"
,
"Status"
,
"
<th>Date</th>
"
,
"
Date
"
,
];
];
final
textSubheads
=
[
final
textSubheads
=
[
"
${feedbackHistory[index].employeNaem}
"
,
"
${feedbackHistory[index].employeNaem}
"
,
...
...
lib/screens/order/orderModuleDashboard.dart
View file @
a5820eb1
...
@@ -7,6 +7,7 @@ import 'package:flutter_svg/svg.dart';
...
@@ -7,6 +7,7 @@ import 'package:flutter_svg/svg.dart';
import
'package:generp/screens/screensExports.dart'
;
import
'package:generp/screens/screensExports.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Notifiers/ordersProvider/pagesDashboardProvider.dart'
;
import
'../../Notifiers/ordersProvider/pagesDashboardProvider.dart'
;
import
'../../Utils/GlobalConstants.dart'
show
routeSettingName
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonServices.dart'
;
import
'../../Utils/commonServices.dart'
;
import
'../../Utils/commonWidgets.dart'
;
import
'../../Utils/commonWidgets.dart'
;
...
@@ -38,6 +39,7 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
...
@@ -38,6 +39,7 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
);
);
provider
.
orderDashboardAPIFunction
(
context
,
"executive"
,
""
,
""
,
""
);
provider
.
orderDashboardAPIFunction
(
context
,
"executive"
,
""
,
""
,
""
);
provider
.
ordersAccessiblePagesAPIFunction
(
context
);
provider
.
ordersAccessiblePagesAPIFunction
(
context
);
provider
.
ordersAccessibleAddPagesAPIFunction
(
context
);
});
});
}
}
...
@@ -76,6 +78,285 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
...
@@ -76,6 +78,285 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
}
}
Widget
_scaffold
(
BuildContext
context
)
{
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Pagesdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
pages
=
provider
.
ordersAccessiblePagesList
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbarNew
(
context
,
"Orders"
,
0xFFFFFFFF
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
16
))
),
child:
Column
(
children:
[
Container
(
height:
180
,
decoration:
BoxDecoration
(
image:
DecorationImage
(
image:
AssetImage
(
"assets/svg/order/main_dashboard.png"
,
),
fit:
BoxFit
.
contain
,),
gradient:
LinearGradient
(
colors:
[
AppColors
.
scaffold_bg_color
,
AppColors
.
scaffold_bg_color
],
begin:
Alignment
.
topCenter
,
end:
Alignment
.
bottomCenter
)
),
),
if
(
provider
.
ordersgain
.
length
>
0
)
...[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
only
(
bottom:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
16
),
),
),
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.25
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
),
itemCount:
provider
.
ordersgain
.
length
,
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
physics:
AlwaysScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
55
/
100
,
),
itemBuilder:
(
context
,
jndex
)
{
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
final
leadTitles
=
[
'Order Gain'
,
'Dispatched'
,
'Pending Tasks'
,
'Quotation Generated'
,
];
final
assetNames
=
[
"assets/svg/crm/open_leads_ic.svg"
,
"assets/svg/crm/today_visits_ic.svg"
,
"assets/svg/crm/pending_tasks_ic.svg"
,
"assets/svg/crm/quotes_generated_ic.svg"
,
];
final
colors
=
[
0xFFE7FFE5
,
0xFFFFFCD5
,
0xFFEEF1FF
,
0xFFF3EDFF
,
];
final
textcolors
=
[
0xFF0D9C00
,
0xFF605C00
,
0xFF6563FF
,
0xFF493272
,
];
return
InkResponse
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
color:
Color
(
colors
[
jndex
]),
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
provider
.
ordersgain
[
jndex
].
count
.
toString
(),
style:
TextStyle
(
fontSize:
20
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
jndex
]),
),
),
Row
(
children:
[
Expanded
(
flex:
3
,
child:
Text
(
leadTitles
[
jndex
],
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaRegular"
,
color:
AppColors
.
semi_black
,
),
),
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
assetNames
[
jndex
],
),
),
],
),
],
),
),
);
},
),
),
],
],
),
),
ListView
.
builder
(
itemCount:
provider
.
ordersAccessiblePagesList
.
length
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
Widget
?
SvgIcon
;
switch
(
pages
[
index
].
mode
)
{
case
"level_one_approval"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
);
break
;
case
"level_two_approval"
:
case
"level_two_rejected"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv2.svg"
);
break
;
default
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
break
;
}
;
return
InkResponse
(
onTap:
()
async
{
var
navigate
;
if
(
pages
[
index
].
pageName
!.
contains
(
"Add Order"
))
{
navigate
=
AddorderScreen
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
].
pageName
!,
);
}
if
(
pages
[
index
].
pageName
!.
contains
(
"Add Payment"
))
{
(
"navigate to Add Payment"
);
navigate
=
AddpaymentScreen
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
].
pageName
!,
);
}
else
if
(
pages
[
index
].
pageName
!.
contains
(
"Receipt List"
,
))
{
navigate
=
Paymentlistsbymode
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
].
pageName
!,
);
}
else
if
(
pages
[
index
].
pageName
!.
contains
(
"Order List"
,
))
{
navigate
=
OrderslistbyModes
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
].
pageName
!,
);
}
else
if
(
pages
[
index
].
pageName
==
"Add TPC Agent"
)
{
navigate
=
AddtpcagentScreen
();
}
else
if
(
pages
[
index
].
pageName
==
"TPC Agent List (Admin)"
)
{
navigate
=
Tpcagentlistbymode
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
].
pageName
!,
);
}
else
if
(
pages
[
index
].
pageName
==
"Pending TPC Issue List"
)
{
navigate
=
Tpcagentissuelist
(
mode:
pages
[
index
].
mode
!,
pageTitleName:
pages
[
index
].
pageName
!,
);
}
if
(
navigate
!=
null
)
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
navigate
),
);
}
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Row
(
children:
[
Expanded
(
flex:
1
,
child:
SvgIcon
),
Expanded
(
flex:
5
,
child:
Text
(
"
${pages[index].pageName}
"
),
),
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
],
),
),
);
},
),
SizedBox
(
height:
75
,)
],
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkResponse
(
onTap:
()
{
_showPaymentOptionsSheet
(
context
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
Text
(
"Add"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
);
},
);
}
Widget
_scaffold1
(
BuildContext
context
)
{
return
Consumer
<
Pagesdashboardprovider
>(
return
Consumer
<
Pagesdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
final
pages
=
provider
.
ordersAccessiblePagesList
;
final
pages
=
provider
.
ordersAccessiblePagesList
;
...
@@ -297,6 +578,189 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
...
@@ -297,6 +578,189 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
),
),
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkResponse
(
onTap:
()
{
_showPaymentOptionsSheet
(
context
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
Text
(
"Add"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
);
},
);
}
Future
<
void
>
_showPaymentOptionsSheet
(
BuildContext
context
)
{
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
<
Pagesdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
pages2
=
provider
.
ordersAccessiblePagesList2
;
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
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SizedBox
(
height:
15
),
...
List
.
generate
(
pages2
.
length
,
(
index
)
{
print
(
pages2
[
index
].
mode
);
return
ListTile
(
onTap:
()
async
{
var
res
;
if
(
pages2
[
index
]
.
pageName
!.
contains
(
"Add Order"
))
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
AddorderScreen
(
mode:
pages2
[
index
].
mode
!,
pageTitleName:
pages2
[
index
].
pageName
!,
),
settings:
RouteSettings
(
name:
"AddorderScreen"
,
),
),
);
}
else
if
(
pages2
[
index
].
pageName
!.
contains
(
"Add Receipt"
))
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AddpaymentScreen
(
mode:
pages2
[
index
].
mode
!,
pageTitleName:
pages2
[
index
].
pageName
!,
),
settings:
RouteSettings
(
name:
"AddpaymentScreen"
,
),
),
);
}
else
if
(
pages2
[
index
].
pageName
==
"Add TPC Agent"
)
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AddtpcagentScreen
(),
settings:
RouteSettings
(
name:
"AddtpcagentScreen"
,
),
),
);
}
else
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Submitpaymentrequestionlistsbymode
(
mode:
"
${pages2[index].mode}
"
,
pageTitleName:
"
${pages2[index].pageName}
"
,
),
settings:
RouteSettings
(
name:
"Submitpaymentrequestionlistsbymode"
,
),
),
);
}
// switch (routeSettingName) {
// case "Submitpaymentrequestionlistsbymode":
// print("here");
// Provider.of<Requestionlistprovider>(
// context,
// listen: false,
// ).resetForm();
// break;
// case "Addcommonpayment":
// Provider.of<Accountslistprovider>(
// context,
// listen: false,
// ).resetValues();
// break;
// case "Addpaymentreceiptlist":
// Provider.of<Paymentreceiptsprovider>(
// context,
// listen: false,
// ).resetForm();
// break;
// case "Directpaymentrequesitionlist":
// Provider.of<Requestionlistprovider>(
// context,
// listen: false,
// ).resetForm();
// break;
// }
Navigator
.
pop
(
context
);
},
leading:
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
,
),
title:
Text
(
"
${pages2[index].pageName}
"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaMedium"
,
),
),
trailing:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
);
}),
],
),
),
);
},
),
);
},
);
);
},
},
);
);
...
...
lib/screens/order/ordersDetailsByModes.dart
View file @
a5820eb1
import
'dart:io'
;
import
'dart:io'
;
import
'package:dotted_line/dotted_line.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
...
@@ -66,6 +67,95 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
...
@@ -66,6 +67,95 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
});
});
}
}
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
@override
void
dispose
()
{
void
dispose
()
{
// TODO: implement dispose
// TODO: implement dispose
...
@@ -86,164 +176,374 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
...
@@ -86,164 +176,374 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
connection
==
"Online"
return
(
connection
==
"Online"
)
?
Consumer2
<
Pagesdashboardprovider
,
Dispatchorderprovider
>(
?
Platform
.
isAndroid
builder:
(
context
,
provider
,
disProvider
,
child
)
{
?
WillPopScope
(
var
orderDetails
=
provider
.
orderDetails
;
onWillPop:
()
async
{
Provider
.
of
<
Pagesdashboardprovider
>(
var
Headings1
=
[
context
,
"Order Number"
,
listen:
false
,
"Account Name"
,
).
resetForm
();
"Sales Person Name"
,
Provider
.
of
<
Dispatchorderprovider
>(
"Order Received Date"
,
context
,
];
listen:
false
,
var
subHeadings1
=
[
).
resetForm
();
provider
.
orderDetails
.
orderNumber
??
"-"
,
provider
.
orderDetails
.
accountName
??
"-"
,
return
onBackPressed
(
context
);
provider
.
orderDetails
.
salesPersonEmpName
??
"-"
,
},
provider
.
orderDetails
.
orderReceivedDate
??
"-"
,
];
var
Headings2
=
[
"Billing State"
,
"Billing District"
,
"Billing Sub Location"
,
"Billing Pincode"
,
"Billing Address"
,
"Entered By"
,
"Dispatch State"
,
"Dispatch District"
,
"District Sub Location"
,
"Dispatch Pincode"
,
"Dispatch Address"
,
"GST Number"
,
"Unloading Scope"
,
"Freight Scope"
,
"Erection Scope"
,
"CGST Amount"
,
"SGST Amount"
,
"IGST Amount"
,
"OTP"
,
"Basic Amount"
,
"Paid Amount"
,
"Balance Amount"
,
"Total Amount"
,
"TPC Applicable"
,
"TPC Agent"
,
"TPC Requested Amount"
,
"TPC Level 1 Approved Amount"
,
"TPC Level 2 Approved Amount"
,
"TPC Payment Mode"
,
"TPC Payment Reference No"
,
"TPC Payment Attachment"
,
"TPC Status"
,
"Purchase Order"
,
"Created Datetime"
,
"Note"
,
"Status"
,
];
var
subHeadings2
=
[
provider
.
orderDetails
.
billingState
??
"-"
,
provider
.
orderDetails
.
billingDistrict
??
"-"
,
provider
.
orderDetails
.
billingSubLocality
??
"-"
,
provider
.
orderDetails
.
billingPincode
??
"-"
,
provider
.
orderDetails
.
billingAddress
??
"-"
,
provider
.
orderDetails
.
enteredEmpName
??
"-"
,
provider
.
orderDetails
.
stateName
??
"-"
,
provider
.
orderDetails
.
districtName
??
"-"
,
provider
.
orderDetails
.
subLocationName
??
"-"
,
provider
.
orderDetails
.
dispatchPincode
??
"-"
,
provider
.
orderDetails
.
dispatchAddress
??
"-"
,
provider
.
orderDetails
.
gstNumber
??
"-"
,
provider
.
orderDetails
.
unloadingScope
??
"-"
,
provider
.
orderDetails
.
freightScope
??
"-"
,
provider
.
orderDetails
.
erectionScope
??
"-"
,
provider
.
orderDetails
.
cgstAmount
??
"-"
,
provider
.
orderDetails
.
sgstAmount
??
"-"
,
provider
.
orderDetails
.
igstAmount
??
"-"
,
provider
.
orderDetails
.
otp
??
"-"
,
provider
.
orderDetails
.
basicAmount
??
"-"
,
provider
.
orderDetails
.
paidAmount
??
"-"
,
provider
.
orderDetails
.
balanceAmount
??
"-"
,
provider
.
orderDetails
.
totalAmount
??
"-"
,
provider
.
orderDetails
.
tpcApplicable
??
"-"
,
provider
.
orderDetails
.
tpcaAgentName
??
"-"
,
provider
.
orderDetails
.
requestedTpcAmount
??
"-"
,
provider
.
orderDetails
.
level1TpcApprovedAmount
??
"-"
,
provider
.
orderDetails
.
level2TpcApprovedAmount
??
"-"
,
provider
.
orderDetails
.
tpcPaymentMode
??
"-"
,
provider
.
orderDetails
.
tpcPaymentReferenceNo
??
"-"
,
provider
.
orderDetails
.
tpcPaymentAttachementViewFileName
??
"-"
,
provider
.
orderDetails
.
tpcStatus
??
"-"
,
provider
.
orderDetails
.
tpcPaymentAttachmentDirFilePath
??
"-"
,
provider
.
orderDetails
.
createdDatetime
??
"-"
,
provider
.
orderDetails
.
note
??
"-"
,
provider
.
orderDetails
.
status
??
"-"
,
];
var
Headings
=
[...
Headings1
];
var
subHeadings
=
[...
subHeadings1
];
if
(
provider
.
showMoreDetails
)
{
Headings
=
[...
Headings1
,
...
Headings2
];
subHeadings
=
[...
subHeadings1
,
...
subHeadings2
];
}
return
WillPopScope
(
child:
SafeArea
(
child:
SafeArea
(
top:
false
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
true
,
child:
Scaffold
(
child:
_scaffold
(
context
),
resizeToAvoidBottomInset:
true
,
),
appBar:
appbar2
(
)
context
,
:
_scaffold
(
context
)
widget
.
mode
!=
""
:
NoNetwork
(
context
);
?
"Order Details"
}
:
"Order Details (
${widget.mode}
)"
,
provider
.
resetAll
,
Widget
_scaffold
(
BuildContext
context
)
{
InkResponse
(
switch
(
_source
.
keys
.
toList
()[
0
])
{
onTap:
()
{
case
ConnectivityResult
.
mobile
:
_showOptionsSheet
(
context
);
connection
=
'Online'
;
},
break
;
child:
SvgPicture
.
asset
(
case
ConnectivityResult
.
wifi
:
"assets/svg/ic_more.svg"
,
connection
=
'Online'
;
height:
30
,
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
Consumer2
<
Pagesdashboardprovider
,
Dispatchorderprovider
>(
builder:
(
context
,
provider
,
disProvider
,
child
)
{
var
orderDetails
=
provider
.
orderDetails
;
final
productsHistory
=
provider
.
productsHistory
;
final
feedbackHistory
=
provider
.
feedbackHistory
;
final
paymentHistory
=
provider
.
paymentHistory
;
// var Headings1 = [
// "Order Number",
// "Account Name",
// "Sales Person Name",
// "Order Received Date",
// ];
// var subHeadings1 = [
// provider.orderDetails.orderNumber ?? "-",
// provider.orderDetails.accountName ?? "-",
// provider.orderDetails.salesPersonEmpName ?? "-",
// provider.orderDetails.orderReceivedDate ?? "-",
// ];
//
// var Headings2 = [
// "Billing State",
// "Billing District",
// "Billing Sub Location",
// "Billing Pincode",
// "Billing Address",
//
// "Entered By",
//
// "Dispatch State",
// "Dispatch District",
// "District Sub Location",
// "Dispatch Pincode",
// "Dispatch Address",
//
// "GST Number",
//
// "Unloading Scope",
// "Freight Scope",
// "Erection Scope",
//
// "CGST Amount",
// "SGST Amount",
// "IGST Amount",
//
// "OTP",
//
// "Basic Amount",
// "Paid Amount",
// "Balance Amount",
// "Total Amount",
//
// "TPC Applicable",
// "TPC Agent",
// "TPC Requested Amount",
//
// "TPC Level 1 Approved Amount",
// "TPC Level 2 Approved Amount",
//
// "TPC Payment Mode",
// "TPC Payment Reference No",
// "TPC Payment Attachment",
// "TPC Status",
// "Purchase Order",
//
// "Created Datetime",
// "Note",
// "Status",
// ];
// var subHeadings2 = [
// provider.orderDetails.billingState ?? "-",
// provider.orderDetails.billingDistrict ?? "-",
// provider.orderDetails.billingSubLocality ?? "-",
// provider.orderDetails.billingPincode ?? "-",
// provider.orderDetails.billingAddress ?? "-",
//
// provider.orderDetails.enteredEmpName ?? "-",
//
// provider.orderDetails.stateName ?? "-",
// provider.orderDetails.districtName ?? "-",
// provider.orderDetails.subLocationName ?? "-",
// provider.orderDetails.dispatchPincode ?? "-",
// provider.orderDetails.dispatchAddress ?? "-",
//
// provider.orderDetails.gstNumber ?? "-",
//
// provider.orderDetails.unloadingScope ?? "-",
// provider.orderDetails.freightScope ?? "-",
// provider.orderDetails.erectionScope ?? "-",
//
// provider.orderDetails.cgstAmount ?? "-",
// provider.orderDetails.sgstAmount ?? "-",
// provider.orderDetails.igstAmount ?? "-",
//
// provider.orderDetails.otp ?? "-",
//
// provider.orderDetails.basicAmount ?? "-",
// provider.orderDetails.paidAmount ?? "-",
// provider.orderDetails.balanceAmount ?? "-",
// provider.orderDetails.totalAmount ?? "-",
//
// provider.orderDetails.tpcApplicable ?? "-",
// provider.orderDetails.tpcaAgentName ?? "-",
// provider.orderDetails.requestedTpcAmount ?? "-",
//
// provider.orderDetails.level1TpcApprovedAmount ?? "-",
// provider.orderDetails.level2TpcApprovedAmount ?? "-",
//
// provider.orderDetails.tpcPaymentMode ?? "-",
// provider.orderDetails.tpcPaymentReferenceNo ?? "-",
// provider.orderDetails.tpcPaymentAttachementViewFileName ?? "-",
// provider.orderDetails.tpcStatus ?? "-",
// provider.orderDetails.tpcPaymentAttachmentDirFilePath ?? "-",
//
// provider.orderDetails.createdDatetime ?? "-",
// provider.orderDetails.note ?? "-",
// provider.orderDetails.status ?? "-",
// ];
//
// var Headings = [...Headings1];
// var subHeadings = [...subHeadings1];
//
// if (provider.showMoreDetails) {
// Headings = [...Headings1, ...Headings2];
// subHeadings = [...subHeadings1, ...subHeadings2];
// }
final
headings2
=
[
"Order Number"
,
"Account Name"
,
"Sales Person Name"
,
"Order Received Date"
,
"OTP"
,
];
final
subHeadings2
=
[
provider
.
orderDetails
.
orderNumber
??
"-"
,
provider
.
orderDetails
.
accountName
??
"-"
,
provider
.
orderDetails
.
salesPersonEmpName
??
"-"
,
provider
.
orderDetails
.
orderReceivedDate
??
"-"
,
provider
.
orderDetails
.
otp
??
"-"
,
];
final
headings3
=
[
"State"
,
"District"
,
"Sub Location"
,
"Pincode"
,
"Address"
,
"Entered By"
,
];
final
subHeadings3
=
[
provider
.
orderDetails
.
billingState
??
"-"
,
provider
.
orderDetails
.
billingDistrict
??
"-"
,
provider
.
orderDetails
.
billingSubLocality
??
"-"
,
provider
.
orderDetails
.
billingPincode
??
"-"
,
provider
.
orderDetails
.
billingAddress
??
"-"
,
provider
.
orderDetails
.
enteredEmpName
??
"-"
,
];
final
headings4
=
[
"State"
,
"District"
,
"Sub Location"
,
"Pincode"
,
"Address"
,
"GST Number"
,
];
final
subHeadings4
=
[
provider
.
orderDetails
.
stateName
??
"-"
,
provider
.
orderDetails
.
districtName
??
"-"
,
provider
.
orderDetails
.
subLocationName
??
"-"
,
provider
.
orderDetails
.
dispatchPincode
??
"-"
,
provider
.
orderDetails
.
dispatchAddress
??
"-"
,
provider
.
orderDetails
.
gstNumber
??
"-"
,
];
final
headings5
=
[
"Unloading"
,
"Freight"
,
"Erection"
];
final
subHeadings5
=
[
provider
.
orderDetails
.
unloadingScope
??
"-"
,
provider
.
orderDetails
.
freightScope
??
"-"
,
provider
.
orderDetails
.
erectionScope
??
"-"
,
];
final
headings6
=
[
"CGST"
,
"SGST"
,
"IGST"
];
final
subHeadings6
=
[
provider
.
orderDetails
.
cgstAmount
??
"-"
,
provider
.
orderDetails
.
sgstAmount
??
"-"
,
provider
.
orderDetails
.
igstAmount
??
"-"
,
];
final
headings7
=
[
"Basic Amount"
,
"Paid Amount"
,
"Balance Amount"
,
"Total Amount"
,
];
final
subHeadings7
=
[
provider
.
orderDetails
.
basicAmount
??
"-"
,
provider
.
orderDetails
.
paidAmount
??
"-"
,
provider
.
orderDetails
.
balanceAmount
??
"-"
,
provider
.
orderDetails
.
totalAmount
??
"-"
,
];
final
headings8
=
[
"TPC Applicable"
,
"TPC Agent"
,
"TPC Requested Amount"
,
"TPC Level 1 Approved Amount"
,
"TPC Level 2 Approved Amount"
,
];
final
subHeadings8
=
[
provider
.
orderDetails
.
tpcApplicable
??
"-"
,
provider
.
orderDetails
.
tpcaAgentName
??
"-"
,
provider
.
orderDetails
.
requestedTpcAmount
??
"-"
,
provider
.
orderDetails
.
level1TpcApprovedAmount
??
"-"
,
provider
.
orderDetails
.
level2TpcApprovedAmount
??
"-"
,
];
final
headings9
=
[
"TPC Payment Mode"
,
"TPC Payment Reference No"
,
"TPC Payment Attachment"
,
"TPC Status"
,
"Purchase Order"
,
];
final
subHeadings9
=
[
provider
.
orderDetails
.
tpcPaymentMode
??
"-"
,
provider
.
orderDetails
.
tpcPaymentReferenceNo
??
"-"
,
provider
.
orderDetails
.
tpcPaymentAttachementViewFileName
??
"-"
,
provider
.
orderDetails
.
tpcStatus
??
"-"
,
provider
.
orderDetails
.
tpcPaymentAttachmentDirFilePath
??
"-"
,
];
final
headings10
=
[
"Created Datetime"
,
"Note"
,
"Status"
];
final
subHeadings10
=
[
provider
.
orderDetails
.
createdDatetime
??
"-"
,
provider
.
orderDetails
.
note
??
"-"
,
provider
.
orderDetails
.
status
??
"-"
,
];
final
sections
=
[
{
"title"
:
"Order Details"
,
"headings"
:
headings2
,
"subHeadings"
:
subHeadings2
,
},
if
(
provider
.
showMoreDetails
)
...[
{
"title"
:
"Amount Details"
,
"headings"
:
headings7
,
"subHeadings"
:
subHeadings7
,
},
{
"title"
:
"GST Amount"
,
"headings"
:
headings6
,
"subHeadings"
:
subHeadings6
,
},
{
"title"
:
"Billing Details"
,
"headings"
:
headings3
,
"subHeadings"
:
subHeadings3
,
},
{
"title"
:
"Dispatch Details"
,
"headings"
:
headings4
,
"subHeadings"
:
subHeadings4
,
},
{
"title"
:
"Scope"
,
"headings"
:
headings5
,
"subHeadings"
:
subHeadings5
,
},
{
"title"
:
"TPC Details"
,
"headings"
:
headings8
,
"subHeadings"
:
subHeadings8
,
},
{
"title"
:
"TPC Payment Details"
,
"headings"
:
headings9
,
"subHeadings"
:
subHeadings9
,
},
{
"title"
:
"Others"
,
"headings"
:
headings10
,
"subHeadings"
:
subHeadings10
,
},
],
];
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2New
(
context
,
widget
.
mode
!=
""
?
"Order Details"
:
"Order Details (
${widget.mode}
)"
,
provider
.
resetAll
,
InkResponse
(
onTap:
()
{
_showOptionsSheet
(
context
);
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_more.svg"
,
height:
30
),
),
0xFFFFFFFF
,
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
SingleChildScrollView
(
child:
Column
(
children:
[
Card
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
only
(
bottomLeft:
Radius
.
circular
(
30
),
bottomRight:
Radius
.
circular
(
30
),
),
),
),
),
elevation:
2
,
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Container
(
child:
Container
(
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
only
(
),
bottomLeft:
Radius
.
circular
(
30
),
margin:
EdgeInsets
.
symmetric
(
bottomRight:
Radius
.
circular
(
30
),
vertical:
10
,
),
horizontal:
10
,
),
),
// margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
vertical:
10
,
horizontal:
10
,
horizontal:
10
,
...
@@ -255,12 +555,13 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
...
@@ -255,12 +555,13 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
Expanded
(
Expanded
(
flex:
1
,
flex:
1
,
child:
Container
(
child:
Container
(
height:
5
0
,
height:
4
5
,
width:
3
5
,
width:
4
5
,
padding:
EdgeInsets
.
all
(
8.0
),
padding:
EdgeInsets
.
all
(
7.5
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFF3CE
),
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
8
),
shape:
BoxShape
.
circle
,
// borderRadius: BorderRadius.circular(8),
),
),
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
,
"assets/svg/fin_ic.svg"
,
...
@@ -275,18 +576,39 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
...
@@ -275,18 +576,39 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
.
start
,
CrossAxisAlignment
.
start
,
children:
[
children:
[
Text
(
InkResponse
(
orderDetails
.
accountName
??
"-"
,
onTap:
()
{},
style:
TextStyle
(
child:
Padding
(
fontFamily:
"JakartaMedium"
,
padding:
const
EdgeInsets
.
only
(
fontSize:
14
,
top:
8.0
,
color:
AppColors
.
semi_black
,
bottom:
4
,
),
child:
Text
(
orderDetails
.
accountName
==
""
?
"-"
:
orderDetails
.
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
(
Text
(
"₹
${orderDetails.balanceAmount}
"
,
orderDetails
.
balanceAmount
==
""
?
"-"
:
"₹
${orderDetails.balanceAmount}
"
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
"Jakarta
Medium
"
,
fontFamily:
"Jakarta
Regular
"
,
fontSize:
14
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
),
),
...
@@ -295,6 +617,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
...
@@ -295,6 +617,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
),
),
),
),
),
Expanded
(
Expanded
(
flex:
2
,
flex:
2
,
child:
Container
(
child:
Container
(
...
@@ -304,7 +627,9 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
...
@@ -304,7 +627,9 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
),
color:
Color
(
0xFFE3FFE0
),
color:
getDecorationColor
(
orderDetails
.
status
??
"-"
,
),
),
),
child:
Center
(
child:
Center
(
child:
Text
(
child:
Text
(
...
@@ -313,79 +638,169 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
...
@@ -313,79 +638,169 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
Color
(
0xFF0D9C00
),
color:
getTextColor
(
orderDetails
.
status
,
),
),
),
),
),
),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Editorderaccountdetails
(
mode:
widget
.
mode
,
pageTitleName:
"Edit Order"
,
orderID:
provider
.
orderDetails
.
id
,
),
settings:
RouteSettings
(
name:
'Editorderaccountdetails'
,
),
),
),
);
if
(
res
==
true
)
{
provider
.
ordersDetailsByModeAPIFunction
(
context
,
widget
.
orderId
,
widget
.
mode
,
);
}
},
child:
Container
(
height:
32
,
width:
30
,
padding:
EdgeInsets
.
all
(
8.0
),
child:
SvgPicture
.
asset
(
"assets/svg/crm/lead_details_edit_ic.svg"
,
),
),
),
),
),
),
),
),
],
],
),
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
SizedBox
(
height:
10
),
...
List
.
generate
(
subHeadings
.
length
,
(
j
)
{
Column
(
return
Container
(
children:
List
.
generate
(
sections
.
length
,
(
padding:
EdgeInsets
.
symmetric
(
vertical:
7
),
sectionIndex
,
child:
Row
(
)
{
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
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
Expanded
(
Container
(
child:
Text
(
padding:
EdgeInsets
.
symmetric
(
Headings
[
j
],
vertical:
4
,
style:
TextStyle
(
),
fontFamily:
"JakartaMedium"
,
child:
Row
(
fontSize:
14
,
children:
[
color:
AppColors
.
semi_black
,
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
,
),
),
],
),
),
),
),
Expanded
(
child:
InkResponse
(
Column
(
onTap:
()
{
children:
List
.
generate
(
headings
.
length
,
(
if
(
Headings
[
j
]
==
"Purchase Order"
)
{
j
,
Navigator
.
push
(
)
{
context
,
return
Container
(
MaterialPageRoute
(
padding:
EdgeInsets
.
symmetric
(
builder:
vertical:
7
,
(
context
)
=>
Fileviewer
(
),
fileName:
child:
Row
(
orderDetails
crossAxisAlignment:
.
tpcPaymentAttachementViewFileName
!,
CrossAxisAlignment
.
start
,
fileUrl:
children:
[
orderDetails
Expanded
(
.
tpcPaymentAttachmentDirFilePath
!,
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
,
),
),
),
),
),
),
),
);
],
}
},
child:
Text
(
Headings
[
j
]
==
"Purchase Order"
?
"View"
:
subHeadings
[
j
]
==
""
?
"-"
:
"
${subHeadings[j]}
"
,
style:
TextStyle
(
fontSize:
14
,
color:
Headings
[
j
]
==
"Purchase Order"
?
AppColors
.
app_blue
:
Color
(
0xFF818181
),
decoration:
Headings
[
j
]
==
"Purchase Order"
?
TextDecoration
.
underline
:
TextDecoration
.
none
,
decorationColor:
Headings
[
j
]
==
"Purchase Order"
?
AppColors
.
app_blue
:
AppColors
.
white
,
),
),
)
,
)
;
),
}
),
),
),
],
],
),
);
);
}),
}),
),
InkResponse
(
InkResponse
(
onTap:
()
async
{
onTap:
()
async
{
provider
.
showMoreDetails
=
provider
.
showMoreDetails
=
...
@@ -399,198 +814,1448 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
...
@@ -399,198 +814,1448 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
children:
[
children:
[
Text
(
Text
(
provider
.
showMoreDetails
provider
.
showMoreDetails
?
"
- Show Les
s"
?
"
Hide Detail
s"
:
"
+ More
Details"
,
:
"
View
Details"
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
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
),
],
],
),
),
),
),
),
),
),
bottomNavigationBar:
Column
(
[
"self"
,
"pending_approval"
].
contains
(
widget
.
mode
)
children:
[
?
Container
(
height:
0
)
///product details
:
Container
(
if
(
productsHistory
.
isNotEmpty
)
...[
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
Container
(
alignment:
Alignment
.
bottomCenter
,
padding:
EdgeInsets
.
only
(
height:
60
,
left:
10
,
child:
Container
(
right:
10
,
margin:
EdgeInsets
.
only
(
bottom:
10
),
top:
10
,
alignment:
Alignment
.
center
,
),
height:
45
,
child:
Row
(
child:
Row
(
children:
[
mainAxisAlignment:
MainAxisAlignment
.
center
,
Expanded
(
children:
[
child:
Text
(
if
([
textAlign:
TextAlign
.
left
,
"level_one_approval"
,
"Product Details"
,
"level_two_approval"
,
style:
TextStyle
(
"level_two_rejected"
,
fontFamily:
"JakartaMedium"
,
].
contains
(
widget
.
mode
))
...[
fontSize:
14
,
Expanded
(
color:
AppColors
.
grey_thick
,
child:
InkResponse
(
),
onTap:
()
{
),
_showLevelApprovalRejectionSheet
(
),
context
,
],
"Reject"
,
),
);
),
},
child:
Container
(
SizedBox
(
decoration:
BoxDecoration
(
width:
double
.
infinity
,
borderRadius:
BorderRadius
.
circular
(
height:
130
,
8
,
child:
ListView
.
builder
(
),
physics:
AlwaysScrollableScrollPhysics
(),
color:
Color
(
0xFFFFEFEF
),
shrinkWrap:
true
,
border:
Border
.
all
(
scrollDirection:
Axis
.
horizontal
,
color:
Color
(
0xFFED3424
),
padding:
EdgeInsets
.
symmetric
(
width:
0.5
,
vertical:
10
,
),
horizontal:
10
,
),
),
child:
Center
(
itemCount:
productsHistory
.
length
,
child:
Text
(
itemBuilder:
(
context
,
lp
)
{
"Reject"
,
return
Container
(
style:
TextStyle
(
height:
130
,
color:
Color
(
0xFFED3424
),
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.9
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
// vertical: 10,
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/crm/product_details_ic.svg"
,
),
),
SizedBox
(
width:
10
),
Expanded
(
flex:
6
,
child:
SizedBox
(
child:
Column
(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Row
(
children:
[
Expanded
(
flex:
4
,
child:
Text
(
productsHistory
[
lp
]
.
productName
??
"-"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
),
Expanded
(
flex:
2
,
child:
Text
(
textAlign:
TextAlign
.
right
,
"₹
${productsHistory[lp].unitPrice ?? "-"}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
),
Text
(
"x
${productsHistory[lp].qty ?? "-"}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
grey_semi
,
),
),
SizedBox
(
height:
5
),
DottedLine
(
dashGapLength:
4
,
dashGapColor:
Colors
.
white
,
dashColor:
AppColors
.
grey_semi
,
dashLength:
2
,
lineThickness:
0.5
,
),
SizedBox
(
height:
5
),
Text
(
"₹
${productsHistory[lp].totalPrice ?? " - "}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
],
),
),
),
),
),
),
],
),
);
},
),
),
],
///Feedback details
Container
(
padding:
EdgeInsets
.
only
(
left:
10
,
right:
10
,
top:
10
,
),
child:
Row
(
children:
[
Expanded
(
child:
Text
(
textAlign:
TextAlign
.
left
,
"Feedback Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
grey_thick
,
),
),
),
if
(
feedbackHistory
.
isNotEmpty
)
...[
Expanded
(
child:
InkResponse
(
onTap:
()
async
{
_showFeedbackSheet
(
context
);
},
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Text
(
textAlign:
TextAlign
.
right
,
"+ Feedback Update"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
),
),
],
),
SizedBox
(
width:
10
),
),
if
([
],
"level_one_approval"
,
],
"level_two_approval"
,
),
"level_two_rejected"
,
),
"sales_order_registered"
,
if
(
feedbackHistory
.
isNotEmpty
)
...[
].
contains
(
widget
.
mode
))
...[
SizedBox
(
Expanded
(
width:
double
.
infinity
,
child:
InkResponse
(
height:
220
,
onTap:
()
{
child:
ListView
.
builder
(
// provider
physics:
AlwaysScrollableScrollPhysics
(),
// .approveRejectPaymentRequestAPIFunction(
shrinkWrap:
true
,
// context,
scrollDirection:
Axis
.
horizontal
,
// provider.requestsDetails.id,
padding:
EdgeInsets
.
symmetric
(
// );
vertical:
10
,
_showLevelApprovalRejectionSheet
(
horizontal:
10
,
context
,
),
"Approve"
,
itemCount:
feedbackHistory
.
length
,
);
itemBuilder:
(
context
,
lp
)
{
},
return
Container
(
child:
Container
(
height:
220
,
decoration:
BoxDecoration
(
width:
borderRadius:
BorderRadius
.
circular
(
MediaQuery
.
of
(
context
).
size
.
width
*
0.9
,
8
,
decoration:
BoxDecoration
(
),
color:
Colors
.
white
,
color:
Color
(
0xFFE7FFE5
),
borderRadius:
BorderRadius
.
circular
(
14
),
border:
Border
.
all
(
),
color:
Color
(
0xFF0D9C00
),
padding:
EdgeInsets
.
symmetric
(
width:
0.5
,
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/crm/followup_details_ic.svg"
,
),
),
),
),
child:
Center
(
SizedBox
(
width:
10
),
child:
Text
(
Expanded
(
"Approve"
,
flex:
6
,
style:
TextStyle
(
child:
SizedBox
(
color:
Color
(
0xFF0D9C00
),
child:
Column
(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Row
(
children:
[
Expanded
(
flex:
4
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
feedbackHistory
[
lp
]
.
employeNaem
??
"-"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
Text
(
feedbackHistory
[
lp
]
.
createdDatetime
??
"-"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
grey_semi
,
),
),
],
),
),
Expanded
(
flex:
2
,
child:
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
,
),
color:
Color
(
0xFFF3FFD5
,
),
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
10
,
),
child:
Center
(
child:
Text
(
textAlign:
TextAlign
.
center
,
"
${feedbackHistory[lp].status ?? "-"}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
Color
(
0xFF586000
,
),
),
),
),
),
),
],
),
],
),
),
),
),
),
),
)
,
]
,
),
),
),
Container
(
],
padding:
EdgeInsets
.
symmetric
(
vertical:
7.5
,
if
([
"admin"
].
contains
(
widget
.
mode
))
...[
),
Expanded
(
child:
Row
(
child:
InkResponse
(
children:
[
onTap:
()
{
Expanded
(
_showLevelDeletionSheet
(
context
);
flex:
3
,
},
child:
Text
(
child:
Container
(
"Feedback"
,
decoration:
BoxDecoration
(
style:
TextStyle
(
borderRadius:
BorderRadius
.
circular
(
fontSize:
14
,
8
,
fontFamily:
"JakartaSemiBold"
,
),
),
color:
Color
(
0xFFFFEFEF
),
),
border:
Border
.
all
(
color:
Color
(
0xFFED3424
),
width:
0.5
,
),
),
),
Expanded
(
child:
Center
(
flex:
7
,
child:
Text
(
child:
DottedLine
(
"Delete"
,
dashGapLength:
4
,
style:
TextStyle
(
dashGapColor:
Colors
.
white
,
color:
Color
(
0xFFED3424
),
dashColor:
AppColors
.
grey_semi
,
dashLength:
2
,
lineThickness:
0.5
,
),
),
),
),
],
),
),
...
List
.
generate
(
2
,
(
j
)
{
final
heads
=
[
"Feedback"
,
"Attachment"
,
];
final
subHeads
=
[
feedbackHistory
[
lp
].
feedback
??
"-"
,
"View"
,
];
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
,
),
),
),
if
(
subHeads
[
j
]
==
"View"
)
...[
Expanded
(
child:
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
Fileviewer
(
fileName:
feedbackHistory
[
lp
].
attachmentViewFileName
!,
fileUrl:
feedbackHistory
[
lp
].
attachmentDirFilePath
!,
),
),
);
},
child:
Text
(
textAlign:
TextAlign
.
right
,
subHeads
[
j
]
==
""
?
"-"
:
subHeads
[
j
],
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
app_blue
,
decorationColor:
AppColors
.
app_blue
,
decoration:
TextDecoration
.
underline
,
),
),
),
),
]
else
...[
Expanded
(
child:
Text
(
textAlign:
TextAlign
.
right
,
subHeads
[
j
]
==
""
?
"-"
:
subHeads
[
j
],
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
),
),
),
),
],
],
),
);
}),
],
),
);
},
),
),
]
else
...[
InkResponse
(
onTap:
()
async
{
_showFeedbackSheet
(
context
);
},
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
,
"+ Feedback Update"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
),
),
),
],
///PaymentHistory details
Container
(
padding:
EdgeInsets
.
only
(
left:
10
,
right:
10
,
top:
10
,
),
child:
Row
(
children:
[
Expanded
(
child:
Text
(
textAlign:
TextAlign
.
left
,
"Payment Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
grey_thick
,
),
),
),
],
),
),
if
(
paymentHistory
.
isNotEmpty
)
...[
SizedBox
(
width:
double
.
infinity
,
height:
225
,
child:
ListView
.
builder
(
physics:
AlwaysScrollableScrollPhysics
(),
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
paymentHistory
.
length
,
itemBuilder:
(
context
,
lp
)
{
return
Container
(
height:
225
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.9
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/order/payment_history_ic.svg"
,
),
),
SizedBox
(
width:
10
),
Expanded
(
flex:
6
,
child:
SizedBox
(
child:
Column
(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Row
(
children:
[
Expanded
(
flex:
4
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
paymentHistory
[
lp
]
.
ename
??
"-"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
Text
(
"₹
${paymentHistory[lp]
.amount ??
"-"}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
grey_semi
,
),
),
],
),
),
],
),
],
),
),
),
Expanded
(
flex:
2
,
child:
Container
(
height:
45
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
processed_bg_color
,
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
child:
Center
(
child:
Text
(
paymentHistory
[
lp
].
approvalStatus
??
"-"
,
textAlign:
TextAlign
.
right
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
processed_text_color
,
),
),
),
),
),
],
),
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
),
child:
Row
(
children:
[
Expanded
(
flex:
4
,
child:
Text
(
"Payment Info"
,
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
(
3
,
(
j
)
{
final
headsa
=
[
"Mode of Payment"
,
"Payment Reference"
,
"Adjusted Amount"
,
"Payment Date"
,
];
final
subHeadsa
=
[
paymentHistory
[
lp
]
.
paymentType
??
"-"
,
paymentHistory
[
lp
]
.
refNo
??
"-"
,
"₹
${paymentHistory[lp]
.adjustedAmount ??
"-"}
"
,
paymentHistory
[
lp
]
.
paymentDate
??
"-"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
textAlign:
TextAlign
.
left
,
headsa
[
j
],
style:
TextStyle
(
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
),
Expanded
(
child:
Text
(
textAlign:
TextAlign
.
right
,
subHeadsa
[
j
]
==
""
?
"-"
:
subHeadsa
[
j
],
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
,
),
),
),
),
],
),
);
}),
],
),
);
},
),
),
],
],
),
],
),
),
bottomNavigationBar:
[
"self"
,
"pending_approval"
].
contains
(
widget
.
mode
)
?
Container
(
height:
0
)
:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
alignment:
Alignment
.
bottomCenter
,
height:
60
,
child:
Container
(
margin:
EdgeInsets
.
only
(
bottom:
10
),
alignment:
Alignment
.
center
,
height:
45
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
if
([
"level_one_approval"
,
"level_two_approval"
,
"level_two_rejected"
,
].
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:
Center
(
child:
Text
(
"Reject"
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
),
),
),
),
),
),
],
SizedBox
(
width:
10
),
if
([
"level_one_approval"
,
"level_two_approval"
,
"level_two_rejected"
,
"sales_order_registered"
,
].
contains
(
widget
.
mode
))
...[
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:
Center
(
child:
Text
(
"Approve"
,
style:
TextStyle
(
color:
Color
(
0xFF0D9C00
),
),
),
),
),
),
),
],
if
([
"admin"
].
contains
(
widget
.
mode
))
...[
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:
Center
(
child:
Text
(
"Delete"
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
),
),
),
),
),
),
],
if
(
widget
.
mode
==
"dispatched"
)
...[
Expanded
(
child:
InkResponse
(
onTap:
()
{
disProvider
.
initializeForm
(
context
);
disProvider
.
ordersDetailsDispatchOrderViewFunction
(
context
,
widget
.
orderId
,
);
_showDispatchSheet
(
context
,
"Dispatch"
);
},
child:
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
),
color:
Color
(
0xFFFFEFEF
),
border:
Border
.
all
(
color:
Color
(
0xFFED3424
),
width:
0.5
,
),
),
child:
Center
(
child:
Text
(
"Dispatch"
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
),
),
),
),
),
),
],
],
),
),
),
),
),
onWillPop:
()
{
return
onBackPressed
(
context
);
},
);
},
);
}
Widget
_scaffold1
(
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
Consumer2
<
Pagesdashboardprovider
,
Dispatchorderprovider
>(
builder:
(
context
,
provider
,
disProvider
,
child
)
{
var
orderDetails
=
provider
.
orderDetails
;
var
Headings1
=
[
"Order Number"
,
"Account Name"
,
"Sales Person Name"
,
"Order Received Date"
,
];
var
subHeadings1
=
[
provider
.
orderDetails
.
orderNumber
??
"-"
,
provider
.
orderDetails
.
accountName
??
"-"
,
provider
.
orderDetails
.
salesPersonEmpName
??
"-"
,
provider
.
orderDetails
.
orderReceivedDate
??
"-"
,
];
var
Headings2
=
[
"Billing State"
,
"Billing District"
,
"Billing Sub Location"
,
"Billing Pincode"
,
"Billing Address"
,
"Entered By"
,
"Dispatch State"
,
"Dispatch District"
,
"District Sub Location"
,
"Dispatch Pincode"
,
"Dispatch Address"
,
"GST Number"
,
"Unloading Scope"
,
"Freight Scope"
,
"Erection Scope"
,
"CGST Amount"
,
"SGST Amount"
,
"IGST Amount"
,
"OTP"
,
"Basic Amount"
,
"Paid Amount"
,
"Balance Amount"
,
"Total Amount"
,
"TPC Applicable"
,
"TPC Agent"
,
"TPC Requested Amount"
,
"TPC Level 1 Approved Amount"
,
"TPC Level 2 Approved Amount"
,
"TPC Payment Mode"
,
"TPC Payment Reference No"
,
"TPC Payment Attachment"
,
"TPC Status"
,
"Purchase Order"
,
"Created Datetime"
,
"Note"
,
"Status"
,
];
var
subHeadings2
=
[
provider
.
orderDetails
.
billingState
??
"-"
,
provider
.
orderDetails
.
billingDistrict
??
"-"
,
provider
.
orderDetails
.
billingSubLocality
??
"-"
,
provider
.
orderDetails
.
billingPincode
??
"-"
,
provider
.
orderDetails
.
billingAddress
??
"-"
,
provider
.
orderDetails
.
enteredEmpName
??
"-"
,
provider
.
orderDetails
.
stateName
??
"-"
,
provider
.
orderDetails
.
districtName
??
"-"
,
provider
.
orderDetails
.
subLocationName
??
"-"
,
provider
.
orderDetails
.
dispatchPincode
??
"-"
,
provider
.
orderDetails
.
dispatchAddress
??
"-"
,
provider
.
orderDetails
.
gstNumber
??
"-"
,
provider
.
orderDetails
.
unloadingScope
??
"-"
,
provider
.
orderDetails
.
freightScope
??
"-"
,
provider
.
orderDetails
.
erectionScope
??
"-"
,
provider
.
orderDetails
.
cgstAmount
??
"-"
,
provider
.
orderDetails
.
sgstAmount
??
"-"
,
provider
.
orderDetails
.
igstAmount
??
"-"
,
provider
.
orderDetails
.
otp
??
"-"
,
provider
.
orderDetails
.
basicAmount
??
"-"
,
provider
.
orderDetails
.
paidAmount
??
"-"
,
provider
.
orderDetails
.
balanceAmount
??
"-"
,
provider
.
orderDetails
.
totalAmount
??
"-"
,
provider
.
orderDetails
.
tpcApplicable
??
"-"
,
provider
.
orderDetails
.
tpcaAgentName
??
"-"
,
provider
.
orderDetails
.
requestedTpcAmount
??
"-"
,
provider
.
orderDetails
.
level1TpcApprovedAmount
??
"-"
,
provider
.
orderDetails
.
level2TpcApprovedAmount
??
"-"
,
provider
.
orderDetails
.
tpcPaymentMode
??
"-"
,
provider
.
orderDetails
.
tpcPaymentReferenceNo
??
"-"
,
provider
.
orderDetails
.
tpcPaymentAttachementViewFileName
??
"-"
,
provider
.
orderDetails
.
tpcStatus
??
"-"
,
provider
.
orderDetails
.
tpcPaymentAttachmentDirFilePath
??
"-"
,
provider
.
orderDetails
.
createdDatetime
??
"-"
,
provider
.
orderDetails
.
note
??
"-"
,
provider
.
orderDetails
.
status
??
"-"
,
];
var
Headings
=
[...
Headings1
];
var
subHeadings
=
[...
subHeadings1
];
if
(
provider
.
showMoreDetails
)
{
Headings
=
[...
Headings1
,
...
Headings2
];
subHeadings
=
[...
subHeadings1
,
...
subHeadings2
];
}
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
widget
.
mode
!=
""
?
"Order Details"
:
"Order Details (
${widget.mode}
)"
,
provider
.
resetAll
,
InkResponse
(
onTap:
()
{
_showOptionsSheet
(
context
);
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_more.svg"
,
height:
30
),
),
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
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:
50
,
width:
35
,
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFF3CE
),
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:
[
Text
(
orderDetails
.
accountName
??
"-"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
Text
(
"₹
${orderDetails.balanceAmount}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
],
),
),
),
Expanded
(
flex:
2
,
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
10
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
),
color:
Color
(
0xFFE3FFE0
),
),
child:
Center
(
child:
Text
(
orderDetails
.
status
??
"-"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
Color
(
0xFF0D9C00
),
),
),
),
),
),
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
subHeadings
.
length
,
(
j
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
7
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
child:
Text
(
Headings
[
j
],
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
),
Expanded
(
child:
InkResponse
(
onTap:
()
{
if
(
Headings
[
j
]
==
"Purchase Order"
)
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Fileviewer
(
fileName:
orderDetails
.
tpcPaymentAttachementViewFileName
!,
fileUrl:
orderDetails
.
tpcPaymentAttachmentDirFilePath
!,
),
),
);
}
},
child:
Text
(
Headings
[
j
]
==
"Purchase Order"
?
"View"
:
subHeadings
[
j
]
==
""
?
"-"
:
"
${subHeadings[j]}
"
,
style:
TextStyle
(
fontSize:
14
,
color:
Headings
[
j
]
==
"Purchase Order"
?
AppColors
.
app_blue
:
Color
(
0xFF818181
),
decoration:
Headings
[
j
]
==
"Purchase Order"
?
TextDecoration
.
underline
:
TextDecoration
.
none
,
decorationColor:
Headings
[
j
]
==
"Purchase Order"
?
AppColors
.
app_blue
:
AppColors
.
white
,
),
),
),
),
],
),
);
}),
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
?
"- Show Less"
:
"+ More Details"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
],
),
),
),
],
),
),
),
),
bottomNavigationBar:
[
"self"
,
"pending_approval"
].
contains
(
widget
.
mode
)
?
Container
(
height:
0
)
:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
alignment:
Alignment
.
bottomCenter
,
height:
60
,
child:
Container
(
margin:
EdgeInsets
.
only
(
bottom:
10
),
alignment:
Alignment
.
center
,
height:
45
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
if
([
"level_one_approval"
,
"level_two_approval"
,
"level_two_rejected"
,
].
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:
Center
(
child:
Text
(
"Reject"
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
),
),
),
),
),
),
],
SizedBox
(
width:
10
),
if
([
"level_one_approval"
,
"level_two_approval"
,
"level_two_rejected"
,
"sales_order_registered"
,
].
contains
(
widget
.
mode
))
...[
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:
Center
(
child:
Text
(
"Approve"
,
style:
TextStyle
(
color:
Color
(
0xFF0D9C00
),
),
),
),
),
),
),
],
if
([
"admin"
].
contains
(
widget
.
mode
))
...[
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:
Center
(
child:
Text
(
"Delete"
,
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
),
),
),
),
),
),
),
),
],
),
if
(
widget
.
mode
==
"dispatched"
)
...[
),
Expanded
(
],
child:
InkResponse
(
if
(
widget
.
mode
==
"dispatched"
)
...[
onTap:
()
{
Expanded
(
disProvider
.
initializeForm
(
context
);
child:
InkResponse
(
disProvider
onTap:
()
{
.
ordersDetailsDispatchOrderViewFunction
(
disProvider
.
initializeForm
(
context
);
context
,
disProvider
widget
.
orderId
,
.
ordersDetailsDispatchOrderViewFunction
(
);
_showDispatchSheet
(
context
,
context
,
"Dispatch"
,
widget
.
orderId
,
);
);
},
_showDispatchSheet
(
context
,
"Dispatch"
);
child:
Container
(
},
decoration:
BoxDecoration
(
child:
Container
(
borderRadius:
BorderRadius
.
circular
(
decoration:
BoxDecoration
(
8
,
borderRadius:
BorderRadius
.
circular
(
8
),
),
color:
Color
(
0xFFFFEFEF
),
color:
Color
(
0xFFFFEFEF
),
border:
Border
.
all
(
border:
Border
.
all
(
color:
Color
(
0xFFED3424
),
color:
Color
(
0xFFED3424
),
width:
0.5
,
width:
0.5
,
),
),
),
),
child:
Center
(
child:
Center
(
child:
Text
(
child:
Text
(
"Dispatch"
,
"Dispatch"
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xFFED3424
),
color:
Color
(
0xFFED3424
),
),
),
),
),
),
),
),
),
),
),
]
,
)
,
]
,
)
,
)
,
]
,
)
,
]
,
),
),
),
),
),
),
),
),
onWillPop:
()
{
onWillPop:
()
{
return
onBackPressed
(
context
);
return
onBackPressed
(
context
);
},
);
},
},
)
);
:
NoNetwork
(
context
);
},
);
}
}
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
...
@@ -1537,4 +3202,285 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
...
@@ -1537,4 +3202,285 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
},
},
);
);
}
}
Future
<
void
>
_showFeedbackSheet
(
BuildContext
context
)
{
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
<
Pagesdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
orderDetails
=
provider
.
orderDetails
;
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
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Align
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Feedback Update"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
,
top:
8.0
,
),
child:
Text
(
"Remarks"
),
),
Container
(
height:
150
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE9E9E9
),
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
,
),
child:
TextFormField
(
controller:
provider
.
feedbackController
,
readOnly:
true
,
keyboardType:
TextInputType
.
text
,
maxLines:
60
,
onChanged:
provider
.
onChangeFeedback
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontSize:
14
,
),
decoration:
InputDecoration
(
hintText:
"Write Remarks"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
,
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
if
(
provider
.
feedbackError
!=
null
)
...[
Container
(
alignment:
Alignment
.
topLeft
,
margin:
EdgeInsets
.
only
(
top:
2.5
,
left:
25
),
child:
Text
(
"
${provider.feedbackError}
"
,
style:
TextStyle
(
color:
Colors
.
red
,
fontSize:
10
,
),
),
),
],
InkResponse
(
onTap:
()
{
_showAttachmentSheet
(
context
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
),
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
),
),
child:
Center
(
child:
Text
(
"Add Attachment"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
),
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
,
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
),
),
InkResponse
(
onTap:
()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
],
),
),
],
InkWell
(
onTap:
()
{
provider
.
ordersDetailsFeedbackSubmissionAPIFunction
(
context
,
orderDetails
.
id
,
orderDetails
.
status
,
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
],
),
),
);
},
),
);
},
);
},
);
}
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
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
<
Pagesdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
,
).
viewInsets
.
bottom
,
// This handles keyboard
),
child:
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
"Select Source"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
SizedBox
(
height:
15
),
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromGallery
(
context
);
},
child:
Container
(
height:
35
,
child:
Text
(
"Select photo from gallery"
),
),
),
SizedBox
(
height:
10
),
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromCamera
(
context
);
},
child:
Container
(
height:
35
,
child:
Text
(
"Capture photo from camera"
),
),
),
],
),
),
),
);
},
),
);
},
);
},
);
}
}
}
lib/screens/order/ordersListByModes.dart
View file @
a5820eb1
...
@@ -60,6 +60,95 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -60,6 +60,95 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
_connectivity
.
disposeStream
();
_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
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
...
@@ -91,6 +180,224 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -91,6 +180,224 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
}
}
Widget
_scaffold
(
BuildContext
context
)
{
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Pagesdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
ordersList
=
provider
.
ordersList
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2New
(
context
,
widget
.
pageTitleName
,
provider
.
resetAll
,
Row
(
children:
[
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg"),
// ),
InkResponse
(
onTap:
()
async
{
_showFilterSheet
(
context
);
},
child:
SvgPicture
.
asset
(
"assets/svg/filter_ic.svg"
,
height:
25
,
),
),
],
),
0xFFFFFFFF
,
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
provider
.
isLoading
?
Center
(
child:
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
AppColors
.
app_blue
,
),
),
)
:
ordersList
.
isNotEmpty
?
SingleChildScrollView
(
child:
Column
(
children:
[
ListView
.
builder
(
itemCount:
ordersList
.
length
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
if
(
ordersList
.
isEmpty
)
{
return
SizedBox
(
child:
Center
(
child:
Text
(
"No Data Available"
)),
);
}
return
InkResponse
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Ordersdetailsbymodes
(
pageTitleName:
widget
.
pageTitleName
,
orderId:
ordersList
[
index
].
orderId
,
mode:
widget
.
mode
,
),
),
);
if
(
res
==
true
)
{
provider
.
ordersListByModeFilterAPIFunction
(
context
,
widget
.
mode
,
);
provider
.
ordersListByModeAPIFunction
(
context
,
widget
.
mode
,
""
,
""
,
);
}
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
7.5
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
[
Row
(
children:
[
// Expanded(
// flex: 1,
// child: Container(
// height: 50,
// width: 35,
// padding: EdgeInsets.all(8.0),
// decoration: BoxDecoration(
// color: Color(0xFFFFF3CE),
// borderRadius: BorderRadius.circular(
// 8,
// ),
// ),
// child: SvgPicture.asset(
// "assets/svg/fin_ic.svg",
// ),
// ),
// ),
Expanded
(
flex:
1
,
child:
Container
(
height:
50
,
width:
50
,
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
color:
getDecorationColor
(
ordersList
[
index
].
status
,
),
shape:
BoxShape
.
circle
,
),
child:
Center
(
child:
Text
(
getText
(
ordersList
[
index
].
status
,
),
style:
TextStyle
(
color:
getTextColor
(
ordersList
[
index
].
status
,
),
fontSize:
getSize
(
ordersList
[
index
].
status
,
),
fontFamily:
"JakartaBold"
,
),
),
),
),
),
SizedBox
(
width:
10
),
Expanded
(
flex:
4
,
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
ordersList
[
index
]
.
accountName
!,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
Text
(
ordersList
[
index
]
.
orderNumber
!,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
grey_semi
,
fontFamily:
"JakartaRegular"
,
decoration:
TextDecoration
.
none
,
decorationColor:
AppColors
.
white
,
),
),
],
),
),
),
SizedBox
(
width:
10
),
Expanded
(
flex:
2
,
child:
Container
(
child:
Text
(
"₹"
"
${ordersList[index].balanceAmount}
"
,
textAlign:
TextAlign
.
right
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
),
),
),
),
],
),
],
),
),
);
},
),
],
),
)
:
Emptywidget
(
context
),
);
},
);
}
Widget
_scaffold1
(
BuildContext
context
)
{
return
Consumer
<
Pagesdashboardprovider
>(
return
Consumer
<
Pagesdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
final
ordersList
=
provider
.
ordersList
;
final
ordersList
=
provider
.
ordersList
;
...
...
lib/screens/serviceEngineer/PendingComplaints.dart
View file @
a5820eb1
import
'dart:io'
;
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_slidable/flutter_slidable.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/PendingComplaintsProvider.dart'
;
import
'package:generp/Notifiers/PendingComplaintsProvider.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
...
@@ -9,6 +11,7 @@ import 'package:provider/provider.dart';
...
@@ -9,6 +11,7 @@ import 'package:provider/provider.dart';
import
'package:url_launcher/url_launcher.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonServices.dart'
;
import
'UpdateComplaints.dart'
;
import
'UpdateComplaints.dart'
;
class
Pendingcomplaints
extends
StatefulWidget
{
class
Pendingcomplaints
extends
StatefulWidget
{
...
@@ -19,10 +22,17 @@ class Pendingcomplaints extends StatefulWidget {
...
@@ -19,10 +22,17 @@ class Pendingcomplaints extends StatefulWidget {
}
}
class
_PendingcomplaintsState
extends
State
<
Pendingcomplaints
>
{
class
_PendingcomplaintsState
extends
State
<
Pendingcomplaints
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
@override
void
initState
()
{
void
initState
()
{
// TODO: implement initState
// TODO: implement initState
super
.
initState
();
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
complaintsprovider
=
Provider
.
of
<
Pendingcomplaintsprovider
>(
var
complaintsprovider
=
Provider
.
of
<
Pendingcomplaintsprovider
>(
context
,
context
,
...
@@ -32,8 +42,402 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> {
...
@@ -32,8 +42,402 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> {
});
});
}
}
@override
void
dispose
()
{
// TODO: implement dispose
_connectivity
.
disposeStream
();
super
.
dispose
();
}
@override
@override
Widget
build
(
BuildContext
context
)
{
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:
_scaffold1
(
context
),
),
)
:
_scaffold1
(
context
)
:
NoNetwork
(
context
);
}
@override
Widget
_scaffold1
(
BuildContext
context
)
{
return
Consumer
<
Pendingcomplaintsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar2New
(
context
,
"Pending Complaints"
,
provider
.
resetAll
,
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scancomplaintdetails
(),
),
);
},
child:
SvgPicture
.
asset
(
"assets/svg/scanner.svg"
),
),
0xFFFFFFFF
,
),
body:
provider
.
technician_complaint_list
.
isNotEmpty
?
Container
(
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
itemCount:
provider
.
technician_complaint_list
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
itemBuilder:
(
context
,
index
)
{
return
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Visitdetails
(
from:
"Pending Complaints"
,
complaintID:
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
),
),
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
20
),
child:
Slidable
(
startActionPane:
ActionPane
(
motion:
const
ScrollMotion
(),
key:
ValueKey
(
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
),
dragDismissible:
false
,
// dismissible: DismissiblePane(
//
// onDismissed: () {},
// closeOnCancel: true,
// resizeDuration: Duration(milliseconds: 300),),
children:
[
SlidableAction
(
onPressed:
(
context
)
async
{
var
loc
=
provider
.
technician_complaint_list
[
index
]
.
loc
?.
split
(
","
)
.
toString
();
var
uri
=
Uri
.
parse
(
"google.navigation:q=
${loc![0]}
,
${loc![1]}
&mode=d"
,
);
if
(
await
canLaunch
(
uri
.
toString
(),
))
{
await
launch
(
uri
.
toString
());
}
else
{
throw
'Could not launch
${uri.toString()}
'
;
}
},
backgroundColor:
Color
(
0xFFFFF8E5
),
foregroundColor:
Color
(
0xFFFFB600
),
icon:
Icons
.
location_history
,
label:
'Location'
,
),
SlidableAction
(
onPressed:
(
context
)
async
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Updatecomplaints
(
ComplaintID:
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
),
),
);
},
backgroundColor:
Color
(
0xFFE6F6FF
),
foregroundColor:
AppColors
.
app_blue
,
icon:
Icons
.
note_add
,
label:
'Update Complaint'
,
),
],
),
endActionPane:
ActionPane
(
motion:
const
ScrollMotion
(),
key:
ValueKey
(
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
),
dragDismissible:
false
,
// dismissible: DismissiblePane(
//
// onDismissed: () {},
// closeOnCancel: true,
// resizeDuration: Duration(milliseconds: 300),),
children:
[
SlidableAction
(
onPressed:
(
context
)
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Generator"
,
name:
provider
.
technician_complaint_list
[
index
]
.
companyName
,
genId:
provider
.
technician_complaint_list
[
index
]
.
genId
,
referenceID:
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
),
),
);
},
backgroundColor:
Color
(
0xFFE7FFE5
),
foregroundColor:
Color
(
0xFF0D9C00
),
icon:
Icons
.
add
,
label:
'Payment Details'
,
),
],
),
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
0
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
shape:
BoxShape
.
circle
,
),
child:
SvgPicture
.
asset
(
width:
30
,
height:
30
,
"assets/svg/se_block_head.svg"
,
),
),
),
SizedBox
(
width:
5
),
Expanded
(
flex:
4
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.technician_complaint_list[index].contactName}
"
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
Text
(
"
${provider.technician_complaint_list[index].companyName}
"
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
,
),
fontSize:
14
,
),
),
],
),
),
Spacer
(),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
launch
(
'tel://
${provider.technician_complaint_list[index].mobileNo}
'
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/se_call_customer.svg"
,
color:
Color
(
0xFF0D9C00
),
height:
20
,
width:
20
,
),
),
),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
_showOptionsSheet
(
context
,
provider
.
technician_complaint_list
[
index
]
.
companyName
,
provider
.
technician_complaint_list
[
index
]
.
genId
,
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_more.svg"
,
height:
30
,
),
),
),
],
),
// Divider(
// thickness: 0.5,
// color: Color(0xFFD7D7D7),
// ),
// ...List.generate(4, (j) {
// final textheads = [
// "Complaint ID",
// "Product Name",
//
// "Engine Number",
// "Address",
// ];
// final textSubheads = [
// provider
// .technician_complaint_list[index]
// .complaintId,
// provider
// .technician_complaint_list[index]
// .productName,
// provider
// .technician_complaint_list[index]
// .engineNo,
// provider
// .technician_complaint_list[index]
// .address,
// ];
// return Container(
// padding: EdgeInsets.symmetric(
// vertical: 3,
// ),
// child: Row(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Expanded(
// flex: 1,
// child: Text(
// textheads[j].toString(),
// style: TextStyle(
// fontFamily: "JakartaMedium",
// ),
// ),
// ),
// Expanded(
// flex: 2,
// child: Text(
// textSubheads[j].toString(),
// style: TextStyle(
// color: Color(0xFF818181),
// ),
// ),
// ),
// ],
// ),
// );
// }),
],
),
),
),
),
),
);
},
),
)
:
Emptywidget
(
context
),
),
),
);
},
);
}
@override
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Pendingcomplaintsprovider
>(
return
Consumer
<
Pendingcomplaintsprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
return
WillPopScope
(
...
@@ -231,6 +635,7 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> {
...
@@ -231,6 +635,7 @@ class _PendingcomplaintsState extends State<Pendingcomplaints> {
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
context
)
=>
Visitdetails
(
(
context
)
=>
Visitdetails
(
from:
"Pending Complaints"
,
complaintID:
complaintID:
provider
provider
.
technician_complaint_list
[
index
]
.
technician_complaint_list
[
index
]
...
...
lib/screens/serviceEngineer/TodayMontlyVisists.dart
View file @
a5820eb1
import
'dart:io'
;
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_slidable/flutter_slidable.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
...
@@ -8,6 +10,7 @@ import 'package:url_launcher/url_launcher.dart';
...
@@ -8,6 +10,7 @@ import 'package:url_launcher/url_launcher.dart';
import
'package:generp/screens/screensExports.dart'
;
import
'package:generp/screens/screensExports.dart'
;
import
'../../Notifiers/TodayMontlyVisitsProvider.dart'
;
import
'../../Notifiers/TodayMontlyVisitsProvider.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonServices.dart'
;
class
Todaymontlyvisists
extends
StatefulWidget
{
class
Todaymontlyvisists
extends
StatefulWidget
{
final
String
visitType
;
final
String
visitType
;
...
@@ -19,10 +22,18 @@ class Todaymontlyvisists extends StatefulWidget {
...
@@ -19,10 +22,18 @@ class Todaymontlyvisists extends StatefulWidget {
}
}
class
_TodaymontlyvisistsState
extends
State
<
Todaymontlyvisists
>
{
class
_TodaymontlyvisistsState
extends
State
<
Todaymontlyvisists
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
@override
void
initState
()
{
void
initState
()
{
// TODO: implement initState
// TODO: implement initState
super
.
initState
();
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
visitsProvider
=
Provider
.
of
<
Todaymontlyvisitsprovider
>(
var
visitsProvider
=
Provider
.
of
<
Todaymontlyvisitsprovider
>(
context
,
context
,
...
@@ -41,9 +52,241 @@ class _TodaymontlyvisistsState extends State<Todaymontlyvisists> {
...
@@ -41,9 +52,241 @@ class _TodaymontlyvisistsState extends State<Todaymontlyvisists> {
}
}
});
});
}
}
@override
void
dispose
()
{
// TODO: implement dispose
_connectivity
.
disposeStream
();
super
.
dispose
();
}
@override
@override
Widget
build
(
BuildContext
context
)
{
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:
_scaffold1
(
context
),
),
)
:
_scaffold1
(
context
)
:
NoNetwork
(
context
);
}
@override
Widget
_scaffold1
(
BuildContext
context
)
{
return
Consumer
<
Todaymontlyvisitsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbarNew
(
context
,
provider
.
title
,
0xFFFFFFFF
),
body:
provider
.
visitsList
.
isNotEmpty
?
Container
(
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
itemCount:
provider
.
visitsList
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
itemBuilder:
(
context
,
index
)
{
return
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Visitdetails
(
complaintID:
provider
.
visitsList
[
index
]
.
complaintId
,
),
),
);
},
child:
Container
(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 0,
// ),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
20
),
child:
Slidable
(
endActionPane:
ActionPane
(
motion:
const
ScrollMotion
(),
key:
ValueKey
(
provider
.
visitsList
[
index
].
complaintId
),
dragDismissible:
false
,
// dismissible: DismissiblePane(
//
// onDismissed: () {},
// closeOnCancel: true,
// resizeDuration: Duration(milliseconds: 300),),
children:
[
SlidableAction
(
onPressed:
(
context
)
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Generator"
,
name:
provider
.
visitsList
[
index
]
.
companyName
,
genId:
provider
.
visitsList
[
index
]
.
genId
,
referenceID:
provider
.
visitsList
[
index
]
.
complaintId
,
),
),
);
},
backgroundColor:
Color
(
0xFFE7FFE5
),
foregroundColor:
Color
(
0xFF0D9C00
),
icon:
Icons
.
add
,
label:
'Payment Details'
,
),
],
),
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
0
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
shape:
BoxShape
.
circle
),
child:
SvgPicture
.
asset
(
width:
30
,
height:
30
,
"assets/svg/se_block_head.svg"
,
),
),
),
SizedBox
(
width:
5
),
Expanded
(
flex:
4
,
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.visitsList[index].contactName ?? "-"}
"
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
Text
(
"
${provider.visitsList[index].companyName}
"
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
),
),
Spacer
(),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
launch
(
'tel://
${provider.visitsList[index].mobileNo}
'
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/se_call_customer.svg"
,
color:
Color
(
0xFF0D9C00
),
height:
20
,
width:
20
,
),
),
),
],
),
],
),
),
),
),
),
);
},
),
)
:
Emptywidget
(
context
)
),
),
);
},
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Todaymontlyvisitsprovider
>(
return
Consumer
<
Todaymontlyvisitsprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
return
WillPopScope
(
...
...
lib/screens/serviceEngineer/VisitDetails.dart
View file @
a5820eb1
import
'dart:io'
;
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/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/VisitDetailsProvider.dart'
;
import
'package:generp/Notifiers/VisitDetailsProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'../../Utils/commonServices.dart'
;
import
'../finance/FileViewer.dart'
;
import
'Followupdetails.dart'
;
import
'Followupdetails.dart'
;
import
'PaymentDetails.dart'
;
import
'UpdateComplaints.dart'
;
class
Visitdetails
extends
StatefulWidget
{
class
Visitdetails
extends
StatefulWidget
{
final
complaintID
;
final
complaintID
;
final
from
;
const
Visitdetails
({
super
.
key
,
required
this
.
complaintID
});
const
Visitdetails
({
super
.
key
,
required
this
.
complaintID
,
this
.
from
});
@override
@override
State
<
Visitdetails
>
createState
()
=>
_VisitdetailsState
();
State
<
Visitdetails
>
createState
()
=>
_VisitdetailsState
();
}
}
class
_VisitdetailsState
extends
State
<
Visitdetails
>
{
class
_VisitdetailsState
extends
State
<
Visitdetails
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
@override
void
initState
()
{
void
initState
()
{
// TODO: implement initState
// TODO: implement initState
super
.
initState
();
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
visitdetails
=
Provider
.
of
<
Visitdetailsprovider
>(
var
visitdetails
=
Provider
.
of
<
Visitdetailsprovider
>(
context
,
context
,
listen:
false
,
listen:
false
,
);
);
visitdetails
.
showMoreDetails
=
false
;
visitdetails
.
LoadVisitDetailsAPI
(
context
,
widget
.
complaintID
);
visitdetails
.
LoadVisitDetailsAPI
(
context
,
widget
.
complaintID
);
visitdetails
.
LoadFollowupListAPI
(
context
,
widget
.
complaintID
);
});
});
}
}
@override
void
dispose
()
{
// TODO: implement dispose
_connectivity
.
disposeStream
();
super
.
dispose
();
}
@override
@override
Widget
build
(
BuildContext
context
)
{
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:
_scaffold1
(
context
),
),
)
:
_scaffold1
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold1
(
BuildContext
context
)
{
return
Consumer
<
Visitdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
customerDetails
=
provider
.
customerDetails
;
var
generatorDetails
=
provider
.
generatorDetails
;
var
complaintDetails
=
provider
.
complaintDetailsNew
;
var
followups
=
provider
.
followUpList
;
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbarNew
(
context
,
"Visit Details"
,
0xFFFFFFFF
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
SizedBox
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
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:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
5
,
),
child:
Column
(
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Row
(
children:
[
SvgPicture
.
asset
(
"assets/svg/crm/lead_details_ic.svg"
,
),
SizedBox
(
width:
10
),
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${customerDetails.cname}
"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
Text
(
"
${customerDetails.aname}
"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
),
),
),
],
),
),
],
),
),
],
),
),
Visibility
(
visible:
provider
.
showMoreDetails
?
true
:
false
,
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
margin:
EdgeInsets
.
symmetric
(
vertical:
0
,
horizontal:
10
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
4
,
),
child:
Row
(
children:
[
Expanded
(
flex:
3
,
child:
Text
(
"Customer 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
,
),
),
],
),
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
3
,
(
j
)
{
final
textheads
=
[
"Mobile Number"
,
"Contact Person Number"
,
"Mail ID"
,
];
final
textSubheads
=
[
customerDetails
.
mob1
??
"-"
,
customerDetails
.
mob2
??
"-"
,
customerDetails
.
mail
??
"-"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
6
,
horizontal:
0
,
),
child:
Row
(
children:
[
Expanded
(
flex:
1
,
child:
SizedBox
(
child:
Text
(
textheads
[
j
].
toString
(),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaRegular"
,
fontSize:
14
,
),
),
),
),
SizedBox
(
width:
5
),
Expanded
(
flex:
2
,
child:
InkResponse
(
onTap:
textheads
[
j
]
!=
"Mobile Number"
?
null
:
()
async
{
final
Uri
phoneUri
=
Uri
(
scheme:
'tel'
,
path:
customerDetails
.
mob1
==
""
?
customerDetails
.
mob2
:
provider
.
customerDetails
.
mob1
,
);
if
(
await
canLaunchUrl
(
phoneUri
,
))
{
await
launchUrl
(
phoneUri
,
);
}
else
{
throw
'Could not launch
$phoneUri
'
;
}
},
child:
SizedBox
(
child:
Text
(
textSubheads
[
j
]
==
""
?
"-"
:
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
textAlign:
TextAlign
.
right
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaRegular"
,
color:
textheads
[
j
]
==
"Mobile Number"
?
AppColors
.
app_blue
:
Color
(
0xFF818181
,
),
decorationColor:
textheads
[
j
]
==
"Mobile Number"
?
AppColors
.
app_blue
:
null
,
decoration:
textheads
[
j
]
==
"Mobile Number"
?
TextDecoration
.
underline
:
null
,
),
),
),
),
),
],
),
);
}),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
4
,
),
child:
Row
(
children:
[
Expanded
(
flex:
3
,
child:
Text
(
"Generator 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
,
),
),
],
),
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
6
,
(
j
)
{
final
textheads
=
[
"Gen ID"
,
"Engine Number"
,
"Address"
,
"Product Name"
,
"Engine Model"
,
"Date Of Supply"
,
];
final
textSubheads
=
[
"
${generatorDetails.genHashId}
"
,
"
${generatorDetails.engineNo}
"
,
"
${generatorDetails.address}
"
,
"
${generatorDetails.spname}
"
,
"
${generatorDetails.engineModel}
"
,
"
${complaintDetails.dateOfSupply}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
6
,
horizontal:
0
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaRegular"
,
),
),
),
SizedBox
(
width:
5
),
Expanded
(
flex:
2
,
child:
SizedBox
(
child:
Text
(
textSubheads
[
j
]
==
""
?
"-"
:
textSubheads
[
j
],
maxLines:
2
,
textAlign:
TextAlign
.
right
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
grey_semi
,
fontFamily:
"JakartaRegular"
,
),
),
),
),
],
),
);
}),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
4
,
),
child:
Row
(
children:
[
Expanded
(
flex:
4
,
child:
Text
(
"Complaint 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
,
),
),
],
),
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
4
,
(
j
)
{
final
textheads
=
[
"Complaint ID"
,
"Complaint Description"
,
"Opened Date"
,
"Complaint Type"
,
];
final
textSubheads
=
[
"
${complaintDetails.complaintId}
"
,
"
${complaintDetails.complaintDesc}
"
,
"
${complaintDetails.openedDate}
"
,
"
${complaintDetails.complaintType}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
6
,
horizontal:
0
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaRegular"
,
),
),
),
SizedBox
(
width:
5
),
Expanded
(
flex:
2
,
child:
SizedBox
(
child:
Text
(
textSubheads
[
j
]
==
""
?
"-"
:
textSubheads
[
j
],
maxLines:
2
,
textAlign:
TextAlign
.
right
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
grey_semi
,
fontFamily:
"JakartaRegular"
,
),
),
),
),
],
),
);
}),
),
],
),
),
),
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
,
),
),
],
),
),
),
],
),
),
if
(
followups
.
isNotEmpty
)
...[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
child:
Text
(
"Followup Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
,
),
),
),
SizedBox
(
width:
double
.
infinity
,
height:
350
,
child:
ListView
.
builder
(
physics:
AlwaysScrollableScrollPhysics
(),
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
provider
.
followUpList
.
length
,
itemBuilder:
(
context
,
lp
)
{
return
Container
(
height:
350
,
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.9
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/crm/followup_details_ic.svg"
,
),
),
SizedBox
(
width:
10
),
Expanded
(
flex:
8
,
child:
SizedBox
(
child:
Column
(
// mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Row
(
children:
[
Expanded
(
flex:
4
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
provider
.
followUpList
[
lp
]
.
ename
??
"-"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
semi_black
,
),
),
Text
(
provider
.
followUpList
[
lp
]
.
date
??
"-"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
AppColors
.
grey_semi
,
),
),
],
),
),
// Expanded(
// flex: 3,
// child: Container(
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.circular(
// 8,
// ),
// color: Color(
// 0xFFF3FFD5,
// ),
// ),
// padding:
// EdgeInsets.symmetric(
// horizontal: 5,
// vertical: 10,
// ),
// child: Text(
// "${provider.followUpList[lp].status ?? "-"}",
// textAlign:
// TextAlign.center,
// style: TextStyle(
// fontFamily:
// "JakartaMedium",
// fontSize: 14,
// color: Color(
// 0xFF586000,
// ),
// ),
// ),
// ),
// ),
],
),
],
),
),
),
],
),
// Container(
// padding: EdgeInsets.symmetric(
// vertical: 7.5,
// ),
// child: Row(
// children: [
// Expanded(
// flex: 4,
// child: Text(
// "Visit Type",
// 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(1, (j) {
// final heads = [
// "Type",
// ];
// final subHeads = [
// followups[lp].type??"-",
// ];
// 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,
// maxLines: 1,
// overflow: TextOverflow.ellipsis,
// subHeads[j] == ""
// ? "-"
// : subHeads[j],
// style: TextStyle(
// fontSize: 14,
// color: AppColors.grey_semi,
// ),
// ),
// ),
// ],
// ),
// );
// }),
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
7.5
,
),
child:
Row
(
children:
[
Expanded
(
flex:
4
,
child:
Text
(
"Visit Time"
,
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
(
3
,
(
j
)
{
final
heads
=
[
"In Time"
,
"Out Time"
,
"Running Hours"
,
];
final
subHeads
=
[
followups
[
lp
].
time
??
"-"
,
followups
[
lp
].
outTime
??
"-"
,
followups
[
lp
].
runningHrs
??
"-"
,
];
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
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
subHeads
[
j
]
==
""
?
"-"
:
subHeads
[
j
],
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
grey_semi
,
),
),
),
],
),
);
}),
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
7
,
),
child:
Row
(
children:
[
Expanded
(
flex:
4
,
child:
Text
(
"FSR 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
(
3
,
(
j
)
{
final
heads
=
[
"FSR File"
,
"FSR Number"
,
"Feedback"
,
];
final
subHeads
=
[
followups
[
lp
].
fsrExt
??
"-"
,
followups
[
lp
].
fsrNo
??
"-"
,
followups
[
lp
].
feedback
??
"-"
,
];
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
,
),
),
),
if
(
heads
[
j
]
==
"FSR File"
)
...[
Expanded
(
child:
InkResponse
(
onTap:
()
{
if
(
heads
[
j
]
==
"FSR File"
)
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
Fileviewer
(
fileName:
followups
[
lp
]
.
fsrExt
!,
fileUrl:
"https://erp.gengroup.in/files_genservices/tech_fsr_report/
${followups[lp].fsrExt!}
"
,
),
),
);
}
},
child:
Text
(
subHeads
[
j
],
overflow:
TextOverflow
.
ellipsis
,
textAlign:
TextAlign
.
right
,
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
app_blue
,
decorationColor:
AppColors
.
app_blue
,
decoration:
TextDecoration
.
underline
,
),
),
),
),
]
else
...[
Expanded
(
child:
Text
(
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
textAlign:
TextAlign
.
right
,
subHeads
[
j
]
==
""
?
"-"
:
subHeads
[
j
],
style:
TextStyle
(
fontSize:
14
,
color:
AppColors
.
grey_semi
,
),
),
),
],
],
),
);
}),
],
),
);
},
),
),
],
SizedBox
(
height:
75
),
],
),
),
),
bottomNavigationBar:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
child:
InkWell
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Generator"
,
name:
provider
.
customerDetails
.
cname
,
genId:
provider
.
generatorDetails
.
id
,
referenceID:
provider
.
complaintDetailsNew
.
complaintId
,
),
),
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
65
,
// margin: EdgeInsets.symmetric(horizontal: 10),
decoration:
BoxDecoration
(
color:
AppColors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/se_payment_details.svg"
,
),
SizedBox
(
width:
5
),
if
(
widget
.
from
==
"Pending Complaints"
)
...[
Expanded
(
child:
Text
(
"Payment Details"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaMedium"
,
fontSize:
12
,
),
),
),
]
else
...[
Text
(
"Payment Details"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaMedium"
,
fontSize:
12
,
),
),
],
],
),
),
),
),
if
(
widget
.
from
==
"Pending Complaints"
)
...[
SvgPicture
.
asset
(
"assets/svg/crm/vertical_line_ic.svg"
),
Expanded
(
child:
InkWell
(
onTap:
()
async
{
var
loc
=
provider
.
generatorDetails
.
loc
?.
split
(
","
)
.
toString
();
var
uri
=
Uri
.
parse
(
"google.navigation:q=
${loc![0]}
,
${loc![1]}
&mode=d"
,
);
if
(
await
canLaunch
(
uri
.
toString
()))
{
await
launch
(
uri
.
toString
());
}
else
{
throw
'Could not launch
${uri.toString()}
'
;
}
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
65
,
// margin: EdgeInsets.symmetric(horizontal: 10),
decoration:
BoxDecoration
(
color:
AppColors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/se_locate_customer.svg"
,
),
SizedBox
(
width:
5
),
Text
(
"Location"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaMedium"
,
fontSize:
12
,
),
),
],
),
),
),
),
SvgPicture
.
asset
(
"assets/svg/crm/vertical_line_ic.svg"
),
Expanded
(
child:
InkWell
(
onTap:
()
async
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Updatecomplaints
(
ComplaintID:
provider
.
complaintDetailsNew
.
complaintId
,
),
),
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
65
,
// margin: EdgeInsets.symmetric(horizontal: 10),
decoration:
BoxDecoration
(
color:
AppColors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/se_update_complaint.svg"
,
),
SizedBox
(
width:
5
),
Expanded
(
child:
Text
(
"Update Complaint"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaMedium"
,
fontSize:
12
,
),
),
),
],
),
),
),
),
],
],
),
),
// floatingActionButton: Align(
// alignment: Alignment.bottomCenter,
// child: InkWell(
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// Followupdetails(complaintID: widget.complaintID),
// ),
// );
// },
// child: Container(
// alignment: Alignment.bottomCenter,
// height: 45,
// width: MediaQuery.of(context).size.width,
// margin: EdgeInsets.symmetric(horizontal: 10),
// decoration: BoxDecoration(
// color: AppColors.app_blue,
// borderRadius: BorderRadius.circular(14.0),
// ),
// child: Center(
// child: Text(
// "Followup Details",
// textAlign: TextAlign.center,
// style: TextStyle(
// color: Colors.white,
// fontFamily: "JakartaMedium",
// ),
// ),
// ),
// ),
// ),
// ),
// floatingActionButtonLocation:
// FloatingActionButtonLocation.centerFloat,
),
),
);
},
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Visitdetailsprovider
>(
return
Consumer
<
Visitdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
var
customerDetails
=
provider
.
customerDetails
;
var
customerDetails
=
provider
.
customerDetails
;
...
@@ -43,7 +1223,7 @@ class _VisitdetailsState extends State<Visitdetails> {
...
@@ -43,7 +1223,7 @@ class _VisitdetailsState extends State<Visitdetails> {
onWillPop:
()
=>
onBackPressed
(
context
),
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
child:
SafeArea
(
top:
false
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Visit Details"
),
appBar:
appbar
(
context
,
"Visit Details"
),
...
@@ -55,10 +1235,13 @@ class _VisitdetailsState extends State<Visitdetails> {
...
@@ -55,10 +1235,13 @@ class _VisitdetailsState extends State<Visitdetails> {
children:
[
children:
[
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
8
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
8
),
child:
Text
(
"Customer Details"
,
style:
TextStyle
(
child:
Text
(
fontSize:
14
,
"Customer Details"
,
color:
AppColors
.
grey_thick
,
style:
TextStyle
(
),),
fontSize:
14
,
color:
AppColors
.
grey_thick
,
),
),
),
),
Container
(
Container
(
margin:
EdgeInsets
.
symmetric
(
margin:
EdgeInsets
.
symmetric
(
...
@@ -97,7 +1280,7 @@ class _VisitdetailsState extends State<Visitdetails> {
...
@@ -97,7 +1280,7 @@ class _VisitdetailsState extends State<Visitdetails> {
children:
[
children:
[
Row
(
Row
(
mainAxisAlignment:
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
MainAxisAlignment
.
spaceBetween
,
children:
[
children:
[
if
(
j
==
0
)
...[
if
(
j
==
0
)
...[
SvgPicture
.
asset
(
SvgPicture
.
asset
(
...
@@ -108,26 +1291,30 @@ class _VisitdetailsState extends State<Visitdetails> {
...
@@ -108,26 +1291,30 @@ class _VisitdetailsState extends State<Visitdetails> {
child:
SizedBox
(
child:
SizedBox
(
child:
Column
(
child:
Column
(
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
.
start
,
CrossAxisAlignment
.
start
,
children:
[
children:
[
Text
(
Text
(
"
${customerDetails.cname}
"
,
"
${customerDetails.cname}
"
,
maxLines:
2
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
SizedBox
(
SizedBox
(
// height:45,
// height:45,
width:
width:
MediaQuery
.
of
(
MediaQuery
.
of
(
context
,
context
,
).
size
.
width
*
).
size
.
width
*
0.75
,
0.75
,
child:
Text
(
child:
Text
(
textSubheads
[
j
]
==
""
textSubheads
[
j
]
==
""
?
"-"
?
"-"
:
customerDetails
.
aname
??
"-"
,
:
customerDetails
.
aname
??
"-"
,
maxLines:
2
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xFF818181
),
color:
Color
(
0xFF818181
),
),
),
...
@@ -137,7 +1324,7 @@ class _VisitdetailsState extends State<Visitdetails> {
...
@@ -137,7 +1324,7 @@ class _VisitdetailsState extends State<Visitdetails> {
),
),
),
),
),
),
]
else
...[
]
else
...[
Expanded
(
Expanded
(
child:
Text
(
textheads
[
j
].
toString
()),
child:
Text
(
textheads
[
j
].
toString
()),
),
),
...
@@ -156,11 +1343,10 @@ class _VisitdetailsState extends State<Visitdetails> {
...
@@ -156,11 +1343,10 @@ class _VisitdetailsState extends State<Visitdetails> {
),
),
),
),
],
],
],
],
),
),
],
],
)
)
,
);
);
}),
}),
),
),
...
@@ -168,10 +1354,13 @@ class _VisitdetailsState extends State<Visitdetails> {
...
@@ -168,10 +1354,13 @@ class _VisitdetailsState extends State<Visitdetails> {
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
8
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
8
),
child:
Text
(
"Generator Details"
,
style:
TextStyle
(
child:
Text
(
fontSize:
14
,
"Generator Details"
,
color:
AppColors
.
grey_thick
,
style:
TextStyle
(
),),
fontSize:
14
,
color:
AppColors
.
grey_thick
,
),
),
),
),
Container
(
Container
(
margin:
EdgeInsets
.
symmetric
(
margin:
EdgeInsets
.
symmetric
(
...
@@ -325,8 +1514,9 @@ class _VisitdetailsState extends State<Visitdetails> {
...
@@ -325,8 +1514,9 @@ class _VisitdetailsState extends State<Visitdetails> {
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
context
)
=>
(
context
)
=>
Followupdetails
(
Followupdetails
(
complaintID:
widget
.
complaintID
),
complaintID:
widget
.
complaintID
,
),
),
),
);
);
},
},
...
...
lib/services/api_calling.dart
View file @
a5820eb1
...
@@ -2238,6 +2238,30 @@ class ApiCalling {
...
@@ -2238,6 +2238,30 @@ class ApiCalling {
}
}
}
}
static
Future
<
ordersAccessiblePagesResponse
?>
ordersAccesibleAddPagesAPI
(
empId
,
session
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
};
final
res
=
await
post
(
data
,
ordersAccessibleAddPagesUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
return
ordersAccessiblePagesResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
return
null
;
}
}
catch
(
e
)
{
debugPrint
(
'hello bev=bug
$e
'
);
return
null
;
}
}
static
Future
<
orderPendingTasksListResponse
?>
orderPendingTasksListAPI
(
static
Future
<
orderPendingTasksListResponse
?>
orderPendingTasksListAPI
(
empId
,
empId
,
session
,
session
,
...
...
lib/services/api_names.dart
View file @
a5820eb1
...
@@ -88,6 +88,7 @@ const commonAccountLedgerAccountDetails = "${baseUrl_test}common_account_details
...
@@ -88,6 +88,7 @@ const commonAccountLedgerAccountDetails = "${baseUrl_test}common_account_details
///order Module
///order Module
const
ordersAccessiblePagesUrl
=
"
${baseUrl_test}
crm_order_accessible_pages"
;
const
ordersAccessiblePagesUrl
=
"
${baseUrl_test}
crm_order_accessible_pages"
;
const
ordersAccessibleAddPagesUrl
=
"
${baseUrl_test}
crm_add_order_accessible_pages"
;
const
ordersDashboardUrl
=
"
${baseUrl_test}
order_dashboard"
;
const
ordersDashboardUrl
=
"
${baseUrl_test}
order_dashboard"
;
const
ordersPendingTasksListUrl
=
"
${baseUrl_test}
pending_tasks_list"
;
const
ordersPendingTasksListUrl
=
"
${baseUrl_test}
pending_tasks_list"
;
const
ordersOrderListByModeUrl
=
"
${baseUrl_test}
crm_order_list_view"
;
const
ordersOrderListByModeUrl
=
"
${baseUrl_test}
crm_order_list_view"
;
...
...
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