Merge branch 'master' into fatima
# Conflicts: # lib/api/client/user_api_client.dart # lib/classes/consts.dart # lib/config/routes.dartfatima
@ -0,0 +1,42 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "815750722565",
|
||||
"firebase_url": "https://api-project-815750722565.firebaseio.com",
|
||||
"project_id": "api-project-815750722565",
|
||||
"storage_bucket": "api-project-815750722565.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063",
|
||||
"android_client_info": {
|
||||
"package_name": "com.ejada.hmg"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"analytics_service": {
|
||||
"status": 1
|
||||
},
|
||||
"appinvite_service": {
|
||||
"status": 1,
|
||||
"other_platform_oauth_client": []
|
||||
},
|
||||
"ads_service": {
|
||||
"status": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
<svg id="Group_768" data-name="Group 768" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<defs>
|
||||
<clipPath id="clip-path">
|
||||
<rect id="Rectangle_1490" data-name="Rectangle 1490" width="16" height="16" fill="#2699fb"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="Group_767" data-name="Group 767" clip-path="url(#clip-path)">
|
||||
<path id="Path_669" data-name="Path 669" d="M18.08,177.688l.127.038v-1.174h-.552v1.136a.711.711,0,0,1,.425,0" transform="translate(-17.103 -171.035)" fill="#2699fb"/>
|
||||
<path id="Path_670" data-name="Path 670" d="M52.966,203.035v.512l.552.166v-.678Z" transform="translate(-51.31 -196.69)" fill="#2699fb"/>
|
||||
<rect id="Rectangle_1487" data-name="Rectangle 1487" width="0.552" height="0.552" transform="translate(6.621 6.621)" fill="#2699fb"/>
|
||||
<rect id="Rectangle_1488" data-name="Rectangle 1488" width="0.552" height="1.103" transform="translate(7.724 6.069)" fill="#2699fb"/>
|
||||
<rect id="Rectangle_1489" data-name="Rectangle 1489" width="0.552" height="0.552" transform="translate(8.828 6.621)" fill="#2699fb"/>
|
||||
<path id="Path_671" data-name="Path 671" d="M477.242,177.689v-1.137h-.552v1.174l.129-.039a.751.751,0,0,1,.214-.031.738.738,0,0,1,.209.033" transform="translate(-461.793 -171.035)" fill="#2699fb"/>
|
||||
<path id="Path_672" data-name="Path 672" d="M441.379,203.035v.678l.552-.166v-.512Z" transform="translate(-427.586 -196.69)" fill="#2699fb"/>
|
||||
<path id="Path_673" data-name="Path 673" d="M196.138,5.076l1.508-1.885a1.937,1.937,0,0,0,.423-1.206V1.931a1.931,1.931,0,0,0-3.862,0v.054a1.939,1.939,0,0,0,.423,1.206Zm0-4.248a1.1,1.1,0,1,1-1.1,1.1,1.1,1.1,0,0,1,1.1-1.1" transform="translate(-188.138)" fill="#2699fb"/>
|
||||
<path id="Path_674" data-name="Path 674" d="M390.345,0a1.933,1.933,0,0,0-1.931,1.931v.054a1.938,1.938,0,0,0,.423,1.206l1.508,1.885,1.508-1.885a1.937,1.937,0,0,0,.423-1.206V1.931A1.933,1.933,0,0,0,390.345,0m0,3.034a1.1,1.1,0,1,1,1.1-1.1,1.1,1.1,0,0,1-1.1,1.1" transform="translate(-376.276)" fill="#2699fb"/>
|
||||
<path id="Path_675" data-name="Path 675" d="M1.931,5.076,3.439,3.191a1.937,1.937,0,0,0,.423-1.206V1.931A1.931,1.931,0,0,0,0,1.931v.054A1.938,1.938,0,0,0,.423,3.191Zm0-4.248a1.1,1.1,0,1,1-1.1,1.1,1.1,1.1,0,0,1,1.1-1.1" fill="#2699fb"/>
|
||||
<path id="Path_676" data-name="Path 676" d="M198.069,248.275v-1.1h-3.862v2.759h3.862Zm-2.759,1.1h-.552v-.552h.552Zm0-1.1h-.552v-.552h.552Zm1.1,1.1h-.552v-.552h.552Zm0-1.1h-.552v-.552h.552Zm1.1,1.1h-.552v-.552h.552Zm0-1.1h-.552v-.552h.552Z" transform="translate(-188.138 -239.448)" fill="#2699fb"/>
|
||||
<path id="Path_677" data-name="Path 677" d="M91.035,282.483H88.276v1.655h2.759Zm-1.655,1.1h-.552v-.552h.552Zm1.1,0h-.552v-.552h.552Z" transform="translate(-85.517 -273.655)" fill="#2699fb"/>
|
||||
<path id="Path_678" data-name="Path 678" d="M338.207,282.483h-2.759v1.655h2.759Zm-1.655,1.1H336v-.552h.552Zm1.1,0H337.1v-.552h.552Z" transform="translate(-324.965 -273.655)" fill="#2699fb"/>
|
||||
<path id="Path_679" data-name="Path 679" d="M406.069,230.445v.194h.552a.552.552,0,0,1,.552.552v1.655h1.655V229.74a.209.209,0,0,0-.264-.2l-2.348.7A.2.2,0,0,0,406.069,230.445Zm1.655.194h.552v.552h-.552Zm0,1.1h.552v.552h-.552Z" transform="translate(-393.379 -222.363)" fill="#2699fb"/>
|
||||
<path id="Path_680" data-name="Path 680" d="M289.492,353.1h-5.907v.276a.276.276,0,0,0,.276.276h2.759a.828.828,0,1,1,0,1.655h-1.655a.276.276,0,0,0-.276.276.829.829,0,0,1-.828.828h-1.1a.276.276,0,1,0,0,.552.829.829,0,0,1,.828.828v.065a9.105,9.105,0,0,0,6.025-4.471l.024-.043a.161.161,0,0,0,.02-.079A.162.162,0,0,0,289.492,353.1Z" transform="translate(-273.654 -342.07)" fill="#2699fb"/>
|
||||
<path id="Path_681" data-name="Path 681" d="M5.793,357.518a.828.828,0,1,1,0-1.655h.552a.276.276,0,1,0,0-.552H3.034a.828.828,0,1,1,0-1.655H4.69a.276.276,0,0,0,.276-.276V353.1H.162a.162.162,0,0,0-.162.162.161.161,0,0,0,.02.079l.024.043a9.105,9.105,0,0,0,6.025,4.471v-.065a.276.276,0,0,0-.276-.276" transform="translate(0 -342.07)" fill="#2699fb"/>
|
||||
<path id="Path_682" data-name="Path 682" d="M17.655,232.84H19.31v-1.655a.552.552,0,0,1,.552-.552h.552v-.194a.2.2,0,0,0-.146-.2l-2.348-.7a.208.208,0,0,0-.264.2Zm.552-2.207h.552v.552h-.552Zm0,1.1h.552v.552h-.552Z" transform="translate(-17.103 -222.357)" fill="#2699fb"/>
|
||||
<path id="Path_683" data-name="Path 683" d="M94.621,357.518a.828.828,0,1,1,0-1.655h1.1a.276.276,0,0,0,.276-.276.829.829,0,0,1,.828-.828h1.655a.276.276,0,1,0,0-.552H95.724a.829.829,0,0,1-.828-.828V353.1H91.035v.276a.829.829,0,0,1-.828.828H88.552a.276.276,0,0,0,0,.552h3.31a.828.828,0,0,1,0,1.655H91.31a.276.276,0,1,0,0,.552.829.829,0,0,1,.828.828v.167a8.783,8.783,0,0,0,2.759,0v-.167a.276.276,0,0,0-.276-.276" transform="translate(-85.517 -342.07)" fill="#2699fb"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
@ -0,0 +1,10 @@
|
||||
<svg id="Group_772" data-name="Group 772" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18" viewBox="0 0 18 18">
|
||||
<defs>
|
||||
<clipPath id="clip-path">
|
||||
<rect id="Rectangle_1492" data-name="Rectangle 1492" width="18" height="18" fill="#2699fb"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="Group_771" data-name="Group 771" clip-path="url(#clip-path)">
|
||||
<path id="Path_688" data-name="Path 688" d="M9,0a9,9,0,1,0,9,9A9,9,0,0,0,9,0m3.471,11.315a.818.818,0,1,1-1.137,1.177l-.02-.02L9,10.156,6.686,12.471a.818.818,0,0,1-1.157-1.157L7.843,9,5.529,6.684A.818.818,0,1,1,6.666,5.507l.02.02L9,7.842l2.314-2.315a.818.818,0,1,1,1.177,1.137l-.02.02L10.157,9Z" transform="translate(0 0.001)" fill="#2699fb"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 760 B |
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="14.41" height="19.215" viewBox="0 0 14.41 19.215">
|
||||
<path id="Path_665" data-name="Path 665" d="M12.609,7.806V5.4A5.4,5.4,0,1,0,1.8,5.4v2.4A1.769,1.769,0,0,0,0,9.608v7.806a1.806,1.806,0,0,0,1.8,1.8H12.609a1.806,1.806,0,0,0,1.8-1.8V9.608a1.769,1.769,0,0,0-1.8-1.8M3,5.4a4.2,4.2,0,1,1,8.406,0v2.4H3Zm4.8,8.887v1.321a.6.6,0,1,1-1.2,0V14.292A1.749,1.749,0,0,1,5.4,12.61a1.8,1.8,0,1,1,3.6,0,1.749,1.749,0,0,1-1.2,1.681" fill="#2699fb"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 487 B |
@ -0,0 +1,13 @@
|
||||
<svg id="Group_770" data-name="Group 770" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16.001" viewBox="0 0 16 16.001">
|
||||
<defs>
|
||||
<clipPath id="clip-path">
|
||||
<rect id="Rectangle_1491" data-name="Rectangle 1491" width="16" height="16.001" fill="#2699fb"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="Group_769" data-name="Group 769" clip-path="url(#clip-path)">
|
||||
<path id="Path_684" data-name="Path 684" d="M211.911,0a1.931,1.931,0,0,0-1.906,1.906,1.931,1.931,0,0,0,1.906,1.906,1.907,1.907,0,0,0,0-3.813" transform="translate(-203.442)" fill="#2699fb"/>
|
||||
<path id="Path_685" data-name="Path 685" d="M184.93,122a2.8,2.8,0,0,1-2.081.938,2.864,2.864,0,0,1-2.112-.938,2.791,2.791,0,0,0-.732,1.875v.469a.469.469,0,0,0,.469.469h4.719a.469.469,0,0,0,.469-.469v-.469A2.791,2.791,0,0,0,184.93,122" transform="translate(-174.379 -118.187)" fill="#2699fb"/>
|
||||
<path id="Path_686" data-name="Path 686" d="M4.53,295.841l-2.389-4.79a.938.938,0,0,0-1.255-.422l-.624.309a.469.469,0,0,0-.211.63l2.813,5.626a.469.469,0,0,0,.628.211l.616-.305a.938.938,0,0,0,.423-1.259" transform="translate(0 -281.452)" fill="#2699fb"/>
|
||||
<path id="Path_687" data-name="Path 687" d="M101.828,236.829a.935.935,0,0,0-1.238.122l-2.563,3.15a1.133,1.133,0,0,1-.694.3H95.149a.469.469,0,0,1,0-.938h1.875a.938.938,0,1,0,0-1.875H94.568c-.234,0-.35-.148-.534-.309a3.262,3.262,0,0,0-2.91-.712,3.42,3.42,0,0,0-1.439.719l-.014-.011-.678.6,2.665,5.343h5.368a2.824,2.824,0,0,0,2.25-1.125l2.75-3.938a.945.945,0,0,0-.2-1.322" transform="translate(-86.211 -229.088)" fill="#2699fb"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 675 B |
@ -0,0 +1,11 @@
|
||||
<svg id="Group_761" data-name="Group 761" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="21.545" height="22.965" viewBox="0 0 21.545 22.965">
|
||||
<defs>
|
||||
<clipPath id="clip-path">
|
||||
<rect id="Rectangle_1484" data-name="Rectangle 1484" width="21.545" height="22.965" fill="#2699fb"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="Group_761-2" data-name="Group 761" clip-path="url(#clip-path)">
|
||||
<path id="Path_663" data-name="Path 663" d="M21.3,136.849l-1.91-.49-.881.734c0-.049-1.812-4.7-1.714-4.407a1.879,1.879,0,0,0-1.567-1.175,53.565,53.565,0,0,0-8.863,0A1.857,1.857,0,0,0,4.8,132.687c0,.049-1.812,4.7-1.714,4.407l-.881-.734-1.91.49a.42.42,0,0,0-.294.343v.441a.573.573,0,0,0,.392.539l1.861.783-.245.343a2.372,2.372,0,0,0-.343,1.273v5.876a1.547,1.547,0,0,0,1.567,1.567H4.456a1.547,1.547,0,0,0,1.567-1.567v-.832h9.646v.832a1.578,1.578,0,0,0,1.567,1.567H18.46a1.547,1.547,0,0,0,1.567-1.567V140.57a2.908,2.908,0,0,0-.343-1.273l-.294-.343,1.763-.734a.573.573,0,0,0,.392-.539v-.441A.388.388,0,0,0,21.3,136.849Zm-15.718,4.6-.734,1.518a.3.3,0,0,1-.294.2H2.938a.335.335,0,0,1-.343-.343V141.3a.335.335,0,0,1,.343-.343h2.3a.345.345,0,0,1,.343.49m-1.763-3.428,1.273-3.33c.588-.049,1.567-.147,3.183-.2a61.5,61.5,0,0,1,8.226.2l1.273,3.33h-.686a2.88,2.88,0,0,0-5.68,0Zm8.667,0a1.9,1.9,0,0,1,1.861-1.42,1.939,1.939,0,0,1,1.861,1.42ZM14,143.557H7.737a.579.579,0,0,1-.539-.832l.783-1.812a.6.6,0,0,1,.539-.343h4.75a.6.6,0,0,1,.539.343l.783,1.812a.623.623,0,0,1-.588.832m5.043-.734a.335.335,0,0,1-.343.343H17.138a.331.331,0,0,1-.294-.2l-.734-1.518a.337.337,0,0,1,.294-.49h2.3a.335.335,0,0,1,.343.343Z" transform="translate(0 -125.048)" fill="#2699fb"/>
|
||||
<path id="Path_664" data-name="Path 664" d="M123.925,3.085a1.986,1.986,0,0,1,2.008,2.008h3.134V4.7a.477.477,0,0,0-.392-.49l-.93-.147a5.837,5.837,0,0,0-.392-.979l.539-.734a.4.4,0,0,0-.049-.588l-.539-.588a.519.519,0,0,0-.637-.049l-.734.539a2.428,2.428,0,0,0-.979-.392l-.147-.881a.477.477,0,0,0-.49-.392h-.783a.527.527,0,0,0-.49.392l-.147.881a5.836,5.836,0,0,0-.979.392l-.734-.539a.518.518,0,0,0-.637.049l-.539.588a.513.513,0,0,0-.049.637l.539.686a2.428,2.428,0,0,0-.392.979l-.93.147a.477.477,0,0,0-.392.49v.392h3.134A2.017,2.017,0,0,1,123.925,3.085Z" transform="translate(-113.104)" fill="#2699fb"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 480 B |
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="13.412" height="17.882" viewBox="0 0 13.412 17.882">
|
||||
<path id="Path_665" data-name="Path 665" d="M11.735,7.265V5.029a5.029,5.029,0,0,0-10.059,0V7.265A1.647,1.647,0,0,0,0,8.941v7.265a1.681,1.681,0,0,0,1.676,1.676H11.735a1.681,1.681,0,0,0,1.676-1.676V8.941a1.646,1.646,0,0,0-1.676-1.676M2.794,5.029a3.912,3.912,0,0,1,7.823,0V7.265H2.794ZM7.265,13.3v1.229a.559.559,0,1,1-1.118,0V13.3a1.628,1.628,0,0,1-1.118-1.565,1.676,1.676,0,0,1,3.353,0A1.628,1.628,0,0,1,7.265,13.3" fill="#2699fb"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 540 B |
@ -0,0 +1,11 @@
|
||||
<svg id="Group_773" data-name="Group 773" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="19.6" height="16" viewBox="0 0 19.6 16">
|
||||
<defs>
|
||||
<clipPath id="clip-path">
|
||||
<rect id="Rectangle_1471" data-name="Rectangle 1471" width="19.6" height="16" fill="#2699fb"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="Group_18" data-name="Group 18" clip-path="url(#clip-path)">
|
||||
<path id="Path_649" data-name="Path 649" d="M8,14.8a.325.325,0,0,1-.025-.169c.008-.046-.021-.083-.087-.112s-.1-.052-.1-.069-.048-.029-.144-.037L7.5,14.4H3.6a1.925,1.925,0,0,1-1.413-.588A1.926,1.926,0,0,1,1.6,12.4V3.6a1.926,1.926,0,0,1,.587-1.412A1.926,1.926,0,0,1,3.6,1.6h4a.378.378,0,0,0,.256-.081.415.415,0,0,0,.125-.244A2.1,2.1,0,0,0,8.019.981,3.11,3.11,0,0,0,8.012.65Q8,.45,8,.4A.385.385,0,0,0,7.881.119.385.385,0,0,0,7.6,0h-4A3.468,3.468,0,0,0,1.056,1.056,3.467,3.467,0,0,0,0,3.6v8.8a3.467,3.467,0,0,0,1.056,2.544A3.467,3.467,0,0,0,3.6,16h4a.379.379,0,0,0,.256-.081.415.415,0,0,0,.125-.244,2.108,2.108,0,0,0,.038-.294,3.107,3.107,0,0,0-.006-.331Q8,14.85,8,14.8" fill="#2699fb"/>
|
||||
<path id="Path_650" data-name="Path 650" d="M124.2,16.169l-6.8-6.8a.8.8,0,0,0-1.363.563v3.6h-5.6a.811.811,0,0,0-.8.8v4.8a.811.811,0,0,0,.8.8h5.6v3.6a.8.8,0,0,0,1.363.562l6.8-6.8a.785.785,0,0,0,0-1.125" transform="translate(-104.833 -8.731)" fill="#2699fb"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,10 @@
|
||||
<svg id="Group_775" data-name="Group 775" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="13" height="23.853" viewBox="0 0 13 23.853">
|
||||
<defs>
|
||||
<clipPath id="clip-path">
|
||||
<rect id="Rectangle_1493" data-name="Rectangle 1493" width="13" height="23.853" fill="#2699fb"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="Group_774" data-name="Group 774" clip-path="url(#clip-path)">
|
||||
<path id="Path_689" data-name="Path 689" d="M11.306,0H1.67A1.675,1.675,0,0,0,0,1.67V22.183a1.675,1.675,0,0,0,1.67,1.67H11.33A1.675,1.675,0,0,0,13,22.183V1.67A1.7,1.7,0,0,0,11.306,0M6.488,1.312a.477.477,0,1,1-.477.477.479.479,0,0,1,.477-.477M7.919,22.541H5.057v-.954H7.919Zm4.1-2.29H.93V3.6H12.022Z" fill="#2699fb"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 745 B |
@ -0,0 +1,12 @@
|
||||
<svg id="Group_766" data-name="Group 766" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="15" height="16.406" viewBox="0 0 15 16.406">
|
||||
<defs>
|
||||
<clipPath id="clip-path">
|
||||
<rect id="Rectangle_1486" data-name="Rectangle 1486" width="15" height="16.406" fill="#2699fb"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g id="Group_765" data-name="Group 765" clip-path="url(#clip-path)">
|
||||
<path id="Path_666" data-name="Path 666" d="M2.813,6.094H13.125V.937A.938.938,0,0,0,12.187,0H.937A.937.937,0,0,0,0,.937V15a.937.937,0,0,0,.937.937H8.906V12.656H2.813a.469.469,0,0,1,0-.938H8.325a3.924,3.924,0,0,1-.356-1.641V9.844H2.813a.469.469,0,0,1,0-.938h5.33A4.013,4.013,0,0,1,9.375,7.031H2.813a.469.469,0,1,1,0-.938m0-3.75H6.094a.469.469,0,0,1,0,.937H2.813a.469.469,0,1,1,0-.937" fill="#2699fb"/>
|
||||
<path id="Path_667" data-name="Path 667" d="M205.714,160a3.047,3.047,0,1,1-3.047,3.047A3.047,3.047,0,0,1,205.714,160" transform="translate(-193.761 -152.969)" fill="#2699fb"/>
|
||||
<path id="Path_668" data-name="Path 668" d="M228.219,306.24a3.98,3.98,0,0,1-4.219,0v2.948l2.109-.937,2.109.938Z" transform="translate(-214.156 -292.782)" fill="#2699fb"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,4 @@
|
||||
<svg id="Notifications" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<rect id="Rectangle_479" data-name="Rectangle 479" width="16" height="16" fill="none"/>
|
||||
<path id="Path_1" data-name="Path 1" d="M15,14H10a2,2,0,0,1-4,0H1a.961.961,0,0,1-.9-.7,1.068,1.068,0,0,1,.3-1.1A4.026,4.026,0,0,0,2,9V6A6,6,0,0,1,14,6V9a4.026,4.026,0,0,0,1.6,3.2.947.947,0,0,1,.3,1.1A.961.961,0,0,1,15,14Z" transform="translate(-0.063)" fill="#2699fb"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 472 B |
|
After Width: | Height: | Size: 675 B |
@ -0,0 +1,69 @@
|
||||
import 'dart:async';
|
||||
import 'package:car_provider_app/classes/app_state.dart';
|
||||
import 'package:car_provider_app/models/m_response.dart';
|
||||
import 'package:car_provider_app/models/profile/branch.dart';
|
||||
import 'package:car_provider_app/models/profile/categroy.dart';
|
||||
import 'package:car_provider_app/models/profile/document.dart';
|
||||
import 'package:car_provider_app/models/profile/services.dart';
|
||||
import 'package:car_provider_app/models/user/country.dart';
|
||||
import 'package:car_provider_app/models/user/role.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:car_provider_app/classes/consts.dart';
|
||||
import 'package:car_provider_app/models/content_info_model.dart';
|
||||
import 'package:car_provider_app/models/member_model.dart';
|
||||
import 'package:car_provider_app/models/surah_model.dart';
|
||||
import 'package:car_provider_app/models/user/basic_otp.dart';
|
||||
import 'package:car_provider_app/models/user/register_user.dart';
|
||||
|
||||
import '../api_client.dart';
|
||||
|
||||
class BranchApiClent {
|
||||
static final BranchApiClent _instance = BranchApiClent._internal();
|
||||
|
||||
BranchApiClent._internal();
|
||||
|
||||
factory BranchApiClent() => _instance;
|
||||
|
||||
Future<MResponse> createBranch(String branchName, String branchDescription, String cityId, String address, String latitude, String longitude) async {
|
||||
var postParams = {
|
||||
// "id": 0,
|
||||
"serviceProviderID": AppState().getUser.data?.userInfo?.providerId ?? "",
|
||||
"branchName": branchName,
|
||||
"branchDescription": branchDescription,
|
||||
"cityID": cityId,
|
||||
"address": address,
|
||||
"latitude": latitude,
|
||||
"longitude": longitude,
|
||||
"isActive": true
|
||||
};
|
||||
String t = AppState().getUser.data!.accessToken ?? "";
|
||||
print("tokeen " + t);
|
||||
return await ApiClient().postJsonForObject((json) => MResponse.fromJson(json), ApiConsts.createProviderBranch, postParams, token: t);
|
||||
}
|
||||
|
||||
Future<Branch> fetchAllBranches() async {
|
||||
var postParams = {"ServiceProviderID": AppState().getUser.data?.userInfo?.providerId.toString() ?? ""};
|
||||
String t = AppState().getUser.data!.accessToken ?? "";
|
||||
print("tokeen " + t);
|
||||
return await ApiClient().getJsonForObject((json) => Branch.fromJson(json), ApiConsts.ServiceProviderBranchGet, queryParameters: postParams, token: t);
|
||||
}
|
||||
|
||||
Future<Category> fetchBranchCategory() async {
|
||||
var postParams = {"ServiceProviderID": AppState().getUser.data?.userInfo?.providerId.toString() ?? ""};
|
||||
String t = AppState().getUser.data!.accessToken ?? "";
|
||||
print("tokeen " + t);
|
||||
return await ApiClient().getJsonForObject((json) => Category.fromJson(json), ApiConsts.ServiceCategory_Get, queryParameters: postParams, token: t);
|
||||
}
|
||||
|
||||
Future<Services> fetchServices(String serviceCategoryId) async {
|
||||
var postParams = {"ServiceCategoryID": serviceCategoryId};
|
||||
String t = AppState().getUser.data!.accessToken ?? "";
|
||||
print("tokeen " + t);
|
||||
return await ApiClient().getJsonForObject((json) => Services.fromJson(json), ApiConsts.Services_Get, queryParameters: postParams, token: t);
|
||||
}
|
||||
|
||||
Future<MResponse> createService(List<Map<String, dynamic>> map) async {
|
||||
String t = AppState().getUser.data!.accessToken ?? "";
|
||||
return await ApiClient().postJsonForObject((json) => MResponse.fromJson(json), ApiConsts.ServiceProviderService_Create, map, token: t);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
import 'dart:async';
|
||||
import 'package:car_provider_app/classes/app_state.dart';
|
||||
import 'package:car_provider_app/models/m_response.dart';
|
||||
import 'package:car_provider_app/models/profile/document.dart';
|
||||
import 'package:car_provider_app/models/user/country.dart';
|
||||
import 'package:car_provider_app/models/user/role.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:car_provider_app/classes/consts.dart';
|
||||
import 'package:car_provider_app/models/content_info_model.dart';
|
||||
import 'package:car_provider_app/models/member_model.dart';
|
||||
import 'package:car_provider_app/models/surah_model.dart';
|
||||
import 'package:car_provider_app/models/user/basic_otp.dart';
|
||||
import 'package:car_provider_app/models/user/register_user.dart';
|
||||
|
||||
import '../api_client.dart';
|
||||
|
||||
class ProfileApiClent {
|
||||
static final ProfileApiClent _instance = ProfileApiClent._internal();
|
||||
|
||||
ProfileApiClent._internal();
|
||||
|
||||
factory ProfileApiClent() => _instance;
|
||||
|
||||
Future<Document> getServiceProviderDocument(dynamic userId) async {
|
||||
var queryParameters = {
|
||||
"ServiceProviderID": userId.toString(),
|
||||
};
|
||||
String? token = AppState().getUser.data?.accessToken;
|
||||
print(token);
|
||||
return await ApiClient().getJsonForObject((json) => Document.fromJson(json), ApiConsts.GetProviderDocument, queryParameters: queryParameters, token: AppState().getUser.data!.accessToken ?? "");
|
||||
}
|
||||
|
||||
Future<MResponse> serviceProviderDocumentsUpdate(List<DocumentData>? documents) async {
|
||||
List<Map<String, dynamic>> map = [];
|
||||
for (int i = 0; i < documents!.length; i++) {
|
||||
if(documents[i].document!=null){
|
||||
var postParams = {
|
||||
"id": documents[i].id,
|
||||
"serviceProviderID": documents[i].serviceProviderId,
|
||||
"documentID": documents[i].documentId,
|
||||
"documentExt": documents[i].fileExt,
|
||||
"documentImage": documents[i].document,
|
||||
"isActive": true
|
||||
};
|
||||
map.add(postParams);
|
||||
}
|
||||
|
||||
}
|
||||
String t=AppState().getUser.data!.accessToken ?? "";
|
||||
print("tokeen "+t);
|
||||
return await ApiClient().postJsonForObject((json) => MResponse.fromJson(json), ApiConsts.ServiceProviderDocument_Update, map, token: t);
|
||||
}
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
|
||||
class LoginApiClient {
|
||||
static final LoginApiClient _instance = LoginApiClient._internal();
|
||||
|
||||
LoginApiClient._internal();
|
||||
|
||||
factory LoginApiClient() => _instance;
|
||||
|
||||
// Future<CheckMobileAppVersionModel> checkMobileAppVersion() async {
|
||||
// String url = "${ApiConsts.utilitiesRest}CheckMobileAppVersion";
|
||||
// Map<String, dynamic> postParams = {};
|
||||
// postParams.addAll(AppState().postParamsJson);
|
||||
// return await ApiClient().postJsonForObject((json) => CheckMobileAppVersionModel.fromJson(json), url, postParams);
|
||||
// }
|
||||
//
|
||||
// Future<MemberLoginListModel?> memberLogin(String username, String password) async {
|
||||
// String url = "${ApiConsts.erpRest}MemberLogin";
|
||||
// Map<String, dynamic> postParams = {"P_APP_VERSION": "CS", "P_LANGUAGE": "US", "P_PASSWORD": password, "P_USER_NAME": username};
|
||||
// postParams.addAll(AppState().postParamsJson);
|
||||
// return await ApiClient().postJsonForObject((json) {
|
||||
// GenericResponseModel responseData = GenericResponseModel.fromJson(json);
|
||||
// AppState().postParamsObject?.setLogInTokenID = responseData.logInTokenID;
|
||||
// return responseData.memberLoginList;
|
||||
// }, url, postParams);
|
||||
// }
|
||||
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:car_provider_app/classes/consts.dart';
|
||||
import 'package:car_provider_app/models/content_info_model.dart';
|
||||
import 'package:car_provider_app/models/member_model.dart';
|
||||
import 'package:car_provider_app/models/surah_model.dart';
|
||||
|
||||
import 'api_client.dart';
|
||||
|
||||
class TangheemUserApiClient {
|
||||
static final TangheemUserApiClient _instance = TangheemUserApiClient._internal();
|
||||
|
||||
TangheemUserApiClient._internal();
|
||||
|
||||
factory TangheemUserApiClient() => _instance;
|
||||
|
||||
Future<SurahModel> getSurahs() async {
|
||||
String url = "${ApiConsts.baseUrl}AlSuar_Get";
|
||||
var postParams = {};
|
||||
return await ApiClient().postJsonForObject((json) => SurahModel.fromJson(json), url, postParams);
|
||||
}
|
||||
|
||||
Future<MemberModel> getMembers() async {
|
||||
String url = "${ApiConsts.baseUrl}Committee_Get";
|
||||
var postParams = {};
|
||||
return await ApiClient().postJsonForObject((json) => MemberModel.fromJson(json), url, postParams);
|
||||
}
|
||||
|
||||
Future<ContentInfoModel> getContentInfo(int contentId) async {
|
||||
String url = "${ApiConsts.baseUrl}ContentInfo_Get";
|
||||
var postParams = {"contentTypeId": contentId};
|
||||
return await ApiClient().postJsonForObject((json) => ContentInfoModel.fromJson(json), url, postParams);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
import 'package:car_provider_app/models/user/user.dart';
|
||||
|
||||
class AppState {
|
||||
static final AppState _instance = AppState._internal();
|
||||
|
||||
AppState._internal();
|
||||
|
||||
factory AppState() => _instance;
|
||||
|
||||
bool isLogged = false;
|
||||
|
||||
set setLogged(v) => isLogged = v;
|
||||
|
||||
bool? get getIsLogged => isLogged;
|
||||
|
||||
User? _user = null;
|
||||
|
||||
set setUser(v) => _user = v;
|
||||
|
||||
User get getUser => _user??User();
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final mResponse = mResponseFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
MResponse mResponseFromJson(String str) => MResponse.fromJson(json.decode(str));
|
||||
|
||||
String mResponseToJson(MResponse data) => json.encode(data.toJson());
|
||||
|
||||
class MResponse {
|
||||
MResponse({
|
||||
this.totalItemsCount,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory MResponse.fromJson(Map<String, dynamic> json) => MResponse(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final branch = branchFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Branch branchFromJson(String str) => Branch.fromJson(json.decode(str));
|
||||
|
||||
String branchToJson(Branch data) => json.encode(data.toJson());
|
||||
|
||||
class Branch {
|
||||
Branch({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<BranchData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Branch.fromJson(Map<String, dynamic> json) => Branch(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<BranchData>.from(json["data"].map((x) => BranchData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class BranchData {
|
||||
BranchData({
|
||||
this.id,
|
||||
this.serviceProviderId,
|
||||
this.branchName,
|
||||
this.branchDescription,
|
||||
this.cityId,
|
||||
this.address,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.status,
|
||||
});
|
||||
|
||||
int? id;
|
||||
int? serviceProviderId;
|
||||
String? branchName;
|
||||
String? branchDescription;
|
||||
int? cityId;
|
||||
String? address;
|
||||
String? latitude;
|
||||
String? longitude;
|
||||
int? status;
|
||||
|
||||
factory BranchData.fromJson(Map<String, dynamic> json) => BranchData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
serviceProviderId: json["serviceProviderID"] == null ? null : json["serviceProviderID"],
|
||||
branchName: json["branchName"] == null ? null : json["branchName"],
|
||||
branchDescription: json["branchDescription"] == null ? null : json["branchDescription"],
|
||||
cityId: json["cityID"] == null ? null : json["cityID"],
|
||||
address: json["address"] == null ? null : json["address"],
|
||||
latitude: json["latitude"] == null ? null : json["latitude"],
|
||||
longitude: json["longitude"] == null ? null : json["longitude"],
|
||||
status: json["status"] == null ? null : json["status"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"serviceProviderID": serviceProviderId == null ? null : serviceProviderId,
|
||||
"branchName": branchName == null ? null : branchName,
|
||||
"branchDescription": branchDescription == null ? null : branchDescription,
|
||||
"cityID": cityId == null ? null : cityId,
|
||||
"address": address == null ? null : address,
|
||||
"latitude": latitude == null ? null : latitude,
|
||||
"longitude": longitude == null ? null : longitude,
|
||||
"status": status == null ? null : status,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final category = categoryFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Category categoryFromJson(String str) => Category.fromJson(json.decode(str));
|
||||
|
||||
String categoryToJson(Category data) => json.encode(data.toJson());
|
||||
|
||||
class Category {
|
||||
Category({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<CategoryData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Category.fromJson(Map<String, dynamic> json) => Category(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<CategoryData>.from(json["data"].map((x) => CategoryData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class CategoryData {
|
||||
CategoryData({
|
||||
this.id,
|
||||
this.categoryName,
|
||||
this.categoryNameN,
|
||||
this.serviceCategoryIconUrl,
|
||||
this.serviceCategoryImageUrl,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? categoryName;
|
||||
String? categoryNameN;
|
||||
dynamic? serviceCategoryIconUrl;
|
||||
dynamic? serviceCategoryImageUrl;
|
||||
|
||||
factory CategoryData.fromJson(Map<String, dynamic> json) => CategoryData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
categoryName: json["categoryName"] == null ? null : json["categoryName"],
|
||||
categoryNameN: json["categoryNameN"] == null ? null : json["categoryNameN"],
|
||||
serviceCategoryIconUrl: json["serviceCategoryIconUrl"],
|
||||
serviceCategoryImageUrl: json["serviceCategoryImageUrl"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"categoryName": categoryName == null ? null : categoryName,
|
||||
"categoryNameN": categoryNameN == null ? null : categoryNameN,
|
||||
"serviceCategoryIconUrl": serviceCategoryIconUrl,
|
||||
"serviceCategoryImageUrl": serviceCategoryImageUrl,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final document = documentFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Document documentFromJson(String str) => Document.fromJson(json.decode(str));
|
||||
|
||||
String documentToJson(Document data) => json.encode(data.toJson());
|
||||
|
||||
class Document {
|
||||
Document({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<DocumentData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Document.fromJson(Map<String, dynamic> json) => Document(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<DocumentData>.from(json["data"].map((x) => DocumentData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class DocumentData {
|
||||
DocumentData({
|
||||
this.id,
|
||||
this.serviceProviderId,
|
||||
this.documentId,
|
||||
this.documentUrl,
|
||||
this.status,
|
||||
this.comment,
|
||||
this.isActive,
|
||||
this.document,
|
||||
this.fileExt,
|
||||
});
|
||||
|
||||
int? id;
|
||||
int? serviceProviderId;
|
||||
int? documentId;
|
||||
dynamic? documentUrl;
|
||||
int? status;
|
||||
dynamic? comment;
|
||||
bool? isActive;
|
||||
String? document;
|
||||
String? fileExt;
|
||||
|
||||
factory DocumentData.fromJson(Map<String, dynamic> json) => DocumentData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
serviceProviderId: json["serviceProviderID"] == null ? null : json["serviceProviderID"],
|
||||
documentId: json["documentID"] == null ? null : json["documentID"],
|
||||
documentUrl: json["documentURL"],
|
||||
status: json["status"] == null ? null : json["status"],
|
||||
comment: json["comment"],
|
||||
isActive: json["isActive"] == null ? null : json["isActive"],
|
||||
document: null,
|
||||
fileExt: null,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"serviceProviderID": serviceProviderId == null ? null : serviceProviderId,
|
||||
"documentID": documentId == null ? null : documentId,
|
||||
"documentURL": documentUrl,
|
||||
"status": status == null ? null : status,
|
||||
"comment": comment,
|
||||
"isActive": isActive == null ? null : isActive,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final services = servicesFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Services servicesFromJson(String str) => Services.fromJson(json.decode(str));
|
||||
|
||||
String servicesToJson(Services data) => json.encode(data.toJson());
|
||||
|
||||
class Services {
|
||||
Services({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<ServicesData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Services.fromJson(Map<String, dynamic> json) => Services(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<ServicesData>.from(json["data"].map((x) => ServicesData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class ServicesData {
|
||||
ServicesData({
|
||||
this.id,
|
||||
this.description,
|
||||
this.descriptionN,
|
||||
this.serviceIconUrl,
|
||||
this.serviceImageUrl,
|
||||
this.serviceCategoryId,
|
||||
this.categoryName,
|
||||
this.isSelected,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? description;
|
||||
String? descriptionN;
|
||||
dynamic? serviceIconUrl;
|
||||
dynamic? serviceImageUrl;
|
||||
int? serviceCategoryId;
|
||||
dynamic? categoryName;
|
||||
bool? isSelected;
|
||||
|
||||
factory ServicesData.fromJson(Map<String, dynamic> json) => ServicesData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
description: json["description"] == null ? null : json["description"],
|
||||
descriptionN: json["descriptionN"] == null ? null : json["descriptionN"],
|
||||
serviceIconUrl: json["serviceIconUrl"],
|
||||
serviceImageUrl: json["serviceImageUrl"],
|
||||
serviceCategoryId: json["serviceCategoryID"] == null ? null : json["serviceCategoryID"],
|
||||
categoryName: json["categoryName"],
|
||||
isSelected: false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"description": description == null ? null : description,
|
||||
"descriptionN": descriptionN == null ? null : descriptionN,
|
||||
"serviceIconUrl": serviceIconUrl,
|
||||
"serviceImageUrl": serviceImageUrl,
|
||||
"serviceCategoryID": serviceCategoryId == null ? null : serviceCategoryId,
|
||||
"categoryName": categoryName,
|
||||
};
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
class User {
|
||||
int id;
|
||||
|
||||
User(this.id, this.userName, this.userImage, this.createdDate);
|
||||
|
||||
String userName;
|
||||
String userImage;
|
||||
String createdDate;
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final cities = citiesFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Cities citiesFromJson(String str) => Cities.fromJson(json.decode(str));
|
||||
|
||||
String citiesToJson(Cities data) => json.encode(data.toJson());
|
||||
|
||||
class Cities {
|
||||
Cities({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<CityData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Cities.fromJson(Map<String, dynamic> json) => Cities(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<CityData>.from(json["data"].map((x) => CityData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class CityData {
|
||||
CityData({
|
||||
this.id,
|
||||
this.cityName,
|
||||
this.cityNameN,
|
||||
this.countryId,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? cityName;
|
||||
String? cityNameN;
|
||||
int? countryId;
|
||||
|
||||
factory CityData.fromJson(Map<String, dynamic> json) => CityData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
cityName: json["cityName"] == null ? null : json["cityName"],
|
||||
cityNameN: json["cityNameN"] == null ? null : json["cityNameN"],
|
||||
countryId: json["countryID"] == null ? null : json["countryID"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"cityName": cityName == null ? null : cityName,
|
||||
"cityNameN": cityNameN == null ? null : cityNameN,
|
||||
"countryID": countryId == null ? null : countryId,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final country = countryFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Country countryFromJson(String str) => Country.fromJson(json.decode(str));
|
||||
|
||||
String countryToJson(Country data) => json.encode(data.toJson());
|
||||
|
||||
class Country {
|
||||
Country({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<CountryData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Country.fromJson(Map<String, dynamic> json) => Country(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<CountryData>.from(json["data"].map((x) => CountryData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class CountryData {
|
||||
CountryData({
|
||||
this.id,
|
||||
this.countryName,
|
||||
this.countryNameN,
|
||||
this.nationality,
|
||||
this.nationalityN,
|
||||
this.countryCode,
|
||||
this.alpha2Code,
|
||||
this.alpha3Code,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? countryName;
|
||||
String? countryNameN;
|
||||
String? nationality;
|
||||
String? nationalityN;
|
||||
String? countryCode;
|
||||
String? alpha2Code;
|
||||
String? alpha3Code;
|
||||
|
||||
factory CountryData.fromJson(Map<String, dynamic> json) => CountryData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
countryName: json["countryName"] == null ? null : json["countryName"],
|
||||
countryNameN: json["countryNameN"] == null ? null : json["countryNameN"],
|
||||
nationality: json["nationality"] == null ? null : json["nationality"],
|
||||
nationalityN: json["nationalityN"] == null ? null : json["nationalityN"],
|
||||
countryCode: json["countryCode"] == null ? null : json["countryCode"],
|
||||
alpha2Code: json["alpha2Code"] == null ? null : json["alpha2Code"],
|
||||
alpha3Code: json["alpha3Code"] == null ? null : json["alpha3Code"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"countryName": countryName == null ? null : countryName,
|
||||
"countryNameN": countryNameN == null ? null : countryNameN,
|
||||
"nationality": nationality == null ? null : nationality,
|
||||
"nationalityN": nationalityN == null ? null : nationalityN,
|
||||
"countryCode": countryCode == null ? null : countryCode,
|
||||
"alpha2Code": alpha2Code == null ? null : alpha2Code,
|
||||
"alpha3Code": alpha3Code == null ? null : alpha3Code,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final role = roleFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
Role roleFromJson(String str) => Role.fromJson(json.decode(str));
|
||||
|
||||
String roleToJson(Role data) => json.encode(data.toJson());
|
||||
|
||||
class Role {
|
||||
Role({
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.messageStatus,
|
||||
this.message,
|
||||
});
|
||||
|
||||
int? totalItemsCount;
|
||||
List<RoleData>? data;
|
||||
int? messageStatus;
|
||||
String? message;
|
||||
|
||||
factory Role.fromJson(Map<String, dynamic> json) => Role(
|
||||
totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"],
|
||||
data: json["data"] == null ? null : List<RoleData>.from(json["data"].map((x) => RoleData.fromJson(x))),
|
||||
messageStatus: json["messageStatus"] == null ? null : json["messageStatus"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"totalItemsCount": totalItemsCount == null ? null : totalItemsCount,
|
||||
"data": data == null ? null : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"messageStatus": messageStatus == null ? null : messageStatus,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class RoleData {
|
||||
RoleData({
|
||||
this.id,
|
||||
this.roleName,
|
||||
this.roleNameN,
|
||||
this.isActive,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? roleName;
|
||||
String? roleNameN;
|
||||
bool? isActive;
|
||||
|
||||
factory RoleData.fromJson(Map<String, dynamic> json) => RoleData(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
roleName: json["roleName"] == null ? null : json["roleName"],
|
||||
roleNameN: json["roleNameN"] == null ? null : json["roleNameN"],
|
||||
isActive: json["isActive"] == null ? null : json["isActive"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"roleName": roleName == null ? null : roleName,
|
||||
"roleNameN": roleNameN == null ? null : roleNameN,
|
||||
"isActive": isActive == null ? null : isActive,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
class AppMap extends StatefulWidget {
|
||||
final CameraPositionCallback onCameraMove;
|
||||
Map initialCamera;
|
||||
|
||||
late AppMapState _state;
|
||||
final Function onMapCreated;
|
||||
|
||||
AppMap(this.initialCamera, {required this.onCameraMove, required this.onMapCreated});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _state = AppMapState();
|
||||
|
||||
moveTo({required CameraPosition cameraPostion}) {
|
||||
_state.googleMapController.animateCamera(CameraUpdate.newCameraPosition(cameraPostion));
|
||||
}
|
||||
}
|
||||
|
||||
class AppMapState extends State<AppMap> {
|
||||
bool isHuawei = false;
|
||||
|
||||
Completer<GoogleMapController> _googleMapControllerComp = Completer();
|
||||
late GoogleMapController googleMapController;
|
||||
|
||||
checkIsHuawei() async {
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (isHuawei == null) return CircularProgressIndicator();
|
||||
return googleMap();
|
||||
}
|
||||
|
||||
Widget googleMap() {
|
||||
return GoogleMap(
|
||||
mapType: MapType.normal,
|
||||
zoomControlsEnabled: true,
|
||||
myLocationButtonEnabled: true,
|
||||
myLocationEnabled: true,
|
||||
initialCameraPosition: CameraPosition.fromMap(widget.initialCamera) ?? CameraPosition(target: LatLng(-26.1711459, 27.9002758), zoom: 2.0),
|
||||
onCameraMove: widget.onCameraMove,
|
||||
onMapCreated: (GoogleMapController controller) {
|
||||
googleMapController = controller;
|
||||
_googleMapControllerComp.complete(controller);
|
||||
widget.onMapCreated();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,156 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:car_provider_app/utils/navigator.dart';
|
||||
import 'package:car_provider_app/widgets/show_fill_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geocoding/geocoding.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
import 'map_selection_widget.dart';
|
||||
|
||||
class PickLocationPage extends StatefulWidget {
|
||||
Function(double, double, String) onPickAddress;
|
||||
|
||||
PickLocationPage({required this.onPickAddress});
|
||||
|
||||
@override
|
||||
State<PickLocationPage> createState() => _PickLocationPageState();
|
||||
}
|
||||
|
||||
class _PickLocationPageState extends State<PickLocationPage> {
|
||||
double latitude = 0;
|
||||
double longitude = 0;
|
||||
|
||||
final Set<Marker> markers = new Set();
|
||||
late AppMap appMap;
|
||||
|
||||
static CameraPosition _kGooglePlex = CameraPosition(
|
||||
target: LatLng(37.42796133580664, -122.085749655962),
|
||||
zoom: 14.4746,
|
||||
);
|
||||
late LatLng currentPostion;
|
||||
Completer<GoogleMapController> mapController = Completer();
|
||||
final ValueNotifier<String> _counter = ValueNotifier<String>("");
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
appMap = AppMap(
|
||||
_kGooglePlex.toMap() as Map,
|
||||
onCameraMove: (camera) {
|
||||
_updatePosition(camera);
|
||||
},
|
||||
onMapCreated: () {
|
||||
// goToCurrentLocation();
|
||||
_getUserLocation();
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Pick Location"),
|
||||
),
|
||||
body: Container(
|
||||
child: Stack(
|
||||
children: [
|
||||
if (appMap != null) appMap,
|
||||
ValueListenableBuilder<String>(
|
||||
builder: (BuildContext context, String value, Widget? child) {
|
||||
// This builder will only get called when the _counter
|
||||
// is updated.
|
||||
return value.isNotEmpty
|
||||
? Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Text(value ?? ""),
|
||||
)),
|
||||
)
|
||||
: Container();
|
||||
},
|
||||
valueListenable: _counter,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Icon(
|
||||
Icons.place,
|
||||
color: Colors.red,
|
||||
size: 50,
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: ShowFillButton(
|
||||
title: "Pick Address",
|
||||
onPressed: () {
|
||||
widget.onPickAddress(latitude, longitude, _counter.value);
|
||||
pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _updatePosition(CameraPosition _position) async {
|
||||
latitude = _position.target.latitude;
|
||||
longitude = _position.target.longitude;
|
||||
List<Placemark> placemarks = await placemarkFromCoordinates(latitude, longitude);
|
||||
_counter.value = (placemarks.first.name) ?? "" + " " + (placemarks.first.street ?? "") + " " + (placemarks.first.country ?? "");
|
||||
}
|
||||
|
||||
void _getUserLocation() async {
|
||||
if (await Permission.location.request().isGranted) {
|
||||
var position = await GeolocatorPlatform.instance.getCurrentPosition();
|
||||
currentPostion = LatLng(position.latitude, position.longitude);
|
||||
latitude = position.latitude;
|
||||
longitude = position.longitude;
|
||||
setMap();
|
||||
} else {
|
||||
requestPermissions().then(
|
||||
(value) async {
|
||||
if (value[Permission.location]!.isGranted) {
|
||||
var position = await GeolocatorPlatform.instance.getCurrentPosition();
|
||||
currentPostion = LatLng(position.latitude, position.longitude);
|
||||
latitude = position.latitude;
|
||||
longitude = position.longitude;
|
||||
setMap();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
setMap() {
|
||||
setState(() {
|
||||
_kGooglePlex = CameraPosition(
|
||||
target: currentPostion,
|
||||
zoom: 14.4746,
|
||||
);
|
||||
appMap.moveTo(cameraPostion: _kGooglePlex);
|
||||
});
|
||||
}
|
||||
|
||||
Future<String> getCurrentAddress() async {
|
||||
List<Placemark> placemarks = await placemarkFromCoordinates(latitude, longitude);
|
||||
return placemarks.first.name ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
Future<Map<Permission, PermissionStatus>> requestPermissions() async {
|
||||
var permissionResults = [Permission.calendar].request();
|
||||
return permissionResults;
|
||||
}
|
||||
@ -0,0 +1,185 @@
|
||||
import 'package:car_provider_app/api/client/branch_api_client.dart';
|
||||
import 'package:car_provider_app/classes/utils.dart';
|
||||
import 'package:car_provider_app/models/m_response.dart';
|
||||
import 'package:car_provider_app/models/profile/branch.dart';
|
||||
import 'package:car_provider_app/models/profile/categroy.dart';
|
||||
import 'package:car_provider_app/models/profile/services.dart';
|
||||
import 'package:car_provider_app/models/user/country.dart';
|
||||
import 'package:car_provider_app/widgets/dropdown/dropdow_field.dart';
|
||||
import 'package:car_provider_app/widgets/show_fill_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:car_provider_app/extensions/int_extensions.dart';
|
||||
import 'package:car_provider_app/extensions/string_extensions.dart';
|
||||
|
||||
class CreateServicesPage extends StatefulWidget {
|
||||
@override
|
||||
State<CreateServicesPage> createState() => _CreateServicesPageState();
|
||||
}
|
||||
|
||||
class _CreateServicesPageState extends State<CreateServicesPage> {
|
||||
String? branchName;
|
||||
int categoryId = -1, branchId = -1;
|
||||
|
||||
List<DropValue> countryDropList = [];
|
||||
List<DropValue> categoryDropList = [];
|
||||
|
||||
Branch? branch;
|
||||
Category? category;
|
||||
Services? services;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
fetchBranches();
|
||||
}
|
||||
|
||||
fetchBranches() async {
|
||||
branch = await BranchApiClent().fetchAllBranches();
|
||||
setState(() {
|
||||
branch!.data?.forEach((element) {
|
||||
countryDropList.add(new DropValue(element.id ?? 0, ((element.branchName!.isEmpty ? "N/A" : element.branchName) ?? "N/A"), ""));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
fetchBrancheCategory() async {
|
||||
category = await BranchApiClent().fetchBranchCategory();
|
||||
setState(() {
|
||||
category!.data?.forEach((element) {
|
||||
categoryDropList.add(new DropValue(element.id ?? 0, ((element.categoryName!.isEmpty ? "N/A" : element.categoryName) ?? "N/A"), ""));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
fetchServices() async {
|
||||
services = await BranchApiClent().fetchServices(categoryId.toString());
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Define Services"),
|
||||
),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
branch != null
|
||||
? DropdownField((DropValue value) {
|
||||
setState(() {
|
||||
// countryCode = value.subValue;
|
||||
// countryId = value.id;
|
||||
// fetchCites();
|
||||
branchId = value.id;
|
||||
fetchBrancheCategory();
|
||||
});
|
||||
}, list: countryDropList, hint: "Select Branch")
|
||||
: CircularProgressIndicator(),
|
||||
12.height,
|
||||
(category != null)
|
||||
? DropdownField((DropValue value) {
|
||||
setState(() {
|
||||
// countryCode = value.subValue;
|
||||
// countryId = value.id;
|
||||
// fetchCites();
|
||||
categoryId = value.id;
|
||||
fetchServices();
|
||||
});
|
||||
}, list: categoryDropList, hint: "Select Service Category")
|
||||
: branchId == -1
|
||||
? Container()
|
||||
: CircularProgressIndicator(),
|
||||
12.height,
|
||||
if (services != null)
|
||||
ListView.separated(
|
||||
itemBuilder: (context, index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: services!.data![index].isSelected,
|
||||
onChanged: (v) {
|
||||
setState(() {
|
||||
services!.data![index].isSelected = v;
|
||||
});
|
||||
},
|
||||
),
|
||||
12.width,
|
||||
(services!.data![index].description ?? "").toText12()
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) {
|
||||
return 1.height;
|
||||
},
|
||||
itemCount: services!.data!.length,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (checkServicesSelection())
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: ShowFillButton(
|
||||
title: "Save",
|
||||
width: double.infinity,
|
||||
onPressed: () {
|
||||
createService();
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
bool checkServicesSelection() {
|
||||
bool isServiceSelected = false;
|
||||
try {
|
||||
services!.data!.forEach((element) {
|
||||
if (element.isSelected ?? false) isServiceSelected = true;
|
||||
});
|
||||
} catch (e) {
|
||||
isServiceSelected = false;
|
||||
}
|
||||
|
||||
return isServiceSelected;
|
||||
}
|
||||
|
||||
createService() async {
|
||||
List<Map<String, dynamic>> map = [];
|
||||
for (int i = 0; i < services!.data!.length; i++) {
|
||||
if (services!.data![i].isSelected ?? false) {
|
||||
var postParams = {
|
||||
// "id": services!.data![i].id,
|
||||
"providerBranchID": branchId,
|
||||
"serviceID": services!.data![i].id,
|
||||
"isAllowAppointment": true,
|
||||
"isActive": true
|
||||
};
|
||||
map.add(postParams);
|
||||
}
|
||||
}
|
||||
Utils.showLoading(context);
|
||||
MResponse mResponse = await BranchApiClent().createService(map);
|
||||
Utils.hideLoading(context);
|
||||
Utils.showToast(mResponse.message ?? "");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
import 'package:car_provider_app/config/routes.dart';
|
||||
import 'package:car_provider_app/extensions/string_extensions.dart';
|
||||
import 'package:car_provider_app/utils/navigator.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class DealershipPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Dealership Setting"),
|
||||
),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: Column(
|
||||
children: [
|
||||
ListTile(
|
||||
leading: SvgPicture.asset("assets/icons/ic_settings.svg"),
|
||||
title: "General".toText12(),
|
||||
),
|
||||
ListTile(
|
||||
leading: SvgPicture.asset("assets/icons/ic_branchs.svg"),
|
||||
title: "Define Branches".toText12(),
|
||||
onTap: () {
|
||||
navigateWithName(context, AppRoutes.defineBranch);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: SvgPicture.asset("assets/icons/ic_services.svg"),
|
||||
title: "Define Services".toText12(),
|
||||
onTap: () {
|
||||
navigateWithName(context, AppRoutes.createServices);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: SvgPicture.asset("assets/icons/ic_provider.svg"),
|
||||
title: "Define Providers".toText12(),
|
||||
),
|
||||
ListTile(
|
||||
leading: SvgPicture.asset("assets/icons/ic_close_account.svg"),
|
||||
title: "Close Account".toText12(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,163 @@
|
||||
import 'package:car_provider_app/api/client/branch_api_client.dart';
|
||||
import 'package:car_provider_app/api/client/user_api_client.dart';
|
||||
import 'package:car_provider_app/classes/utils.dart';
|
||||
import 'package:car_provider_app/extensions/int_extensions.dart';
|
||||
import 'package:car_provider_app/models/m_response.dart';
|
||||
import 'package:car_provider_app/models/user/cities.dart';
|
||||
import 'package:car_provider_app/models/user/country.dart';
|
||||
import 'package:car_provider_app/pages/location/pick_location_page.dart';
|
||||
import 'package:car_provider_app/utils/utils.dart';
|
||||
import 'package:car_provider_app/widgets/dropdown/dropdow_field.dart';
|
||||
import 'package:car_provider_app/widgets/show_fill_button.dart';
|
||||
import 'package:car_provider_app/widgets/txt_field.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DefineBranchPage extends StatefulWidget {
|
||||
@override
|
||||
State<DefineBranchPage> createState() => _DefineBranchPageState();
|
||||
}
|
||||
|
||||
class _DefineBranchPageState extends State<DefineBranchPage> {
|
||||
String countryCode = "", address = "", branchName = "", branchDescription = "";
|
||||
double latitude = 0, longitude = 0;
|
||||
int role = -1, countryId = -1, cityId = -1;
|
||||
|
||||
List<DropValue> countryDropList = [];
|
||||
List<DropValue> citiesDropList = [];
|
||||
|
||||
Country? country;
|
||||
Cities? cities;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
fetchCountry();
|
||||
}
|
||||
|
||||
fetchCountry() async {
|
||||
country = await UserApiClent().getAllCountries();
|
||||
setState(() {
|
||||
country!.data?.forEach((element) {
|
||||
countryDropList.add(new DropValue(element.id ?? 0, (element.countryName ?? "") + " " + (element.countryCode ?? ""), element.countryCode ?? ""));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
fetchCites() async {
|
||||
cities = await UserApiClent().getAllCites(countryId.toString());
|
||||
setState(() {
|
||||
cities!.data?.forEach((element) {
|
||||
citiesDropList.add(new DropValue(element.id ?? 0, (element.cityName ?? ""), element.id.toString() ?? ""));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
"Define Branch",
|
||||
),
|
||||
),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
children: [
|
||||
country != null
|
||||
? DropdownField((DropValue value) {
|
||||
setState(() {
|
||||
countryCode = value.subValue;
|
||||
countryId = value.id;
|
||||
fetchCites();
|
||||
});
|
||||
}, list: countryDropList, hint: "Chosse Country")
|
||||
: CircularProgressIndicator(),
|
||||
12.height,
|
||||
if (countryId != -1)
|
||||
cities != null
|
||||
? DropdownField((DropValue value) {
|
||||
setState(() {
|
||||
// countryCode = value.subValue;
|
||||
cityId = value.id;
|
||||
});
|
||||
}, list: citiesDropList, hint: "Chosse City")
|
||||
: CircularProgressIndicator(),
|
||||
12.height,
|
||||
if (cityId != -1)
|
||||
Column(
|
||||
children: [
|
||||
TxtField(
|
||||
hint: "Branch Name",
|
||||
value: branchName,
|
||||
onChanged: (v) {
|
||||
branchName = v;
|
||||
},
|
||||
),
|
||||
12.height,
|
||||
TxtField(
|
||||
hint: "Branch Description",
|
||||
value: branchDescription,
|
||||
onChanged: (v) {
|
||||
branchDescription = v;
|
||||
},
|
||||
),
|
||||
12.height,
|
||||
TxtField(
|
||||
hint: "Address",
|
||||
isNeedClickAll: true,
|
||||
maxLines: 5,
|
||||
value: address,
|
||||
// onChanged: (v) {},
|
||||
),
|
||||
12.height,
|
||||
ShowFillButton(
|
||||
title: "Pick Address",
|
||||
onPressed: () {
|
||||
navigateTo(
|
||||
context,
|
||||
PickLocationPage(
|
||||
onPickAddress: (double latitude, double longitude, String address) {
|
||||
setState(() {
|
||||
this.latitude = latitude;
|
||||
this.longitude = longitude;
|
||||
this.address = address;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: ShowFillButton(
|
||||
title: "Create Branch",
|
||||
onPressed: () async {
|
||||
Utils.showLoading(context);
|
||||
MResponse res = await BranchApiClent().createBranch(branchName, branchDescription, cityId.toString(), address, latitude.toString(), longitude.toString());
|
||||
Utils.hideLoading(context);
|
||||
Utils.showToast(res.message ?? "");
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,126 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:car_provider_app/api/client/profile_api_client.dart';
|
||||
import 'package:car_provider_app/classes/app_state.dart';
|
||||
import 'package:car_provider_app/classes/utils.dart';
|
||||
import 'package:car_provider_app/models/profile/document.dart';
|
||||
import 'package:car_provider_app/utils/utils.dart';
|
||||
import 'package:car_provider_app/widgets/show_fill_button.dart';
|
||||
import 'package:car_provider_app/widgets/txt_field.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:car_provider_app/extensions/int_extensions.dart';
|
||||
|
||||
class DefineLicensePage extends StatefulWidget {
|
||||
@override
|
||||
State<DefineLicensePage> createState() => _DefineLicensePageState();
|
||||
}
|
||||
|
||||
class _DefineLicensePageState extends State<DefineLicensePage> {
|
||||
Document? document;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
getDocuments();
|
||||
}
|
||||
|
||||
getDocuments() async {
|
||||
document = await ProfileApiClent().getServiceProviderDocument(AppState().getUser.data!.userInfo!.providerId ?? 0);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Define Licenses"),
|
||||
),
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: showWidget(),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: ShowFillButton(
|
||||
title: "Update",
|
||||
width: double.infinity,
|
||||
onPressed: () {
|
||||
Utils.showLoading(context);
|
||||
ProfileApiClent().serviceProviderDocumentsUpdate(document!.data).then((value) {
|
||||
Utils.hideLoading(context);
|
||||
if (value.messageStatus == 1) {
|
||||
Utils.showToast("Documents uploaded successfully");
|
||||
} else {
|
||||
Utils.showToast(value.message ?? "");
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget showWidget() {
|
||||
if (document != null) {
|
||||
return document!.data!.length == 0
|
||||
? Text("Something went wrong")
|
||||
: ListView.separated(
|
||||
itemBuilder: (context, index) {
|
||||
return Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: TxtField(
|
||||
hint: "Select Attachment",
|
||||
value: document?.data![index].documentUrl ?? "",
|
||||
isNeedClickAll: true,
|
||||
maxLines: 2,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
selectFile(index);
|
||||
},
|
||||
icon: Icon(Icons.insert_link_rounded),
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) {
|
||||
return 12.height;
|
||||
},
|
||||
padding: EdgeInsets.all(12),
|
||||
itemCount: document!.data!.length,
|
||||
);
|
||||
} else {
|
||||
return Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
selectFile(int index) async {
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles(type: FileType.custom, allowedExtensions: ['png', 'pdf', 'jpeg']);
|
||||
|
||||
if (result != null) {
|
||||
File file = File(result.files.single.path ?? "");
|
||||
|
||||
document!.data![index].document = convertFileToBase64(file);
|
||||
document!.data![index].fileExt = checkFileExt(file.path);
|
||||
setState(() {
|
||||
document!.data![index].documentUrl = result.files.single.path ?? "";
|
||||
});
|
||||
} else {
|
||||
// User canceled the picker
|
||||
}
|
||||
}
|
||||
}
|
||||