Merge branch 'development_new_design_2.0' into new_design_sikander

# Conflicts:
#	lib/pages/DrawerPages/notifications/notification_details_page.dart
#	lib/uitl/translations_delegate_base.dart
merge-requests/522/head
Sikander Saleem 4 years ago
commit 00f63cd288

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="31.264" height="31.244" viewBox="0 0 31.264 31.244">
<g id="bmi" transform="translate(0 -0.159)">
<path id="Path_5168" data-name="Path 5168" d="M15.632.159A15.629,15.629,0,0,0,.549,19.865a.915.915,0,0,0,.884.676h28.4a.915.915,0,0,0,.884-.676A15.629,15.629,0,0,0,15.632.159ZM6.923,16.7H5.2a.915.915,0,1,1,0-1.831H6.923a.915.915,0,1,1,0,1.831Zm1.959-4.812a.915.915,0,0,1-1.25.335l-1.495-.863a.915.915,0,1,1,.915-1.585l1.495.863A.915.915,0,0,1,8.882,11.884Zm2.853-2.853a.915.915,0,0,1-1.25-.335L9.621,7.2a.915.915,0,0,1,1.585-.915l.863,1.495A.915.915,0,0,1,11.735,9.032Zm2.981-3.686a.915.915,0,1,1,1.831,0V7.072a.915.915,0,0,1-1.831,0Zm4.431,8.214-2.868,2.868a.915.915,0,0,1-1.295-1.295l2.868-2.868a.915.915,0,1,1,1.295,1.295ZM21.642,7.2,20.779,8.7a.915.915,0,0,1-1.585-.915l.863-1.495a.915.915,0,1,1,1.585.915Zm.739,4.683a.915.915,0,0,1,.335-1.25l1.495-.863a.915.915,0,0,1,.915,1.585l-1.495.863A.915.915,0,0,1,22.381,11.884ZM26.067,16.7H24.34a.915.915,0,1,1,0-1.831h1.726a.915.915,0,0,1,0,1.831Z" transform="translate(0)" fill="#28323a"/>
<path id="Path_5169" data-name="Path 5169" d="M221.344,361.522a1.084,1.084,0,0,0-2.1-.086l-1.336,4.686c-.007-.024-1.388-4.7-1.4-4.728a1.084,1.084,0,0,0-2.089.14l0,.01-1.3,7.21a.915.915,0,1,0,1.8.325l.74-4.1c.007.024,1.224,4.151,1.232,4.175a1.084,1.084,0,0,0,2.066-.042l1.18-4.139.787,4.118a.915.915,0,1,0,1.8-.344Z" transform="translate(-200.093 -338.488)" fill="#28323a"/>
<path id="Path_5170" data-name="Path 5170" d="M404.853,360.6a.915.915,0,0,0-.915.915v7.4a.915.915,0,1,0,1.831,0v-7.4a.915.915,0,0,0-.915-.915Z" transform="translate(-379.273 -338.434)" fill="#28323a"/>
<path id="Path_5171" data-name="Path 5171" d="M83.341,364.651a2.617,2.617,0,0,0-2.192-4.049H79a.915.915,0,0,0-.915.915v7.4a.915.915,0,0,0,.915.915h0c.02,0,1.985-.009,2.522-.009a2.907,2.907,0,0,0,1.817-5.177Zm-3.428-2.219h1.235a.788.788,0,0,1,0,1.577c-.374,0-.423,0-1.235,0ZM81.524,368l-1.611,0v-2.159c.565,0,.3,0,1.611,0a1.078,1.078,0,0,1,0,2.155Z" transform="translate(-73.315 -338.434)" fill="#28323a"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25.201" height="31.945" viewBox="0 0 25.201 31.945">
<g id="calories" transform="translate(-8 -2.225)">
<path id="Path_5172" data-name="Path 5172" d="M34.146,41.573a.573.573,0,0,0-1.146,0v1.146h1.146Z" transform="translate(-10.681 -16.566)"/>
<path id="Path_5173" data-name="Path 5173" d="M28.958,12.5a4.577,4.577,0,0,1-2.373,2.713.573.573,0,0,1-.826-.573C26.515,7.079,22,3.717,17.9,2.225a11.467,11.467,0,0,1,.978,4.453c0,3.827-2.674,5.716-5.261,7.543C10.858,16.173,8,18.191,8,22.715a10.933,10.933,0,0,0,3.745,8.14,10.31,10.31,0,1,1,17.711,0,10.933,10.933,0,0,0,3.745-8.14C33.2,18.168,30.379,14.206,28.958,12.5Z"/>
<path id="Path_5174" data-name="Path 5174" d="M23.162,44.751a13.593,13.593,0,0,0,5.1-.984,9.164,9.164,0,1,0-10.2,0,13.6,13.6,0,0,0,5.1.984Zm5.155-10.31a.573.573,0,1,1,1.146,0V38.45h.573a.573.573,0,1,1,0,1.146H28.889a.573.573,0,0,1-.573-.573Zm-4.582,1.146a1.718,1.718,0,0,1,3.437,0v3.437a.573.573,0,0,1-1.146,0V37.878H24.88v1.146a.573.573,0,0,1-1.146,0Zm-4.582,0a1.718,1.718,0,0,1,3.437,0,.573.573,0,0,1-1.146,0,.573.573,0,0,0-1.146,0v2.291a.573.573,0,0,0,1.146,0,.573.573,0,0,1,1.146,0,1.718,1.718,0,0,1-3.437,0Zm-1.6,3.78-.687-.916v.573a.573.573,0,0,1-1.146,0V34.441a.573.573,0,0,1,1.146,0v.573l.687-.916a.573.573,0,1,1,.916.687L17,36.732l1.461,1.947a.573.573,0,0,1-.916.687Z" transform="translate(-2.561 -10.58)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25.382" height="34.875" viewBox="0 0 25.382 34.875">
<g id="blood-drop" transform="translate(-6.533 0.001)">
<path id="Subtraction_3" data-name="Subtraction 3" d="M12803.225,15099.874a12.708,12.708,0,0,1-12.691-12.7c0-5.237,6.711-14.37,10.315-19.277l.017-.022c.773-1.055,1.5-2.052,1.654-2.335a.735.735,0,0,1,.462-.5.71.71,0,0,1,.24-.041.722.722,0,0,1,.567.272c.328.408,3.3,4.116,6.249,8.64a61,61,0,0,1,4.052,7.069,15.7,15.7,0,0,1,1.825,6.2A12.708,12.708,0,0,1,12803.225,15099.874Zm3.823-15.174a.714.714,0,1,0,0,1.429h1.342v5.158a.714.714,0,0,0,1.429,0v-5.158h1.353a.714.714,0,0,0,0-1.429Zm-5.469,5.894h2.524l.375.954a.711.711,0,0,0,.667.451.7.7,0,0,0,.258-.049.715.715,0,0,0,.405-.925l-.55-1.4-.011-.03-1.739-4.437a.72.72,0,0,0-.667-.455.728.728,0,0,0-.663.455l-2.3,5.87a.716.716,0,0,0,.405.925.681.681,0,0,0,.258.049.709.709,0,0,0,.667-.451l.371-.953Zm-6.306-5.894a.715.715,0,0,0-.712.717v5.87a.714.714,0,0,0,1.429,0v-2.406h1.929a.714.714,0,1,0,0-1.429h-1.929v-1.323h1.929a.714.714,0,1,0,0-1.429Zm8.272,4.465h-1.405l.7-1.793.7,1.792Z" transform="translate(-12784 -15065)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,15 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="30.431" viewBox="0 0 25 30.431">
<g id="Page-1" transform="translate(0.009)">
<g id="_043---Calculating-Calories" data-name="043---Calculating-Calories" transform="translate(-0.009)">
<path id="Shape" d="M13.322,35.977a2.816,2.816,0,0,0-1.714-1.4,3.033,3.033,0,0,0-2.416.508,3.077,3.077,0,0,1-1.141.44v.873a.543.543,0,0,1-1.087,0v-.873a3.1,3.1,0,0,1-1.141-.44,3.346,3.346,0,0,0-1.8-.586,2.453,2.453,0,0,0-.618.078,2.817,2.817,0,0,0-1.715,1.4,7.1,7.1,0,0,0-.37,5.3C2.21,44.468,4.6,46.632,6.644,46.1a2.415,2.415,0,0,0,.594-.24.543.543,0,0,1,.534,0,2.391,2.391,0,0,0,.592.239A3.615,3.615,0,0,0,11.8,44.756a.489.489,0,0,1,.06-.066,8.4,8.4,0,0,0,1.831-3.411,7.085,7.085,0,0,0-.366-5.3Zm-9.37.7a.781.781,0,0,0-.373.386A5,5,0,0,0,3.42,40.7a.543.543,0,0,1-1.047.292,6.02,6.02,0,0,1,.264-4.468,1.746,1.746,0,0,1,1.044-.9.544.544,0,0,1,.272,1.053Z" transform="translate(-0.991 -15.751)" fill="#28323a"/>
<rect id="Rectangle-path" width="2" height="3" rx="1" transform="translate(20 11)" fill="#28323a"/>
<path id="Shape-2" data-name="Shape" d="M8.727,31.264c.326-.093.549-.253.592-.428s-.078-.421-.326-.655a3.2,3.2,0,0,0-1.4-.713,2.044,2.044,0,0,0-.234-.042h0a6.7,6.7,0,0,0-1.453.023.543.543,0,0,0-.254.994,5.23,5.23,0,0,0,1.508.8A3.2,3.2,0,0,0,8.727,31.264Z" transform="translate(-3.005 -13.423)" fill="#28323a"/>
<rect id="Rectangle-path-2" data-name="Rectangle-path" width="2" height="3" rx="1" transform="translate(20 17)" fill="#28323a"/>
<path id="Shape-3" data-name="Shape" d="M24.684,9.891h9.409V5H27.352Z" transform="translate(-11.81 -2.283)" fill="#28323a"/>
<rect id="Rectangle-path-3" data-name="Rectangle-path" width="2" height="3" rx="1" transform="translate(20 23)" fill="#28323a"/>
<path id="Shape-4" data-name="Shape" d="M28.475,0H11.63A1.63,1.63,0,0,0,10,1.63V15a4.222,4.222,0,0,1,1.844.967,2.584,2.584,0,0,1,.2.212A4.1,4.1,0,0,1,13.894,14.7a.543.543,0,0,1,.347,1.029,3.478,3.478,0,0,0-2,2.908,1.956,1.956,0,0,0,.48-.221,4.094,4.094,0,0,1,3.275-.648,3.881,3.881,0,0,1,2.384,1.914,8.2,8.2,0,0,1,.476,6.14,9.691,9.691,0,0,1-1.4,2.977H28.475a1.63,1.63,0,0,0,1.63-1.63V1.63A1.63,1.63,0,0,0,28.475,0ZM22.5,25.539a1.63,1.63,0,0,1-1.63,1.63h-.554a.543.543,0,1,1,0-1.087h.554a.543.543,0,0,0,.543-.543v-1.63a.543.543,0,0,0-.543-.543.553.553,0,0,1-.554-.543.534.534,0,0,1,.533-.543h.022a1.63,1.63,0,0,1,1.63,1.63Zm0-5.977a1.63,1.63,0,0,1-1.63,1.63h-.342a.543.543,0,1,1,0-1.087h.342a.543.543,0,0,0,.543-.543v-1.63a.543.543,0,0,0-.543-.543h-1.63a.529.529,0,0,0-.4.186.544.544,0,1,1-.834-.7,1.606,1.606,0,0,1,1.237-.575h1.63a1.63,1.63,0,0,1,1.63,1.63ZM21.776,14.5a2.4,2.4,0,0,1-1.724.716H15.977a.543.543,0,0,1,0-1.087h4.075a1.358,1.358,0,0,0,0-2.717H14.075a1.367,1.367,0,0,0-1.358,1.358,1.3,1.3,0,0,0,.152.617.544.544,0,1,1-.956.517,2.445,2.445,0,0,1,2.163-3.579h5.977A2.448,2.448,0,0,1,22.5,12.769,2.41,2.41,0,0,1,21.776,14.5Zm6.7,11.04a1.63,1.63,0,0,1-1.63,1.63h-1.63a1.63,1.63,0,0,1-1.63-1.63v-1.63a1.63,1.63,0,0,1,1.63-1.63h1.63a1.63,1.63,0,0,1,1.63,1.63Zm0-5.977a1.63,1.63,0,0,1-1.63,1.63h-1.63a1.63,1.63,0,0,1-1.63-1.63v-1.63a1.63,1.63,0,0,1,1.63-1.63h1.63a1.63,1.63,0,0,1,1.63,1.63Zm0-5.977a1.63,1.63,0,0,1-1.63,1.63h-1.63a1.63,1.63,0,0,1-1.63-1.63v-1.63a1.63,1.63,0,0,1,1.63-1.63h1.63a1.63,1.63,0,0,1,1.63,1.63Zm0-5.977a1.087,1.087,0,0,1-1.087,1.087H12.717A1.087,1.087,0,0,1,11.63,7.607V2.717A1.087,1.087,0,0,1,12.717,1.63H27.388a1.087,1.087,0,0,1,1.087,1.087Z" transform="translate(-5.105)" fill="#28323a"/>
<path id="Shape-5" data-name="Shape" d="M15,5V9.891h.764L18.432,5Z" transform="translate(-7.388 -2.283)" fill="#28323a"/>
<path id="Shape-6" data-name="Shape" d="M21.352,5,18.684,9.891h2.022L23.374,5Z" transform="translate(-9.07 -2.283)" fill="#28323a"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="35.796" height="32.157" viewBox="0 0 35.796 32.157">
<g id="complex" transform="translate(0 -26.024)">
<path id="Path_5175" data-name="Path 5175" d="M343.608,401.336v4.874a1.043,1.043,0,1,0,2.085,0v-4.875a8.972,8.972,0,0,1-2.085,0Z" transform="translate(-319.585 -349.072)"/>
<path id="Path_5176" data-name="Path 5176" d="M263.691,36.909a6.182,6.182,0,0,0-5.238-6.109,5.546,5.546,0,0,0-10.984,0,6.149,6.149,0,0,0-2.443.938,27.337,27.337,0,0,1,2.221,10.89,15.743,15.743,0,0,1-1.265,6.342,8.945,8.945,0,0,0,5.936,3.295V46.747l-2.153-2.258a1.043,1.043,0,0,1,1.509-1.439l.644.675V42.2l-2.153-2.258a1.043,1.043,0,0,1,1.509-1.439l.644.675V37.65l-2.153-2.258a1.043,1.043,0,0,1,1.509-1.439l.644.675V32.52a1.043,1.043,0,1,1,2.085,0v2.108l.644-.675a1.043,1.043,0,1,1,1.509,1.439L254,37.65v1.527l.644-.675a1.043,1.043,0,1,1,1.509,1.439L254,42.2v1.527l.644-.675a1.043,1.043,0,0,1,1.509,1.439L254,46.747v5.517a8.954,8.954,0,0,0,7.7-10.811A6.165,6.165,0,0,0,263.691,36.909Z" transform="translate(-227.895 -0.001)"/>
<path id="Path_5177" data-name="Path 5177" d="M0,240.92c0,.079,0,.158,0,.237H2.561a1.043,1.043,0,1,1,0,2.085H.176a13.443,13.443,0,0,0,.323,1.5H5.034a1.043,1.043,0,0,1,0,2.085H1.273A17.5,17.5,0,0,0,5.79,252.4c.216.194.421.377.6.545a3.8,3.8,0,0,1,.886,1.579c.241.67.514,1.429,1.357,1.429s1.115-.759,1.357-1.429a3.8,3.8,0,0,1,.886-1.579c.18-.168.384-.351.6-.545a17.5,17.5,0,0,0,4.517-5.57h-2.25a1.043,1.043,0,0,1,0-2.085h3.024a13.439,13.439,0,0,0,.323-1.5H12.365a1.043,1.043,0,1,1,0-2.085h4.9c0-.079,0-.157,0-.237q0-.851-.056-1.7H.056Q0,240.068,0,240.92Z" transform="translate(0 -198.293)"/>
<path id="Path_5178" data-name="Path 5178" d="M18.095,31.005c-1.708-3.119-3.882-4.981-5.816-4.981s-4.107,1.862-5.816,4.981A23.456,23.456,0,0,0,3.92,38.844H20.638A23.453,23.453,0,0,0,18.095,31.005Z" transform="translate(-3.646 0)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="46.376" height="36.715" viewBox="0 0 46.376 36.715">
<g id="sparrow-carrying-a-baby" transform="translate(-0.003 -31.582)">
<g id="Group_8525" data-name="Group 8525" transform="translate(0.003 31.582)">
<path id="Path_5183" data-name="Path 5183" d="M183.935,87.879l3.485-.328-1.2-2.914-2.5,2.97c-.051-.067-.08-.109-.08-.109l-.082.109-2.5-2.97-.51,1.241a25.377,25.377,0,0,0-4.943-2.057,5.623,5.623,0,0,0-2.265,2.165s-.978.283-1.054,1,1.318,1.318,1.318,1.318,6.458-.716,8.266,0a3.822,3.822,0,0,0,1,.256c-2.109,2.947-7.9,11.4-7.9,15.318a8.671,8.671,0,0,0,17.341,0c0-4.207-6.674-13.635-8.3-15.874A.456.456,0,0,0,183.935,87.879Zm-10.469-.649,0-.551a58.984,58.984,0,0,1,6.632.331l-.222.54A56.676,56.676,0,0,0,173.466,87.23Zm9.681.952a15.48,15.48,0,0,0-3.152-.62l3.371.317C183.305,87.961,183.224,88.075,183.147,88.181Z" transform="translate(-145.94 -75.83)" fill="#2b353e"/>
<path id="Path_5184" data-name="Path 5184" d="M52.295,99.471c-.06,1.169,1.306,2.367,3.19,2.742,1.994.4,3.81-.278,4.056-1.509a7.321,7.321,0,0,0-2.286-6.039c-2.786-2.533-4.594-3.248-4.331-.461l.063.355v0a1.051,1.051,0,0,0-.833.262,1.306,1.306,0,0,0,.123,1.822,1.42,1.42,0,0,0,.14.126.966.966,0,0,0-.264.169,1.306,1.306,0,0,0,.122,1.822c.032.033.066.06.1.091l-.027.2A1.2,1.2,0,0,0,52.295,99.471Z" transform="translate(-43.909 -83.111)" fill="#2b353e"/>
<path id="Path_5185" data-name="Path 5185" d="M24.544,52.919a44.44,44.44,0,0,0,.217-7.063A7.189,7.189,0,0,0,27.3,44.712c-.523-.236-1.864-.965-1.741-2.132a2.03,2.03,0,0,1,1.274-1.563,6.737,6.737,0,0,1,2.481-2.244l.29-.154.315.086c.148.04.3.086.443.129,0-.007,0-.015,0-.021a7.232,7.232,0,0,0-9.3-6.929s-3.816.249-5.531,2.343c-.08.1-.041.154.081.127a8.473,8.473,0,0,1,2.008-.219,7.324,7.324,0,0,0-.892,1.318,4.173,4.173,0,0,0-1.245,1.4c-.056.112,0,.159.118.118a2.4,2.4,0,0,1,.573-.123,7.231,7.231,0,0,0,5.475,9.041c.089,1.377.111,3.691-.662,4.5a8.563,8.563,0,0,0-4.583-3.023,7.613,7.613,0,0,1,.043,1.977c-.28,1.414-1.781,2.335-3.741,2.335a6.641,6.641,0,0,1-1.3-.131C9.2,51.111,7.634,49.719,7.56,48.186A7.159,7.159,0,0,0,5.236,50.04c.124-.793-.221-1.508-.784-1.608a1.191,1.191,0,0,0-1.191.9c-.386-.674-1.076-1.01-1.572-.753a1.273,1.273,0,0,0-.316,1.661c-.707-.009-1.3.349-1.363.865a1.19,1.19,0,0,0,.948,1.152,1.3,1.3,0,0,0-.684,1.6,1.228,1.228,0,0,0,1.552.3,1.116,1.116,0,0,0,.423,1.252c.511.277,1.244-.083,1.636-.805.029-.052.049-.105.073-.159.313,3.458,3.316,6.728,9.347,6.567C19.686,60.844,23.922,59.682,24.544,52.919Zm.316-16.728a.857.857,0,1,1-.857.857A.857.857,0,0,1,24.86,36.191Z" transform="translate(-0.003 -31.582)" fill="#2b353e"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="28.002" height="28.002" viewBox="0 0 28.002 28.002">
<path id="Path_4497" data-name="Path 4497" d="M25.456,0H2.546A2.548,2.548,0,0,0,0,2.546V25.456A2.548,2.548,0,0,0,2.546,28H25.456A2.548,2.548,0,0,0,28,25.456V2.546A2.548,2.548,0,0,0,25.456,0ZM22.1,8.074l-3.6,3.6a.636.636,0,0,1-.9,0,5.176,5.176,0,0,0-4.831-1.282L11.4,7.373A.636.636,0,1,0,10.24,7.9l1.337,2.941a4.74,4.74,0,0,0-1.176.832.636.636,0,0,1-.9,0l-3.6-3.6a.636.636,0,0,1,0-.9,11.454,11.454,0,0,1,16.2,0A.636.636,0,0,1,22.1,8.074Z" fill="#2e303a"/>
</svg>

After

Width:  |  Height:  |  Size: 564 B

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">
<g id="ovulation-test" transform="translate(-0.001 0)">
<path id="Path_5179" data-name="Path 5179" d="M1.029,405.868A3.516,3.516,0,1,0,6,410.84l2.486-2.486-4.972-4.972Z" transform="translate(0 -371.868)" fill="#2b353e"/>
<path id="Path_5180" data-name="Path 5180" d="M355.4,2.381a8.191,8.191,0,0,0-10.689-.745L356.145,13.07A8.191,8.191,0,0,0,355.4,2.381Z" transform="translate(-317.78 0)" fill="#2b353e"/>
<path id="Path_5181" data-name="Path 5181" d="M245.79,162l6.629-6.629a1.172,1.172,0,0,0-1.657-1.657l-6.629,6.629A1.172,1.172,0,0,0,245.79,162Z" transform="translate(-224.743 -141.384)" fill="#2b353e"/>
<path id="Path_5182" data-name="Path 5182" d="M86.31,41.1,72.224,55.187a8.17,8.17,0,0,0-1.9,8.531L66.3,67.742l4.969,4.969,4.023-4.023a8.17,8.17,0,0,0,8.531-1.9L97.911,52.7ZM77.193,63.484a1.177,1.177,0,0,1-1.664-1.664,1.177,1.177,0,1,1,1.664,1.664Zm6.633-3.328a3.513,3.513,0,0,1-4.969-4.969l6.633-6.633a3.513,3.513,0,1,1,4.969,4.969Z" transform="translate(-61.121 -37.89)" fill="#2b353e"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -16,18 +16,23 @@ const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// // Pharmacy Production URLs // // Pharmacy Production URLs
const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
// // Pharmacy Pre-Production URLs
// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// RC API URL
const RC_BASE_URL = 'https://livecare.hmg.com/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
@ -37,7 +42,8 @@ const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints';
const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo';
// Delivery Driver // Delivery Driver
const DRIVER_LOCATION = 'Services/Patients.svc/REST/PatientER_GetDriverLocation'; const DRIVER_LOCATION =
'Services/Patients.svc/REST/PatientER_GetDriverLocation';
//weather //weather
const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
@ -45,71 +51,105 @@ const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege';
// Wifi Credentials // Wifi Credentials
const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; const WIFI_CREDENTIALS =
"Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID";
///Doctor ///Doctor
const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_MY_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_PRE_POST_IMAGES = 'Services/Doctors.svc/REST/GetDoctorPrePostImages'; const GET_DOCTOR_PRE_POST_IMAGES =
const GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; 'Services/Doctors.svc/REST/GetDoctorPrePostImages';
const GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; const GET_DOCTOR_RATING_NOTES =
'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
const GET_DOCTOR_RATING_DETAILS =
'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions ///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const GET_PRESCRIPTIONS_ALL_ORDERS =
const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; const GET_PRESCRIPTION_REPORT =
const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order ///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; const GET_Patient_LAB_SPECIAL_RESULT =
const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; const SEND_LAB_RESULT_EMAIL =
const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; 'Services/Notifications.svc/REST/SendLabReportEmail';
const SEND_COVID_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/GenerateCOVIDReport'; const GET_Patient_LAB_RESULT =
const COVID_PASSPORT_UPDATE = 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate'; 'Services/Patients.svc/REST/GetPatientLabResults';
const GET_PATIENT_PASSPORT_NUMBER = 'Services/Patients.svc/REST/Covid19_Certificate_GetPassport'; const GET_Patient_LAB_ORDERS_RESULT =
'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const SEND_COVID_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/GenerateCOVIDReport';
const COVID_PASSPORT_UPDATE =
'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate';
const GET_PATIENT_PASSPORT_NUMBER =
'Services/Patients.svc/REST/Covid19_Certificate_GetPassport';
/// ///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT =
'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; const GET_PATIENT_ORDERS_DETAILS =
'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail'; const SEND_RAD_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendRadReportEmail';
///Feedback ///Feedback
const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList';
const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC'; const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC';
// const GET_PATIENT_AppointmentHistory = 'Services'
// '/Doctors.svc/REST/PateintHasAppoimentHistory';
const GET_PATIENT_AppointmentHistory = 'Services' const GET_PATIENT_AppointmentHistory = 'Services'
'/Doctors.svc/REST/PateintHasAppoimentHistory'; '/Doctors.svc/REST/PateintHasAppoimentHistory_Async';
///VITAL SIGN ///VITAL SIGN
const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; const GET_PATIENT_VITAL_SIGN =
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
///Er Nearest ///Er Nearest
const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; const GET_NEAREST_HOSPITAL =
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///ED Online ///ED Online
const ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; const ER_GET_VISUAL_TRIAGE_QUESTIONS =
const ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation"; "services/Doctors.svc/REST/ER_GetVisualTriageQuestions";
const ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; const ER_SAVE_TRIAGE_INFORMATION =
"services/Doctors.svc/REST/ER_SaveTriageInformation";
const ER_GetPatientPaymentInformationForERClinic =
"services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
///Er Nearest ///Er Nearest
const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; const GET_AMBULANCE_REQUEST =
const GET_PATIENT_ALL_PRES_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; const GET_PATIENT_ALL_PRES_ORDERS =
const UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID =
'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
const UPDATE_PRESS_ORDER =
'Services/Patients.svc/REST/PatientER_UpdatePresOrder';
const INSERT_ER_INERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
/// ER RRT /// ER RRT
const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation'; const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation';
const GET_ALL_TRANSPORTATIONS_RC = 'rc/api/Transportation/getalltransportation'; const GET_ALL_TRANSPORTATIONS_RC = 'rc/api/Transportation/getalltransportation';
const GET_ALL_RRT_QUESTIONS = 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; const GET_ALL_RRT_QUESTIONS =
const GET_RRT_SERVICE_PRICE = 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice'; 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions';
const GET_RRT_SERVICE_PRICE =
'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice';
const GET_ALL_TRANSPORTATIONS_ORDERS = 'rc/api/Transportation/get'; const GET_ALL_TRANSPORTATIONS_ORDERS = 'rc/api/Transportation/get';
@ -124,13 +164,15 @@ const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects'; const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects';
///babyInformation ///babyInformation
const GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID'; const GET_BABYINFORMATION_REQUEST =
'Services/Community.svc/REST/GetBabyByUserID';
///Get Baby By User ID ///Get Baby By User ID
const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID';
///userInformation ///userInformation
const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New'; const GET_USERINFORMATION_REQUEST =
'Services/Community.svc/REST/GetUserInformation_New';
///Update email ///Update email
const UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail'; const UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail';
@ -152,23 +194,34 @@ const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable';
const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities';
///BloodDetails ///BloodDetails
const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; const GET_BLOOD_REQUEST =
'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails';
const SAVE_BLOOD_REQUEST = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; const SAVE_BLOOD_REQUEST =
'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const GET_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; const GET_BLOOD_AGREEMENT =
const SAVE_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation';
const SAVE_BLOOD_AGREEMENT =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
///Reports ///Reports
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; const INSERT_REQUEST_FOR_MEDICAL_REPORT =
const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail'; 'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
const SEND_MEDICAL_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendMedicalReportEmail';
///Rate ///Rate
const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; // const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
const GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; const IS_LAST_APPOITMENT_RATED =
const NEW_RATE_APPOINTMENT_URL = "Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate"; 'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async';
const NEW_RATE_DOCTOR_URL = "Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate"; const GET_APPOINTMENT_DETAILS_BY_NO =
'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo';
const NEW_RATE_APPOINTMENT_URL =
"Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate";
const NEW_RATE_DOCTOR_URL =
"Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate";
const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
@ -176,7 +229,8 @@ const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//URL to get active appointment list //URL to get active appointment list
const GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; const GET_ACTIVE_APPOINTMENTS_LIST_URL =
"Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber";
//URL to get projects list //URL to get projects list
const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
@ -185,92 +239,128 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime";
//URL to dental doctors list //URL to dental doctors list
const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; const GET_DENTAL_DOCTORS_LIST_URL =
"Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping";
//URL to get doctor free slots //URL to get doctor free slots
const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots";
//URL to insert appointment //URL to insert appointment
const INSERT_SPECIFIC_APPOINTMENT = "Services/Doctors.svc/REST/InsertSpecificAppointment"; const INSERT_SPECIFIC_APPOINTMENT =
"Services/Doctors.svc/REST/InsertSpecificAppointment";
//URL to get patient share //URL to get patient share
const GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; const GET_PATIENT_SHARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history //URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; const GET_PATIENT_APPOINTMENT_HISTORY =
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
const DOCTOR_SCHEDULE_URL = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; const DOCTOR_SCHEDULE_URL =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
const SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; const SEND_REPORT_EYE_EMAIL =
"Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";
const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL =
"Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
//URL to get patient appointment curfew history //URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew"; // const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew";
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
"Services/Doctors.svc/REST/AppoimentHistoryForCurfew_Async";
//URL to confirm appointment //URL to confirm appointment
const CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment"; const CONFIRM_APPOINTMENT =
"Services/MobileNotifications.svc/REST/ConfirmAppointment";
const INSERT_VIDA_REQUEST = "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; const INSERT_VIDA_REQUEST =
"Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart";
//URL to cancel appointment //URL to cancel appointment
const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment";
//URL get appointment QR //URL get appointment QR
const GENERATE_QR_APPOINTMENT = "Services/Doctors.svc/REST/GenerateQRAppointmentNo"; const GENERATE_QR_APPOINTMENT =
"Services/Doctors.svc/REST/GenerateQRAppointmentNo";
//URL send email appointment QR //URL send email appointment QR
const EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; const EMAIL_QR_APPOINTMENT =
"Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
//URL check payment status //URL check payment status
const CHECK_PAYMENT_STATUS = "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID"; const CHECK_PAYMENT_STATUS =
"Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
//URL create advance payment //URL create advance payment
const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment";
const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; const HIS_CREATE_ADVANCE_PAYMENT =
"Services/Patients.svc/REST/HIS_CreateAdvancePayment";
const ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; const ADD_ADVANCE_NUMBER_REQUEST =
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const IS_ALLOW_ASK_DOCTOR =
const GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const ADD_VIDA_REQUEST = 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart'; const GET_CALL_REQUEST_TYPE =
'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const ADD_VIDA_REQUEST =
'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart';
const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo'; const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_LIVECARE_CLINICS = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; const GET_LIVECARE_CLINICS =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
const GET_LIVECARE_SCHEDULE_CLINICS = 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; const GET_LIVECARE_SCHEDULE_CLINICS =
'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule';
const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST =
'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID';
const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS =
'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots';
const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; const INSERT_LIVECARE_SCHEDULE_APPOINTMENT =
'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule';
const GET_PATIENT_SHARE_LIVECARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare"; const GET_PATIENT_SHARE_LIVECARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare";
const GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; const GET_LIVECARE_CLINIC_TIMING =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
const GET_ER_APPOINTMENT_FEES = 'Services/DoctorApplication.svc/REST/GetERAppointmentFees'; const GET_ER_APPOINTMENT_FEES =
'Services/DoctorApplication.svc/REST/GetERAppointmentFees';
const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime'; const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime';
const ADD_NEW_CALL_FOR_PATIENT_ER = 'Services/DoctorApplication.svc/REST/NewCallForPatientER'; const ADD_NEW_CALL_FOR_PATIENT_ER =
'Services/DoctorApplication.svc/REST/NewCallForPatientER';
const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; const GET_LIVECARE_HISTORY =
const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; const CANCEL_LIVECARE_REQUEST =
'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL =
'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
const APPLE_PAY_INSERT_REQUEST = 'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert'; const APPLE_PAY_INSERT_REQUEST =
'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert';
const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions'; const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions';
const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; const UPDATE_HEALTH_TERMS =
'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts'; const GET_PATIENT_HEALTH_STATS =
'Services/Patients.svc/REST/Med_GetTransactionsSts';
const SEND_CHECK_IN_NFC_REQUEST = 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; const SEND_CHECK_IN_NFC_REQUEST =
'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC';
const HAS_DENTAL_PLAN = 'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation'; const HAS_DENTAL_PLAN =
'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation';
const LASER_BODY_PARTS = 'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory'; const LASER_BODY_PARTS = 'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory';
@ -293,16 +383,21 @@ var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; const GET_PAtIENTS_INSURANCE =
const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; "Services/Patients.svc/REST/Get_PatientInsuranceDetails";
const GET_PAtIENTS_INSURANCE_UPDATED =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList";
const GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; const GET_PATIENT_INSURANCE_DETAILS =
const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
const UPLOAD_INSURANCE_CARD =
'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus_Async"; const GET_PAtIENTS_INSURANCE_APPROVALS =
"Services/Patients.svc/REST/GetApprovalStatus_Async";
// const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; // const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse';
@ -313,54 +408,86 @@ const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail';
const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; const GET_PATIENT_AdVANCE_BALANCE_AMOUNT =
const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount';
const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; const GET_PATIENT_INFO_BY_ID =
const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; 'Services/Doctors.svc/REST/GetPatientInfoByPatientID';
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER =
'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber';
const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment';
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; const GET_COVID_DRIVETHRU_PROJECT_LIST =
'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; const GET_COVID_DRIVETHRU_PAYMENT_INFO =
'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; const GET_COVID_DRIVETHRU_FREE_SLOTS =
'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
const GET_COVID_DRIVETHRU_PROCEDURES_LIST = 'Services/Doctors.svc/REST/COVID19_GetTestProcedures'; const GET_COVID_DRIVETHRU_PROCEDURES_LIST =
'Services/Doctors.svc/REST/COVID19_GetTestProcedures';
///Smartwatch Integration Services ///Smartwatch Integration Services
const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; const GET_PATIENT_LAST_RECORD =
const INSERT_PATIENT_HEALTH_DATA = 'Services/Patients.svc/REST/Med_InsertTransactions'; 'Services/Patients.svc/REST/Med_GetPatientLastRecord';
const INSERT_PATIENT_HEALTH_DATA =
'Services/Patients.svc/REST/Med_InsertTransactions';
///My Trackers ///My Trackers
const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; const GET_DIABETIC_RESULT_AVERAGE =
const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; const GET_DIABTEC_RESULT =
'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; const ADD_DIABTEC_RESULT =
const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; 'Services/Patients.svc/REST/Patient_AddDiabtecResult';
const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const GET_BLOOD_PRESSURE_RESULT_AVERAGE =
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; const GET_BLOOD_PRESSURE_RESULT =
const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; 'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_BLOOD_PRESSURE_RESULT =
const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; 'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; const GET_WEIGHT_PRESSURE_RESULT_AVERAGE =
const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_WEIGHT_PRESSURE_RESULT =
const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
const ADD_WEIGHT_PRESSURE_RESULT =
const SEND_AVERAGE_BLOOD_SUGAR_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport'; 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const DEACTIVATE_DIABETIC_STATUS = 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus';
const DEACTIVATE_BLOOD_PRESSURES_STATUS = 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID =
'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
const UPDATE_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult';
const SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAverageBodyWeightReport'; const GET_CALL_INFO_HOURS_RESULT =
const SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport'; 'Services/Doctors.svc/REST/GetCallInfoHoursResult';
const GET_CALL_REQUEST_TYPE_LOV =
const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus';
const UPDATE_DIABETIC_RESULT =
'Services/Patients.svc/REST/Patient_UpdateDiabeticResult';
const SEND_AVERAGE_BLOOD_SUGAR_REPORT =
'Services/Notifications.svc/REST/SendAverageBloodSugarReport';
const DEACTIVATE_DIABETIC_STATUS =
'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus';
const DEACTIVATE_BLOOD_PRESSURES_STATUS =
'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus';
const UPDATE_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult';
const SEND_AVERAGE_BLOOD_WEIGHT_REPORT =
'Services/Notifications.svc/REST/SendAverageBodyWeightReport';
const SEND_AVERAGE_BLOOD_PRESSURE_REPORT =
'Services/Notifications.svc/REST/SendAverageBloodPressureReport';
const UPDATE_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult';
const DEACTIVATE_WEIGHT_PRESSURE_RESULT =
'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus';
const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse';
const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus';
const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
@ -368,25 +495,35 @@ const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies';
// H2O // H2O
const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; const H2O_GET_USER_PROGRESS =
const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; "Services/H2ORemainder.svc/REST/H2O_GetUserProgress";
const H2O_GET_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New"; const H2O_INSERT_USER_ACTIVITY =
const H2O_UPDATE_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New"; "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity";
const H2O_UNDO_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity"; const H2O_GET_USER_DETAIL =
"Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New";
const H2O_UPDATE_USER_DETAIL =
"Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New";
const H2O_UNDO_USER_ACTIVITY =
"Services/H2ORemainder.svc/REST/H2o_UndoUserActivity";
//E_Referral Services //E_Referral Services
const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; const GET_ALL_RELATIONSHIP_TYPES =
const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; "Services/Patients.svc/REST/GetAllRelationshipTypes";
const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; const SEND_ACTIVATION_CODE_FOR_E_REFERRAL =
'Services/Authentication.svc/REST/SendActivationCodeForEReferral';
const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL =
'Services/Authentication.svc/REST/CheckActivationCodeForEReferral';
const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities';
const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
// Encillary Orders // Encillary Orders
const GET_ANCILLARY_ORDERS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; const GET_ANCILLARY_ORDERS =
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList';
const GET_ANCILLARY_ORDERS_DETAILS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList'; const GET_ANCILLARY_ORDERS_DETAILS =
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList';
//Pharmacy wishlist //Pharmacy wishlist
// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; // const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
@ -408,7 +545,7 @@ const GET_CUSTOMERS_ADDRESSES = "Customers/";
const SUBSCRIBE_PRODUCT = "subscribe?"; const SUBSCRIBE_PRODUCT = "subscribe?";
const GET_ORDER = "orders?"; const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "orders/"; const GET_ORDER_DETAILS = "orders/";
const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress"; const ADD_CUSTOMER_ADDRESS = "addcustomeraddress";
const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress"; const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress";
const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress"; const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress";
const GET_ADDRESS = "Customers/"; const GET_ADDRESS = "Customers/";
@ -419,32 +556,50 @@ const GET_SHIPPING_OPTIONS = "get_shipping_option/";
const DELETE_SHOPPING_CART = "delete_shopping_cart_items/"; const DELETE_SHOPPING_CART = "delete_shopping_cart_items/";
const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/"; const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/";
const ORDER_SHOPPING_CART = "orders"; const ORDER_SHOPPING_CART = "orders";
const GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation"; const GET_LACUM_ACCOUNT_INFORMATION =
const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; "Services/Patients.svc/REST/GetLakumAccountInformation";
const LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation"; const GET_LACUM_GROUP_INFORMATION =
const LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation"; "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount"; const LACUM_ACCOUNT_ACTIVATE =
const TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; "Services/Patients.svc/REST/LakumAccountActivation";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; const LACUM_ACCOUNT_DEACTIVATE =
"Services/Patients.svc/REST/LakumAccountDeactivation";
const CREATE_LAKUM_ACCOUNT =
"Services/Patients.svc/REST/PHR_CreateLakumAccount";
const TRANSFER_YAHALA_LOYALITY_POINTS =
"Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/'; const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
const GET_MOST_VIEWED_PRODUCTS = "mostview?"; const GET_MOST_VIEWED_PRODUCTS = "mostview";
const GET_NEW_PRODUCTS = "newproducts?"; const GET_NEW_PRODUCTS = "newproducts";
// Home Health Care // Home Health Care
const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; const HHC_GET_ALL_SERVICES =
const HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; "Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
const PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_UpdatePresOrder"; const HHC_GET_ALL_CMC_SERVICES =
const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; "Services/Patients.svc/REST/PatientER_CMC_GetAllServices";
const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; const PATIENT_ER_UPDATE_PRES_ORDER =
"Services/Patients.svc/REST/PatientER_UpdatePresOrder";
const GET_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
const GET_CMC_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems";
const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS =
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const GET_PATIENT_ALL_PRES_ORD = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ =
const PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
const GET_PATIENT_ALL_PRES_ORD =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const PATIENT_ER_INSERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews'; const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews';
const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; const BLOOD_DONATION_REGISTER_BLOOD_TYPE =
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
// HHC RC SERVICES // HHC RC SERVICES
const HHC_GET_ALL_SERVICES_RC = "rc/api/HHC/getallhhc"; const HHC_GET_ALL_SERVICES_RC = "rc/api/HHC/getallhhc";
@ -466,9 +621,9 @@ const UPDATE_RRT_ORDER_RC = 'rc/api/rrt/update';
// PRESCRIPTION RC SERVICES // PRESCRIPTION RC SERVICES
const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add"; const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add";
const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list"; const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list";
const GET_ALL_PRESCRIPTION_INFO_RC = "rc/api/Prescription/info";
const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update'; const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update';
//Pharmacy wishlist //Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/"; const GET_WISHLIST = "shopping_cart_items/";
const DELETE_WISHLIST = "delete_shopping_cart_item_by_product?customer_id="; const DELETE_WISHLIST = "delete_shopping_cart_item_by_product?customer_id=";
@ -487,17 +642,21 @@ const GET_CUSTOMER_INFO = "VerifyCustomer";
//Pharmacy //Pharmacy
const GET_PHARMACY_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0'; const GET_PHARMACY_CATEGORISE =
'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0';
const GET_OFFERS_CATEGORISE = 'discountcategories'; const GET_OFFERS_CATEGORISE = 'discountcategories';
const GET_OFFERS_PRODUCTS = 'offerproducts/'; const GET_OFFERS_PRODUCTS = 'offerproducts/';
const GET_CATEGORISE_PARENT = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; const GET_CATEGORISE_PARENT =
'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_PARENT_PRODUCTS = 'products?categoryid='; const GET_PARENT_PRODUCTS = 'products?categoryid=';
const GET_SUB_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; const GET_SUB_CATEGORISE =
'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_SUB_PRODUCTS = 'products?categoryid='; const GET_SUB_PRODUCTS = 'products?categoryid=';
const GET_FINAL_PRODUCTS = const GET_FINAL_PRODUCTS =
'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; 'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId=';
const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory';
const GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; const GET_DISEASE_BY_CLINIC_ID =
'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID';
const SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime'; const SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime';
const TIMER_MIN = 10; const TIMER_MIN = 10;
@ -513,13 +672,17 @@ const SCAN_QR_CODE = 'productbysku/';
const FILTERED_PRODUCTS = 'products?categoryids='; const FILTERED_PRODUCTS = 'products?categoryids=';
const GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors"; const GET_DOCTOR_LIST_CALCULATION =
"Services/Doctors.svc/REST/GetCallculationDoctors";
const GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = "Services/Patients.svc/REST/GetDentalAppointments"; const GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC =
"Services/Patients.svc/REST/GetDentalAppointments";
const GET_DENTAL_APPOINTMENT_INVOICE = "Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo"; const GET_DENTAL_APPOINTMENT_INVOICE =
"Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo";
const SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = "Services/Notifications.svc/REST/SendInvoiceForDental"; const SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL =
"Services/Notifications.svc/REST/SendInvoiceForDental";
class AppGlobal { class AppGlobal {
static var context; static var context;

@ -491,9 +491,11 @@ const Map localizedValues = {
"noLocationAvailable": {"en": "No Location Available", "ar": "لا يوجد موقع"}, "noLocationAvailable": {"en": "No Location Available", "ar": "لا يوجد موقع"},
"orders": {"en": "Orders", "ar": "الطلبات"}, "orders": {"en": "Orders", "ar": "الطلبات"},
"lakum": {"en": "Lakum", "ar": "برنامج لكم"}, "lakum": {"en": "Lakum", "ar": "برنامج لكم"},
"lakumMsg": {"en": "No Details of Points Are There", "ar": " لاتوجد تفاصيل عن النقاط"},
"lakumPoint": {"en": "Point", "ar": "نقطه"},
"wishlist": {"en": "Wishlist", "ar": "المفضلة"}, "wishlist": {"en": "Wishlist", "ar": "المفضلة"},
"products": {"en": "Products", "ar": "المنتجات"}, "products": {"en": "Products", "ar": "المنتجات"},
"reviews": {"en": "Reviews", "ar": "التقيمات"}, "reviews": {"en": "Reviews", "ar": "التقييمات"},
"brands": {"en": "Brands", "ar": "العلامات التجارية"}, "brands": {"en": "Brands", "ar": "العلامات التجارية"},
"productDetails": {"en": "Product Details", "ar": "تفاصيل المنتج"}, "productDetails": {"en": "Product Details", "ar": "تفاصيل المنتج"},
"medicationRefill": {"en": "Medication Refill", "ar": "تعبئة الأدوية"}, "medicationRefill": {"en": "Medication Refill", "ar": "تعبئة الأدوية"},
@ -586,6 +588,7 @@ const Map localizedValues = {
"remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"}, "remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"},
"loginToUseService": {"en": "You need to login to use this service", "ar": "هذة الخدمة تتطلب تسجيل الدخول"}, "loginToUseService": {"en": "You need to login to use this service", "ar": "هذة الخدمة تتطلب تسجيل الدخول"},
"offersAndPromotions": {"en": "OFFERS & SPECIAL PROMOTIONS", "ar": "العروض والترقيات الخاصة"}, "offersAndPromotions": {"en": "OFFERS & SPECIAL PROMOTIONS", "ar": "العروض والترقيات الخاصة"},
"offers": {"en": "OFFERS", "ar": "العروض"},
"myPrescriptions": {"en": "MY PRESCRIPTIONS", "ar": "وصفاتي"}, "myPrescriptions": {"en": "MY PRESCRIPTIONS", "ar": "وصفاتي"},
"searchAndScanMedication": {"en": "SEARCH & SCAN FOR MEDICATION", "ar": "البحث والمسح للأدوية"}, "searchAndScanMedication": {"en": "SEARCH & SCAN FOR MEDICATION", "ar": "البحث والمسح للأدوية"},
"shopByBrands": {"en": "Shop by Brands", "ar": "تسوق حسب الماركات"}, "shopByBrands": {"en": "Shop by Brands", "ar": "تسوق حسب الماركات"},
@ -606,19 +609,39 @@ const Map localizedValues = {
"gained": {"en": "GAINED", "ar": "المكتسب"}, "gained": {"en": "GAINED", "ar": "المكتسب"},
"consumed": {"en": "Consumed", "ar": "المستهلك"}, "consumed": {"en": "Consumed", "ar": "المستهلك"},
"transferred": {"en": "TRANSFERRED", "ar": "المحول"}, "transferred": {"en": "TRANSFERRED", "ar": "المحول"},
"RIYAL": {"en": "RIYAL", "ar": "ريال"},
"MEMBERSINCE": {"en": "MEMBER SINCE", "ar": "تاريخ العضوية"},
"IDENTIFICATION": {"en": "IDENTIFICATION", "ar": "رقم الهوية"},
"lakumMobile": {"en": "lakum Mobile", "ar": "رقم الجوال"},
"Waitinggained": {"en": "Waiting gained", "ar": " بأنتظار التفعيل"},
"Expired": {"en": "Expired", "ar": "منتهية الصلاحيه"},
"WillBeExpired": {"en": "Will Be Expired", "ar": "ستنتهي صلاحيتها"},
"LakumPoint": {"en": "Lakum Points", "ar": "نقاط لكم"},
"ActivateLAKUMAccount": {"en": "Activate LAKUM Account", "ar": "تفعيل لكم"},
"checkBeneficiary": {"en": "CHECK BENEFICIARY", "ar": "تحقق من المستفيد"}, "checkBeneficiary": {"en": "CHECK BENEFICIARY", "ar": "تحقق من المستفيد"},
"beneficiaryName": {"en": "Beneficiary Name", "ar": "اسم المستفيد"}, "beneficiaryName": {"en": "Beneficiary Name", "ar": "اسم المستفيد"},
"accountActivation": {"en": "Account Activation", "ar": "تفعيل الحساب"}, "accountActivation": {"en": "Account Activation", "ar": "تفعيل الحساب"},
"lakumTransfer": {"en": "Lakum Transfer", "ar": "تفعيل الحساب"}, "lakumTransfer": {"en": "Lakum Transfer", "ar": "تحويل نقاط لكم"},
"acceptLbl": {"en": "Accept", "ar": "موافقة"}, "acceptLbl": {"en": "Accept", "ar": "موافقة"},
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
"select": {"en": "Select", "ar": "يختار"}, "select": {"en": "Select", "ar": "اختر"},
"i-am": {"en": "I am", "ar": "أنا"}, "i-am": {"en": "I am", "ar": "أنا"},
"years-old": {"en": "years old", "ar": "سنة"}, "years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"},
"refine": {"en": "Refine", "ar": "تصفية"}, "refine": {"en": "Refine", "ar": "تصفية"},
"max": {"en": "Max", "ar": "اعلى"},
"compeleteOrderMsg": {"en": "Order has been placed successfully!!", "ar": "تم اتمام الطلب بنجاح"},
"addToCompareMsg": {"en": "You have added a product to the Compare list", "ar": "تمت الاضافه لقائمة المقارنه"},
"itInListMsg": {"en": "Item is already in the list", "ar": "المنتج موجود في القائمه"},
"compareListFull": {"en": "Your compare list is full", "ar": "قائمة المقارنة ممتلئه"},
"addQuantity": {"en": "You should add quantity", "ar": "اختر الكمية"},
"addToCartMsg": {"en": "You have added a product to the cart", "ar": "تمت اضافة المنتج بنجاح"},
"addToWishlistMsg": {"en": "You have added a product to the Wishlist", "ar": "تمت الاضافة لقائمة المفضله"},
"notifyMeMsg": {"en": "You will be notified when product available", "ar": "سيتم اخبارك في حال توفر المنتج"},
"removeFromWishlistMsg": {"en": "You have removed a product from the Wishlist", "ar": "تمت ازالة المنتج بنجاح"},
"min": {"en": "Min", "ar": "اقل"},
"reset": {"en": "Reset", "ar": "اعادة تعيين"}, "reset": {"en": "Reset", "ar": "اعادة تعيين"},
"apply": {"en": "Apply", "ar": "تطبيق"}, "apply": {"en": "Apply", "ar": "تطبيق"},
"viewCategorise": {"en": "View All Categories", "ar": "عرض جميع الفئات"}, "viewCategorise": {"en": "View All Categories", "ar": "عرض جميع الفئات"},
@ -1031,6 +1054,7 @@ const Map localizedValues = {
"no-data": {"en": "No data found", "ar": "لاتوجد بيانات"}, "no-data": {"en": "No data found", "ar": "لاتوجد بيانات"},
"insurance-details": {"en": "Insurance Details", "ar": "تفاصيل التأمين"}, "insurance-details": {"en": "Insurance Details", "ar": "تفاصيل التأمين"},
"nearest-hospital": {"en": "Nearest Hospital", "ar": "أقرب مستشفى"}, "nearest-hospital": {"en": "Nearest Hospital", "ar": "أقرب مستشفى"},
"submitReview": {"en": "Your review has been Submitted successfully", "ar": "تم إرسال التقييم بنجاح"},
"request-sent": {"en": "Request sent successfully", "ar": "تم إرسال الطلب بنجاح"}, "request-sent": {"en": "Request sent successfully", "ar": "تم إرسال الطلب بنجاح"},
"message-sent": {"en": "Message sent successfully", "ar": "تم إرسال الرسالة بنجاح"}, "message-sent": {"en": "Message sent successfully", "ar": "تم إرسال الرسالة بنجاح"},
"sent-on": {"en": "Sent on", "ar": "أرسلت في"}, "sent-on": {"en": "Sent on", "ar": "أرسلت في"},
@ -1143,7 +1167,7 @@ const Map localizedValues = {
"triglycerides": {"en": "Triglycerides", "ar": "الدهون الثلاثية"}, "triglycerides": {"en": "Triglycerides", "ar": "الدهون الثلاثية"},
"fatInBlood": {"en": "Fat in Blood", "ar": ""}, "fatInBlood": {"en": "Fat in Blood", "ar": ""},
"convertFrom": {"en": "Convert from", "ar": "تحويل من"}, "convertFrom": {"en": "Convert from", "ar": "تحويل من"},
"calculate": {"en": "calculate", "ar": "احسب"}, "calculate": {"en": "Calculate", "ar": "احسب"},
"enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"}, "enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"},
"result": {"en": "Result", "ar": "النتيجة"}, "result": {"en": "Result", "ar": "النتيجة"},
"sort": {"en": "Sort", "ar": "فرز"}, "sort": {"en": "Sort", "ar": "فرز"},
@ -1189,8 +1213,8 @@ const Map localizedValues = {
"ovulation": {"en": "Ovulation", "ar": "الإباضة"}, "ovulation": {"en": "Ovulation", "ar": "الإباضة"},
"delivery": {"en": "Delivery", "ar": "الولادة"}, "delivery": {"en": "Delivery", "ar": "الولادة"},
"bmiCalcDesc": { "bmiCalcDesc": {
"en": "'Calculate the BMI value and weight\n status to identify the healthy weight.\n Not appropriate for children and women\n who are pregnant or breastfeeding'", "en": "Calculate the BMI value and weight status to identify the healthy weight. Not appropriate for children and women who are pregnant or breastfeeding",
"ar": "حساب قيمة مؤشر كتلة الجسم وحالة الوزن لتحديد الوزن الصحي. \n وغير مناسب للأطفال والنساء الحوامل أو المرضعات" "ar": "احسب قيمة مؤشر كتلة الجسم وحالة الوزن لتحديد الوزن الصحي. غير مناسب للأطفال والنساء الحوامل أو المرضعات"
}, },
"selectUnit": {"en": "Select Unit", "ar": "اختر الوحدة"}, "selectUnit": {"en": "Select Unit", "ar": "اختر الوحدة"},
"feet": {"en": "Feet", "ar": "قدم"}, "feet": {"en": "Feet", "ar": "قدم"},
@ -1619,4 +1643,88 @@ const Map localizedValues = {
"bodyFatTitle": {"en": "Body Fat", "ar": " الدهون في الجسم"}, "bodyFatTitle": {"en": "Body Fat", "ar": " الدهون في الجسم"},
"cholesTitle": {"en": "Blood Cholesterol", "ar": " الكولسترول في الدم"}, "cholesTitle": {"en": "Blood Cholesterol", "ar": " الكولسترول في الدم"},
"laserClinic": {"en": "Laser Clinic", "ar": "عيادة الليزر"}, "laserClinic": {"en": "Laser Clinic", "ar": "عيادة الليزر"},
"noImage": {"en": "No Image", "ar": "لا توجد صورة"},
"signoutMessage": {"en": "Are you sure you want to logout?", "ar": "هل أنت متأكد أنك تريد تسجيل الخروج؟"},
"RRTTitle": {"en": "RRT", "ar": "خدمة فريق"},
"RRTSubTitle": {"en": "Service", "ar": "الاستجابة السريع"},
"transportation": {"en": "Transportation", "ar": "النقل"},
"neck": {"en": "Neck", "ar": "رقبه"},
"waist": {"en": "Waist", "ar": "وسط"},
"hip": {"en": "Hip", "ar": "ورك او نتوء"},
"carbsProtin": {"en": "Carbs, Protein and Fat", "ar": "الكربوهيدرات والبروتينات والدهون"},
"usefulInfo": {"en": "Useful Information", "ar": "معلومات مفيدة"},
"babyAge": {"en": "Baby Age", "ar": "عمر الطفل الآن:"},
"babyAgeAvail": {"en": "baby age is not available", "ar": "عمر الطفل غير متوفر"},
"deliveryDue": {"en": "The delivery due date is estimated to be on the", "ar": "من المقدر أن يكون تاريخ استحقاق التسليم في"},
"almostInactive": {"en": "Almost Inactive(Little or no exercises)", "ar": "شبه غير نشط (تمارين قليلة أو معدومة)"},
"lightActive1": {"en": "Lighty Active (1-3) days per week", "ar": "Lighty Active (1-3) أيام في الأسبوع"},
"veryActive": {"en": "very Active(6-7) days per week", "ar": "نشط جدا (6-7) أيام في الأسبوع"},
"superActive": {"en": "Super Active(very hard exercises)", "ar": "سوبر نشط (تمارين صعبة للغاية)"},
"dailyIntake": {"en": "Daily intake is", "ar": "المدخول اليومي"},
"calculateAmount": {"en": "Calculates the amount of energy that the persons body expends in a day", "ar": "تحسب كمية الطاقة التي يبذلها جسم الشخص في اليوم"},
"bodyWillBurn": {"en": "This means the body will burn", "ar": "هذا يعني أن الجسم سوف يحترق"},
"caloriesEachDay": {"en": "calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is", "ar": "السعرات الحرارية في كل يوم ، إذا لم تمارس أي نشاط طوال اليوم .. ملاحظة: متطلبات السعرات الحرارية اليومية هي"},
"maintainWeight": {"en": "calories, to maintain the current weight.", "ar": "السعرات الحرارية للحفاظ على الوزن الحالي."},
"mediumFinger": {"en": "Medium(fingers touch)", "ar": "متوسطة (لمسة الأصابع)"},
"smallFinger": {"en": "Small(fingers overlap)", "ar": "صغير (أصابع متداخلة)"},
"largeFinger": {"en": "Large(fingers don\'n touch)", "ar": "كبير (لا تلمس الأصابع)"},
"idealBodyWeight": {"en": "Calculates the ideal body weight based on height, Weight, and Body Size", "ar": "يحسب وزن الجسم المثالي بناءً على الطول والوزن وحجم الجسم"},
"bodyFrameSize": {"en": "Body Frame Size", "ar": "حجم إطار الجسم"},
"idealWeightRange": {"en": "Ideal weight range is", "ar": "نطاق الوزن المثالي هو"},
"currentWeightPerfect": {"en": "Congratulations! The current weight is perfect and considered healthy", "ar": "تهانينا! الوزن الحالي مثالي ويعتبر صحي"},
"littleBitWeightMore": {"en": "This means that the weight is a little bit more than ideal weight by", "ar": "هذا يعني أن الوزن أكثر قليلاً من الوزن المثالي به"},
"consultWithDoctor": {"en": "May wish to consult with the doctor for medical help. Click to view our list of Doctors", "ar": "قد ترغب في استشارة الطبيب للحصول على مساعدة طبية. انقر لعرض قائمة الأطباء لدينا"},
"excessiveObesity": {"en": "Means that you suffer from excessive obesity by", "ar": "يعني أنك تعاني من السمنة المفرطة بها"},
"mayWish": {"en": "May wish to consult with the doctor for medical help. Click to view our list of\n Doctors", "ar": "قد ترغب في استشارة الطبيب للحصول على مساعدة طبية. انقر لعرض قائمة الأطباء \ n الخاصة بنا"},
"essential": {"en": "The category falls under essential", "ar": "الفئة تندرج تحت الأساسية"},
"athlete": {"en": "The category falls under athlete", "ar": "فئة تندرج تحت رياضي"},
"fitness": {"en": "The category falls under fitness", "ar": "الفئة تندرج تحت اللياقة البدنية"},
"acceptable": {"en": "The category falls under acceptable", "ar": "الفئة تندرج تحت مقبول"},
"underObese": {"en": "The category falls under obese", "ar": "تندرج الفئة تحت السمنة"},
"crossedLimits": {"en": "Please check the value you have entered, since the body fat percentage has crosed the limits.", "ar": "يرجى التحقق من القيمة التي أدخلتها ، لأن نسبة الدهون في الجسم تجاوزت الحدود."},
"lowLimits": {"en": "Please check the value you have entered, since the body fat percentage cannot be this low.", "ar": "يرجى التحقق من القيمة التي أدخلتها ، حيث لا يمكن أن تكون نسبة الدهون في الجسم منخفضة."},
"estimates": {"en": "Estimates the total body fat based on\nthe size", "ar": "تقدير إجمالي الدهون في الجسم بناءً على \ n الحجم"},
"myCart": {"en": "Cart", "ar": "عربة التسوق"},
"browseOffers": {"en": "Browse offers by clinic", "ar": "تصفح العروض حسب العيادة"},
"inactiveAct":{"en":"Almost inactive (little or no exercise)","ar":"غير نشط تقريبا (ممارسة الرياضة قليلة أو منعدمة)"},
"light":{"en":"Lightly active (1-3) days per week","ar":"خفيف النشاط (1-3 أيام في الأسبوع)"},
"moderate":{"en":"Moderately active (3-5) days per week)","ar":"معتدل النشاط (3-5 أيام في الأسبوع)"},
"very":{"en":"Very active (6-7) days per week)","ar":"نشط جداُ (6-7 أيام في الأسبوع)"},
"super":{"en":"Super active (very hard exercise)","ar":"عالي النشاط (ممارسة الرياضة الصعبة)"},
"resultCalories": {"en": "Daily intake is (#) calories", "ar": "الإحتياج اليومي (#) سعرة حرارية"},
"bmrDesc": {"en": "Calculates the amount of energy that the persons body expends in a day", "ar": "معدل الأيض القاعدي: هو حساب كمية الطاقة التي يحتاجها الجسم في اليوم الواحد"},
"idealWeightDesc": {"en": "Calculates the ideal body weight based on height, Weight, and Body Size", "ar": "حساب الوزن المثالي والوزن الصحي للجسم على أساس الطول، والوزن ،والجسم"},
"bodyFrame": {"en": "Body Frame Size", "ar": "مقاس هيكل الجسم"},
"bodyFrameSmall": {"en": "Small (fingers overlap)", "ar": "رفيع (الأصابع تتداخل)"},
"bodyFrameMedium": {"en": "Medium (fingers touch)", "ar": "متوسط (الأصابع تتلامس)"},
"bodyFrameLarge": {"en": "Large (fingers don't touch)", "ar": "عريض (الأصابع لا تتلامس)"},
"bodyFatDesc": {"en": "Estimates the total body fat based on the size", "ar": "حساب الدهون في الجسم بناءاً على الحجم"},
"obeseBodyFat":{"en":"The category falls under Obese.","ar":"تندرج تحت فئة دهون جسم سمين"},
"invalid":{"en":"Invalid input for calculation.","ar":"البيانات المدخلة غير صالحة للحساب"},
"more":{"en":"Please check the value you have entered, since the body fat percentage has crossed the limits.","ar":"يرجى التحقق من القيمة التي أدخلتها ، نظرًا لأن نسبة الدهون في الجسم قد تجاوزت الحدود"},
"less":{"en":"Please check the value you have entered, since the body fat percentage cannot be this low.","ar":"يرجى التحقق من القيمة التي أدخلتها ، نظرًا لأن نسبة الدهون في الجسم لا يمكن أن تكون منخفضة"},
"carbProteinDesc": {"en": "Calculates carbohydrate protein and fat ratio in calories and grams according to a pre-set ratio", "ar": "حساب نسب الكربوهيدرات و البروتينات و الدهون بالسعرات الحرارية والغرامات وفقا لنسب محددة مسبقا"},
"calDay": {"en": "Calories Per Day", "ar": "السعرات الحرارية في اليوم الواحد"},
"notSure": {"en": "Not sure? click here", "ar": "غير متأكد؟ اضغط هنا"},
"selectDiet": {"en": "Select Diet Type", "ar": "حدد نوع النظام الغذائي"},
"dietVeryLow":{"en":"Very Low Carb","ar":"حمية منخفضة جدا في الكربوهيدرات"},
"dietLow":{"en":"Low Carb","ar":"حمية منخفضة الكربوهيدرات"},
"dietModerate":{"en":"Moderate Carb","ar":"حمية معتدلة الكربوهيدرات"},
"dietUSDA":{"en":"USDA Guidelines","ar":"ارشادات وزارة الزراعة الأمريكية"},
"dietZone":{"en":"Zone Diet","ar":"حمية زون"},
"Protein": {"en": "Protein", "ar": "بروتين"},
"Cals": {"en": "Cals", "ar": "كالس"},
"gramsPerDay": {"en": "Grams Per Day", "ar": "غرام في اليوم"},
"gr": {"en": "gr", "ar": "غرام"},
"gramsPerMeal": {"en": "Grams Per Meal", "ar": "عدد الجرامات لكل وجبة"},
}; };

@ -1,26 +1,27 @@
class AmbulanceRequestOrdersModel { class AmbulanceRequestOrdersModel {
String statusText; String statusText;
int paymentStatus; num paymentStatus;
dynamic clientRequestid; dynamic clientRequestid;
dynamic paymentStatusText; dynamic paymentStatusText;
dynamic projectName; dynamic projectName;
String nearestProjectName; String nearestProjectName;
double paymentAmount; num paymentAmount;
WFOrder wFOrder; WFOrder wFOrder;
String serviceText; String serviceText;
bool isSentForApproval; bool isSentForApproval;
int exaCartOrderId; num exaCartOrderId;
String exaCartGUID;
bool isTimer; bool isTimer;
int timeSeconds; num timeSeconds;
int totalPendingSeconds; num totalPendingSeconds;
int timeMinute; num timeMinute;
int timeHour; num timeHour;
int timeTotalSeconds; num timeTotalSeconds;
int timeTotalMinute; num timeTotalMinute;
int timeTotalHour; num timeTotalHour;
dynamic approvalStatus; dynamic approvalStatus;
bool isActive; bool isActive;
int clickButton; num clickButton;
dynamic orderHistory; dynamic orderHistory;
String pickupLocation; String pickupLocation;
String dropOffLocation; String dropOffLocation;
@ -28,22 +29,21 @@ class AmbulanceRequestOrdersModel {
String doctorName; String doctorName;
String branch; String branch;
String time; String time;
dynamic notes; String notes;
int id; num iD;
String patientId; num patientId;
int patientOutSa; num patientOutSa;
bool isOutPatient; bool isOutPatient;
int projectId; num projectId;
int nearestProjectId; num nearestProjectId;
dynamic longitude; dynamic longitude;
dynamic latitude; dynamic latitude;
dynamic appointmentNo; dynamic appointmentNo;
dynamic dischargeId; dynamic dischargeId;
int statusId; num statusId;
int serviceId; num serviceId;
int channel; num channel;
Orderpayment orderpayment; Orderpayment orderpayment;
dynamic orderselectedservice;
dynamic wforder; dynamic wforder;
dynamic orderapprovalobj; dynamic orderapprovalobj;
String created; String created;
@ -54,266 +54,293 @@ class AmbulanceRequestOrdersModel {
AmbulanceRequestOrdersModel( AmbulanceRequestOrdersModel(
{this.statusText, {this.statusText,
this.paymentStatus, this.paymentStatus,
this.clientRequestid, this.clientRequestid,
this.paymentStatusText, this.paymentStatusText,
this.projectName, this.projectName,
this.nearestProjectName, this.nearestProjectName,
this.paymentAmount, this.paymentAmount,
this.wFOrder, this.wFOrder,
this.serviceText, this.serviceText,
this.isSentForApproval, this.isSentForApproval,
this.exaCartOrderId, this.exaCartOrderId,
this.isTimer, this.exaCartGUID,
this.timeSeconds, this.isTimer,
this.totalPendingSeconds, this.timeSeconds,
this.timeMinute, this.totalPendingSeconds,
this.timeHour, this.timeMinute,
this.timeTotalSeconds, this.timeHour,
this.timeTotalMinute, this.timeTotalSeconds,
this.timeTotalHour, this.timeTotalMinute,
this.approvalStatus, this.timeTotalHour,
this.isActive, this.approvalStatus,
this.clickButton, this.isActive,
this.orderHistory, this.clickButton,
this.pickupLocation, this.orderHistory,
this.dropOffLocation, this.pickupLocation,
this.clinicName, this.dropOffLocation,
this.doctorName, this.clinicName,
this.branch, this.doctorName,
this.time, this.branch,
this.notes, this.time,
this.id, this.notes,
this.patientId, this.iD,
this.patientOutSa, this.patientId,
this.isOutPatient, this.patientOutSa,
this.projectId, this.isOutPatient,
this.nearestProjectId, this.projectId,
this.longitude, this.nearestProjectId,
this.latitude, this.longitude,
this.appointmentNo, this.latitude,
this.dischargeId, this.appointmentNo,
this.statusId, this.dischargeId,
this.serviceId, this.statusId,
this.channel, this.serviceId,
this.orderpayment, this.channel,
this.orderselectedservice, this.orderpayment,
this.wforder, this.wforder,
this.orderapprovalobj, this.orderapprovalobj,
this.created, this.created,
this.createdBy, this.createdBy,
this.modified, this.modified,
this.modifiedBy, this.modifiedBy,
this.isDeleted}); this.isDeleted});
AmbulanceRequestOrdersModel.fromJson(Map<String, dynamic> json) { AmbulanceRequestOrdersModel.fromJson(Map<String, dynamic> json) {
statusText = json['statusText']; statusText = json['StatusText'];
paymentStatus = json['paymentStatus']; paymentStatus = json['PaymentStatus'];
clientRequestid = json['clientRequestid']; clientRequestid = json['ClientRequestid'];
paymentStatusText = json['paymentStatusText']; paymentStatusText = json['PaymentStatusText'];
projectName = json['projectName']; projectName = json['ProjectName'];
nearestProjectName = json['nearestProjectName']; nearestProjectName = json['NearestProjectName'];
paymentAmount = json['paymentAmount']; paymentAmount = json['PaymentAmount'];
wFOrder = json['wF_order'] != null ? new WFOrder.fromJson(json['wF_order']) : null; wFOrder = json['WF_order'] != null
serviceText = json['serviceText']; ? new WFOrder.fromJson(json['WF_order'])
: null;
serviceText = json['ServiceText'];
isSentForApproval = json['isSentForApproval']; isSentForApproval = json['isSentForApproval'];
exaCartOrderId = json['exaCart_OrderId']; exaCartOrderId = json['ExaCart_OrderId'];
exaCartGUID = json['ExaCart_GUID'];
isTimer = json['isTimer']; isTimer = json['isTimer'];
timeSeconds = json['timeSeconds']; timeSeconds = json['TimeSeconds'];
totalPendingSeconds = json['totalPendingSeconds']; totalPendingSeconds = json['TotalPendingSeconds'];
timeMinute = json['timeMinute']; timeMinute = json['TimeMinute'];
timeHour = json['timeHour']; timeHour = json['TimeHour'];
timeTotalSeconds = json['timeTotalSeconds']; timeTotalSeconds = json['TimeTotalSeconds'];
timeTotalMinute = json['timeTotalMinute']; timeTotalMinute = json['TimeTotalMinute'];
timeTotalHour = json['timeTotalHour']; timeTotalHour = json['TimeTotalHour'];
approvalStatus = json['approvalStatus']; approvalStatus = json['ApprovalStatus'];
isActive = json['isActive']; isActive = json['isActive'];
clickButton = json['clickButton']; clickButton = json['ClickButton'];
orderHistory = json['orderHistory']; orderHistory = json['OrderHistory'];
pickupLocation = json['pickupLocation']; pickupLocation = json['PickupLocation'];
dropOffLocation = json['dropOffLocation']; dropOffLocation = json['DropOffLocation'];
clinicName = json['clinicName']; clinicName = json['clinicName'];
doctorName = json['doctorName']; doctorName = json['DoctorName'];
branch = json['branch']; branch = json['Branch'];
time = json['time']; time = json['Time'];
notes = json['notes']; notes = json['Notes'];
id = json['id']; iD = json['ID'];
patientId = json['patientId']; patientId = json['PatientId'];
patientOutSa = json['patientOutSa']; patientOutSa = json['PatientOutSa'];
isOutPatient = json['isOutPatient']; isOutPatient = json['IsOutPatient'];
projectId = json['projectId']; projectId = json['ProjectId'];
nearestProjectId = json['nearestProjectId']; nearestProjectId = json['NearestProjectId'];
longitude = json['longitude']; longitude = json['Longitude'];
latitude = json['latitude']; latitude = json['Latitude'];
appointmentNo = json['appointmentNo']; appointmentNo = json['AppointmentNo'];
dischargeId = json['dischargeId']; dischargeId = json['DischargeId'];
statusId = json['statusId']; statusId = json['StatusId'];
serviceId = json['serviceId']; serviceId = json['ServiceId'];
channel = json['channel']; channel = json['Channel'];
orderpayment = json['orderpayment'] != null ? new Orderpayment.fromJson(json['orderpayment']) : null; orderpayment = json['orderpayment'] != null
orderselectedservice = json['orderselectedservice']; ? new Orderpayment.fromJson(json['orderpayment'])
: null;
wforder = json['wforder']; wforder = json['wforder'];
orderapprovalobj = json['orderapprovalobj']; orderapprovalobj = json['orderapprovalobj'];
created = json['created']; created = json['Created'];
createdBy = json['createdBy']; createdBy = json['CreatedBy'];
modified = json['modified']; modified = json['Modified'];
modifiedBy = json['modifiedBy']; modifiedBy = json['ModifiedBy'];
isDeleted = json['isDeleted']; isDeleted = json['IsDeleted'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['statusText'] = this.statusText; data['StatusText'] = this.statusText;
data['paymentStatus'] = this.paymentStatus; data['PaymentStatus'] = this.paymentStatus;
data['clientRequestid'] = this.clientRequestid; data['ClientRequestid'] = this.clientRequestid;
data['paymentStatusText'] = this.paymentStatusText; data['PaymentStatusText'] = this.paymentStatusText;
data['projectName'] = this.projectName; data['ProjectName'] = this.projectName;
data['nearestProjectName'] = this.nearestProjectName; data['NearestProjectName'] = this.nearestProjectName;
data['paymentAmount'] = this.paymentAmount; data['PaymentAmount'] = this.paymentAmount;
if (this.wFOrder != null) { if (this.wFOrder != null) {
data['wF_order'] = this.wFOrder.toJson(); data['WF_order'] = this.wFOrder.toJson();
} }
data['serviceText'] = this.serviceText; data['ServiceText'] = this.serviceText;
data['isSentForApproval'] = this.isSentForApproval; data['isSentForApproval'] = this.isSentForApproval;
data['exaCart_OrderId'] = this.exaCartOrderId; data['ExaCart_OrderId'] = this.exaCartOrderId;
data['ExaCart_GUID'] = this.exaCartGUID;
data['isTimer'] = this.isTimer; data['isTimer'] = this.isTimer;
data['timeSeconds'] = this.timeSeconds; data['TimeSeconds'] = this.timeSeconds;
data['totalPendingSeconds'] = this.totalPendingSeconds; data['TotalPendingSeconds'] = this.totalPendingSeconds;
data['timeMinute'] = this.timeMinute; data['TimeMinute'] = this.timeMinute;
data['timeHour'] = this.timeHour; data['TimeHour'] = this.timeHour;
data['timeTotalSeconds'] = this.timeTotalSeconds; data['TimeTotalSeconds'] = this.timeTotalSeconds;
data['timeTotalMinute'] = this.timeTotalMinute; data['TimeTotalMinute'] = this.timeTotalMinute;
data['timeTotalHour'] = this.timeTotalHour; data['TimeTotalHour'] = this.timeTotalHour;
data['approvalStatus'] = this.approvalStatus; data['ApprovalStatus'] = this.approvalStatus;
data['isActive'] = this.isActive; data['isActive'] = this.isActive;
data['clickButton'] = this.clickButton; data['ClickButton'] = this.clickButton;
data['orderHistory'] = this.orderHistory; data['OrderHistory'] = this.orderHistory;
data['pickupLocation'] = this.pickupLocation; data['PickupLocation'] = this.pickupLocation;
data['dropOffLocation'] = this.dropOffLocation; data['DropOffLocation'] = this.dropOffLocation;
data['clinicName'] = this.clinicName; data['clinicName'] = this.clinicName;
data['doctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['branch'] = this.branch; data['Branch'] = this.branch;
data['time'] = this.time; data['Time'] = this.time;
data['notes'] = this.notes; data['Notes'] = this.notes;
data['id'] = this.id; data['ID'] = this.iD;
data['patientId'] = this.patientId; data['PatientId'] = this.patientId;
data['patientOutSa'] = this.patientOutSa; data['PatientOutSa'] = this.patientOutSa;
data['isOutPatient'] = this.isOutPatient; data['IsOutPatient'] = this.isOutPatient;
data['projectId'] = this.projectId; data['ProjectId'] = this.projectId;
data['nearestProjectId'] = this.nearestProjectId; data['NearestProjectId'] = this.nearestProjectId;
data['longitude'] = this.longitude; data['Longitude'] = this.longitude;
data['latitude'] = this.latitude; data['Latitude'] = this.latitude;
data['appointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['dischargeId'] = this.dischargeId; data['DischargeId'] = this.dischargeId;
data['statusId'] = this.statusId; data['StatusId'] = this.statusId;
data['serviceId'] = this.serviceId; data['ServiceId'] = this.serviceId;
data['channel'] = this.channel; data['Channel'] = this.channel;
if (this.orderpayment != null) { if (this.orderpayment != null) {
data['orderpayment'] = this.orderpayment.toJson(); data['orderpayment'] = this.orderpayment.toJson();
} }
data['orderselectedservice'] = this.orderselectedservice;
data['wforder'] = this.wforder; data['wforder'] = this.wforder;
data['orderapprovalobj'] = this.orderapprovalobj; data['orderapprovalobj'] = this.orderapprovalobj;
data['created'] = this.created; data['Created'] = this.created;
data['createdBy'] = this.createdBy; data['CreatedBy'] = this.createdBy;
data['modified'] = this.modified; data['Modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy; data['ModifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted; data['IsDeleted'] = this.isDeleted;
return data; return data;
} }
} }
class WFOrder { class WFOrder {
dynamic wfButtonsDTO; Null wfButtonsDTO;
int id; num iD;
int orderId; num orderId;
int previousStep; num previousStep;
int nextStep; num nextStep;
int serviceId; num serviceId;
dynamic order; Null order;
String created; String created;
dynamic createdBy; Null createdBy;
dynamic modified; Null modified;
dynamic modifiedBy; Null modifiedBy;
bool isDeleted; bool isDeleted;
WFOrder({this.wfButtonsDTO, this.id, this.orderId, this.previousStep, this.nextStep, this.serviceId, this.order, this.created, this.createdBy, this.modified, this.modifiedBy, this.isDeleted}); WFOrder(
{this.wfButtonsDTO,
this.iD,
this.orderId,
this.previousStep,
this.nextStep,
this.serviceId,
this.order,
this.created,
this.createdBy,
this.modified,
this.modifiedBy,
this.isDeleted});
WFOrder.fromJson(Map<String, dynamic> json) { WFOrder.fromJson(Map<String, dynamic> json) {
wfButtonsDTO = json['wf_ButtonsDTO']; wfButtonsDTO = json['wf_ButtonsDTO'];
id = json['id']; iD = json['ID'];
orderId = json['orderId']; orderId = json['OrderId'];
previousStep = json['previousStep']; previousStep = json['PreviousStep'];
nextStep = json['nextStep']; nextStep = json['NextStep'];
serviceId = json['serviceId']; serviceId = json['ServiceId'];
order = json['order']; order = json['Order'];
created = json['created']; created = json['Created'];
createdBy = json['createdBy']; createdBy = json['CreatedBy'];
modified = json['modified']; modified = json['Modified'];
modifiedBy = json['modifiedBy']; modifiedBy = json['ModifiedBy'];
isDeleted = json['isDeleted']; isDeleted = json['IsDeleted'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['wf_ButtonsDTO'] = this.wfButtonsDTO; data['wf_ButtonsDTO'] = this.wfButtonsDTO;
data['id'] = this.id; data['ID'] = this.iD;
data['orderId'] = this.orderId; data['OrderId'] = this.orderId;
data['previousStep'] = this.previousStep; data['PreviousStep'] = this.previousStep;
data['nextStep'] = this.nextStep; data['NextStep'] = this.nextStep;
data['serviceId'] = this.serviceId; data['ServiceId'] = this.serviceId;
data['order'] = this.order; data['Order'] = this.order;
data['created'] = this.created; data['Created'] = this.created;
data['createdBy'] = this.createdBy; data['CreatedBy'] = this.createdBy;
data['modified'] = this.modified; data['Modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy; data['ModifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted; data['IsDeleted'] = this.isDeleted;
return data; return data;
} }
} }
class Orderpayment { class Orderpayment {
int id; num iD;
int orderId; num orderId;
dynamic clientRequestId; Null clientRequestId;
double totalAmount; num totalAmount;
int paymentStatus; num paymentStatus;
dynamic order; Null order;
String created; String created;
dynamic createdBy; Null createdBy;
dynamic modified; Null modified;
dynamic modifiedBy; Null modifiedBy;
bool isDeleted; bool isDeleted;
Orderpayment({this.id, this.orderId, this.clientRequestId, this.totalAmount, this.paymentStatus, this.order, this.created, this.createdBy, this.modified, this.modifiedBy, this.isDeleted}); Orderpayment(
{this.iD,
this.orderId,
this.clientRequestId,
this.totalAmount,
this.paymentStatus,
this.order,
this.created,
this.createdBy,
this.modified,
this.modifiedBy,
this.isDeleted});
Orderpayment.fromJson(Map<String, dynamic> json) { Orderpayment.fromJson(Map<String, dynamic> json) {
id = json['id']; iD = json['ID'];
orderId = json['orderId']; orderId = json['OrderId'];
clientRequestId = json['clientRequestId']; clientRequestId = json['ClientRequestId'];
totalAmount = json['totalAmount']; totalAmount = json['TotalAmount'];
paymentStatus = json['paymentStatus']; paymentStatus = json['PaymentStatus'];
order = json['order']; order = json['Order'];
created = json['created']; created = json['Created'];
createdBy = json['createdBy']; createdBy = json['CreatedBy'];
modified = json['modified']; modified = json['Modified'];
modifiedBy = json['modifiedBy']; modifiedBy = json['ModifiedBy'];
isDeleted = json['isDeleted']; isDeleted = json['IsDeleted'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id; data['ID'] = this.iD;
data['orderId'] = this.orderId; data['OrderId'] = this.orderId;
data['clientRequestId'] = this.clientRequestId; data['ClientRequestId'] = this.clientRequestId;
data['totalAmount'] = this.totalAmount; data['TotalAmount'] = this.totalAmount;
data['paymentStatus'] = this.paymentStatus; data['PaymentStatus'] = this.paymentStatus;
data['order'] = this.order; data['Order'] = this.order;
data['created'] = this.created; data['Created'] = this.created;
data['createdBy'] = this.createdBy; data['CreatedBy'] = this.createdBy;
data['modified'] = this.modified; data['Modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy; data['ModifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted; data['IsDeleted'] = this.isDeleted;
return data; return data;
} }
} }

@ -10,7 +10,7 @@ class PatientER_RC {
String sessionID; String sessionID;
bool isDentalAllowedBackend; bool isDentalAllowedBackend;
int deviceTypeID; int deviceTypeID;
String patientID; int patientID;
String tokenID; String tokenID;
int patientTypeID; int patientTypeID;
int patientType; int patientType;

@ -1,5 +1,5 @@
class PatientERTransportationMethod { class PatientERTransportationMethod {
int id; int iD;
String serviceID; String serviceID;
int orderServiceID; int orderServiceID;
String text; String text;
@ -12,7 +12,7 @@ class PatientERTransportationMethod {
int quantity; int quantity;
PatientERTransportationMethod( PatientERTransportationMethod(
{this.id, {this.iD,
this.serviceID, this.serviceID,
this.orderServiceID, this.orderServiceID,
this.text, this.text,
@ -25,32 +25,32 @@ class PatientERTransportationMethod {
this.quantity}); this.quantity});
PatientERTransportationMethod.fromJson(Map<String, dynamic> json) { PatientERTransportationMethod.fromJson(Map<String, dynamic> json) {
id = json['id']; iD = json['ID'];
serviceID = json['serviceID']; serviceID = json['ServiceID'];
orderServiceID = json['orderServiceID']; orderServiceID = json['OrderServiceID'];
text = json['text']; text = json['Text'];
textN = json['textN']; textN = json['TextN'];
price = json['price']; price = json['Price'];
priceVAT = json['priceVAT']; priceVAT = json['PriceVAT'];
priceTotal = json['priceTotal']; priceTotal = json['PriceTotal'];
isEnabled = json['isEnabled']; isEnabled = json['IsEnabled'];
orderId = json['orderId']; orderId = json['OrderId'];
quantity = json['quantity']; quantity = json['Quantity'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id; data['ID'] = this.iD;
data['serviceID'] = this.serviceID; data['ServiceID'] = this.serviceID;
data['orderServiceID'] = this.orderServiceID; data['OrderServiceID'] = this.orderServiceID;
data['text'] = this.text; data['Text'] = this.text;
data['textN'] = this.textN; data['TextN'] = this.textN;
data['price'] = this.price; data['Price'] = this.price;
data['priceVAT'] = this.priceVAT; data['PriceVAT'] = this.priceVAT;
data['priceTotal'] = this.priceTotal; data['PriceTotal'] = this.priceTotal;
data['isEnabled'] = this.isEnabled; data['IsEnabled'] = this.isEnabled;
data['orderId'] = this.orderId; data['OrderId'] = this.orderId;
data['quantity'] = this.quantity; data['Quantity'] = this.quantity;
return data; return data;
} }
} }

@ -192,6 +192,8 @@ class PackagesResponseModel with JsonConvert<PackagesResponseModel> {
List<dynamic> discountIds; List<dynamic> discountIds;
@JSONField(name: "store_ids") @JSONField(name: "store_ids")
List<dynamic> storeIds; List<dynamic> storeIds;
@JSONField(name: "store_names")
List<dynamic> storeNames;
@JSONField(name: "manufacturer_ids") @JSONField(name: "manufacturer_ids")
List<int> manufacturerIds; List<int> manufacturerIds;
List<dynamic> reviews; List<dynamic> reviews;
@ -207,12 +209,10 @@ class PackagesResponseModel with JsonConvert<PackagesResponseModel> {
String seName; String seName;
String getName() { String getName() {
if(localizedNames.length == 2){ if (localizedNames.length == 2) {
if(localizedNames.first.languageId == 2) if (localizedNames.first.languageId == 2)
return localizedNames.first.localizedName ?? name; return localizedNames.first.localizedName ?? name;
else if (localizedNames.first.languageId == 1) return localizedNames.last.localizedName ?? name;
else if(localizedNames.first.languageId == 1)
return localizedNames.last.localizedName ?? name;
} }
return name; return name;
} }

@ -1,157 +0,0 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class Prescriptions {
String setupID;
int projectID;
int patientID;
int appointmentNo;
String appointmentDate;
String doctorName;
String clinicDescription;
String name;
int episodeID;
int actualDoctorRate;
int admission;
int clinicID;
String companyName;
String despensedStatus;
DateTime dischargeDate;
int dischargeNo;
int doctorID;
String doctorImageURL;
int doctorRate;
String doctorTitle;
int gender;
String genderDescription;
bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
bool isInOutPatient;
String isInOutPatientDescription;
String isInOutPatientDescriptionN;
bool isInsurancePatient;
String nationalityFlagURL;
int noOfPatientsRate;
String qR;
List<String> speciality;
Prescriptions(
{this.setupID,
this.projectID,
this.patientID,
this.appointmentNo,
this.appointmentDate,
this.doctorName,
this.clinicDescription,
this.name,
this.episodeID,
this.actualDoctorRate,
this.admission,
this.clinicID,
this.companyName,
this.despensedStatus,
this.dischargeDate,
this.dischargeNo,
this.doctorID,
this.doctorImageURL,
this.doctorRate,
this.doctorTitle,
this.gender,
this.genderDescription,
this.isActiveDoctorProfile,
this.isDoctorAllowVedioCall,
this.isExecludeDoctor,
this.isInOutPatient,
this.isInOutPatientDescription,
this.isInOutPatientDescriptionN,
this.isInsurancePatient,
this.nationalityFlagURL,
this.noOfPatientsRate,
this.qR,
this.speciality});
Prescriptions.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
patientID = json['PatientID'];
appointmentNo = json['AppointmentNo'];
appointmentDate = json['AppointmentDate'];
doctorName = json['DoctorName'];
clinicDescription = json['ClinicDescription'];
name = json['Name'];
episodeID = json['EpisodeID'];
actualDoctorRate = json['ActualDoctorRate'];
admission = json['Admission'];
clinicID = json['ClinicID'];
companyName = json['CompanyName'];
despensedStatus = json['Despensed_Status'];
dischargeDate = DateUtil.convertStringToDate(json['DischargeDate']);
dischargeNo = json['DischargeNo'];
doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL'];
doctorRate = json['DoctorRate'];
doctorTitle = json['DoctorTitle'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isExecludeDoctor = json['IsExecludeDoctor'];
isInOutPatient = json['IsInOutPatient'];
isInOutPatientDescription = json['IsInOutPatientDescription'];
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
isInsurancePatient = json['IsInsurancePatient'];
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
qR = json['QR'];
// speciality = json['Speciality'].cast<String>();
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['PatientID'] = this.patientID;
data['AppointmentNo'] = this.appointmentNo;
data['AppointmentDate'] = this.appointmentDate;
data['DoctorName'] = this.doctorName;
data['ClinicDescription'] = this.clinicDescription;
data['Name'] = this.name;
data['EpisodeID'] = this.episodeID;
data['ActualDoctorRate'] = this.actualDoctorRate;
data['Admission'] = this.admission;
data['ClinicID'] = this.clinicID;
data['CompanyName'] = this.companyName;
data['Despensed_Status'] = this.despensedStatus;
data['DischargeDate'] = this.dischargeDate;
data['DischargeNo'] = this.dischargeNo;
data['DoctorID'] = this.doctorID;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorRate'] = this.doctorRate;
data['DoctorTitle'] = this.doctorTitle;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
data['IsExecludeDoctor'] = this.isExecludeDoctor;
data['IsInOutPatient'] = this.isInOutPatient;
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
data['IsInsurancePatient'] = this.isInsurancePatient;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['QR'] = this.qR;
data['Speciality'] = this.speciality;
return data;
}
}
//class PrescriptionsList {
// String filterName = "";
// List<Prescriptions> prescriptionsList = List();
//
// PrescriptionsList({this.filterName, Prescriptions prescriptions}) {
// prescriptionsList.add(prescriptions);
// }
//}

@ -8,6 +8,7 @@ class ShoppingCartResponse {
double subtotalWithVat; double subtotalWithVat;
double subtotalVatAmount; double subtotalVatAmount;
double subtotalVatRate; double subtotalVatRate;
double totalAmount;
List<ShoppingCart> shoppingCarts; List<ShoppingCart> shoppingCarts;
ShoppingCartResponse( ShoppingCartResponse(
@ -16,7 +17,8 @@ class ShoppingCartResponse {
this.subtotal=0.0, this.subtotal=0.0,
this.subtotalWithVat = 0.0, this.subtotalWithVat = 0.0,
this.subtotalVatAmount = 0.0, this.subtotalVatAmount = 0.0,
this.subtotalVatRate = 0.0 , this.subtotalVatRate = 0.0,
this.totalAmount = 0.0,
this.shoppingCarts}); this.shoppingCarts});

@ -0,0 +1,52 @@
class PrescriptionInfoRCModel {
String itemDescription;
String image;
String sKU;
dynamic productId;
dynamic productName;
int quantity;
int orderId;
int totalPrice;
int dispenseQuantity;
dynamic itemhand;
PrescriptionInfoRCModel(
{this.itemDescription,
this.image,
this.sKU,
this.productId,
this.productName,
this.quantity,
this.orderId,
this.totalPrice,
this.dispenseQuantity,
this.itemhand});
PrescriptionInfoRCModel.fromJson(Map<String, dynamic> json) {
itemDescription = json['ItemDescription'];
image = json['image'];
sKU = json['SKU'];
productId = json['ProductId'];
productName = json['ProductName'];
quantity = json['Quantity'];
orderId = json['OrderId'];
totalPrice = json['TotalPrice'];
dispenseQuantity = json['DispenseQuantity'];
itemhand = json['itemhand'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ItemDescription'] = this.itemDescription;
data['image'] = this.image;
data['SKU'] = this.sKU;
data['ProductId'] = this.productId;
data['ProductName'] = this.productName;
data['Quantity'] = this.quantity;
data['OrderId'] = this.orderId;
data['TotalPrice'] = this.totalPrice;
data['DispenseQuantity'] = this.dispenseQuantity;
data['itemhand'] = this.itemhand;
return data;
}
}

@ -28,7 +28,7 @@ class CMCService extends BaseService {
hasError = false; hasError = false;
// RC IMPLEMENTATION // RC IMPLEMENTATION
await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isAllowAny: true, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isRCService: true, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {
cmcAllServicesList.clear(); cmcAllServicesList.clear();
response['response'].forEach((data) { response['response'].forEach((data) {
cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data));
@ -67,7 +67,7 @@ class CMCService extends BaseService {
Future getCmcAllPresOrdersRC() async { Future getCmcAllPresOrdersRC() async {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel(); GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel();
hasError = false; hasError = false;
await baseAppClient.post(GET_ALL_CMC_ORDERS_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_CMC_ORDERS_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
cmcAllPresOrdersList.clear(); cmcAllPresOrdersList.clear();
cmcAllOrderDetail.clear(); cmcAllOrderDetail.clear();
@ -122,7 +122,7 @@ class CMCService extends BaseService {
Future updateCmcPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { Future updateCmcPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(UPDATE_CMC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(UPDATE_CMC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true; isOrderUpdated = true;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -133,7 +133,7 @@ class CMCService extends BaseService {
Future<String> insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async { Future<String> insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async {
hasError = false; hasError = false;
String reqId = ""; String reqId = "";
await baseAppClient.post(ADD_CMC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(ADD_CMC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true; isOrderUpdated = true;
reqId = response['response'].toString(); reqId = response['response'].toString();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -38,7 +38,7 @@ class HomeHealthCareService extends BaseService {
Future getHHCAllServicesRC(HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async { Future getHHCAllServicesRC(HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(HHC_GET_ALL_SERVICES_RC + "?PatientID=" + user.patientID.toString(), onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(HHC_GET_ALL_SERVICES_RC + "?PatientID=" + user.patientID.toString(), isRCService: true, onSuccess: (dynamic response, int statusCode) {
hhcAllServicesList.clear(); hhcAllServicesList.clear();
response['response'].forEach((data) { response['response'].forEach((data) {
hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data)); hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data));
@ -52,7 +52,7 @@ class HomeHealthCareService extends BaseService {
Future getHHCAllPresOrdersRC() async { Future getHHCAllPresOrdersRC() async {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel(); GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel();
hasError = false; hasError = false;
await baseAppClient.post(GET_ALL_HHC_ORDERS_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_HHC_ORDERS_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
hhcAllPresOrdersList.clear(); hhcAllPresOrdersList.clear();
hhcAllOrderDetail.clear(); hhcAllOrderDetail.clear();
response['response'].forEach((data) { response['response'].forEach((data) {
@ -106,7 +106,7 @@ class HomeHealthCareService extends BaseService {
Future updateHHCPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { Future updateHHCPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(UPDATE_HHC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(UPDATE_HHC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true; isOrderUpdated = true;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -127,7 +127,7 @@ class HomeHealthCareService extends BaseService {
Future insertHHCOrderRC({PatientERInsertPresOrderRequestModel order}) async { Future insertHHCOrderRC({PatientERInsertPresOrderRequestModel order}) async {
hasError = false; hasError = false;
await baseAppClient.post(ADD_HHC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(ADD_HHC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
hhcResponse = response; hhcResponse = response;
requestNo = response["response"]; requestNo = response["response"];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -10,13 +10,13 @@ class BloodDonationService extends BaseService {
List<CitiesModel> CitiesModelList = List(); List<CitiesModel> CitiesModelList = List();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
Future getAllCitiesOrders() async { Future getAllCitiesOrders() async {
hasError = false; hasError = false;
body['ListCities'] = false; body['ListCities'] = false;
await baseAppClient.post(GET_CITIES_REQUEST, body["IsPublicRequest"] = true;
onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_CITIES_REQUEST, onSuccess: (dynamic response, int statusCode) {
CitiesModelList.clear(); CitiesModelList.clear();
response['ListCities'].forEach((vital) { response['ListCities'].forEach((vital) {
CitiesModelList.add(CitiesModel.fromJson(vital)); CitiesModelList.add(CitiesModel.fromJson(vital));
}); });
@ -25,16 +25,16 @@ class BloodDonationService extends BaseService {
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
Future bloodDonationSave(request) async { Future bloodDonationSave(request) async {
var localRes; var localRes;
try { try {
await baseAppClient.post(SAVE_BLOOD_REQUEST, await baseAppClient.post(SAVE_BLOOD_REQUEST, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { localRes = error;
localRes = error; return Future.value(error);
return Future.value(error); }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
throw error; throw error;
@ -44,30 +44,27 @@ class BloodDonationService extends BaseService {
Future getAgreement() async { Future getAgreement() async {
var localRes; var localRes;
try { try {
await baseAppClient.post(GET_BLOOD_AGREEMENT, await baseAppClient.post(GET_BLOOD_AGREEMENT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { localRes = error;
localRes = error; return Future.value(error);
return Future.value(error); }, body: {});
}, body: {});
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
throw error; throw error;
} }
} }
Future saveAgreement(request) async { Future saveAgreement(request) async {
var localRes; var localRes;
try { try {
await baseAppClient.post(SAVE_BLOOD_AGREEMENT, await baseAppClient.post(SAVE_BLOOD_AGREEMENT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { localRes = error;
localRes = error; return Future.value(error);
return Future.value(error); }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
throw error; throw error;

@ -35,12 +35,20 @@ VitalSignService _vitalSignService = locator<VitalSignService>();
class BaseAppClient { class BaseAppClient {
post(String endPoint, post(String endPoint,
{Map<String, dynamic> body, Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, bool isAllowAny = false, bool isExternal = false}) async { {Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false,
bool isRCService = false}) async {
String url; String url;
if (isExternal) { if (isExternal) {
url = endPoint; url = endPoint;
} else { } else {
url = BASE_URL + endPoint; if (isRCService)
url = RC_BASE_URL + endPoint;
else
url = BASE_URL + endPoint;
} }
try { try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
@ -116,7 +124,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1009199553; // body['IdentificationNo'] = 1009199553;
// body['MobileNo'] = "966545156035"; // body['MobileNo'] = "966545156035";
// body['PatientID'] = 1018977; // body['PatientID'] = 1018977; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);
@ -376,12 +384,20 @@ class BaseAppClient {
Navigator.pushReplacement(context, FadePage(page: AppUpdatePage(appUpdateText: text))); Navigator.pushReplacement(context, FadePage(page: AppUpdatePage(appUpdateText: text)));
} }
get(String endPoint, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, dynamic> queryParams, bool isExternal = false}) async { get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, dynamic> queryParams,
bool isExternal = false,
bool isRCService = false}) async {
String url; String url;
if (isExternal) { if (isExternal) {
url = endPoint; url = endPoint;
} else { } else {
url = BASE_URL + endPoint; if (isRCService)
url = RC_BASE_URL + endPoint;
else
url = BASE_URL + endPoint;
} }
if (queryParams != null) { if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query; String queryString = Uri(queryParameters: queryParams).query;
@ -465,7 +481,7 @@ class BaseAppClient {
simplePost( simplePost(
String fullUrl, { String fullUrl, {
Map<String, dynamic> body, Map<dynamic, dynamic> body,
Map<String, String> headers, Map<String, String> headers,
Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
@ -480,7 +496,6 @@ class BaseAppClient {
body: json.encode(body), body: json.encode(body),
headers: headers, headers: headers,
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePost(fullUrl, onFailure: onFailure, onSuccess: onSuccess, body: body, headers: headers); if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePost(fullUrl, onFailure: onFailure, onSuccess: onSuccess, body: body, headers: headers);
@ -498,7 +513,6 @@ class BaseAppClient {
simpleGet(String fullUrl, simpleGet(String fullUrl,
{Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, String> queryParams, Map<String, String> headers}) async { {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, String> queryParams, Map<String, String> headers}) async {
String url = fullUrl; String url = fullUrl;
print("URL Query String: $url");
var haveParams = (queryParams != null); var haveParams = (queryParams != null);
if (haveParams) { if (haveParams) {
@ -690,6 +704,7 @@ class BaseAppClient {
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']
@ -724,7 +739,7 @@ class BaseAppClient {
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
var parsed = json.decode(utf8.decode(response.bodyBytes)); var parsed = json.decode(utf8.decode(response.bodyBytes));
onFailure(parsed['error']['ErrorEndUserMsg'] ?? 'Error While Fetching data', statusCode); onFailure(parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode);
} else { } else {
// var parsed = json.decode(response.body.toString()); // var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes)); var parsed = json.decode(utf8.decode(response.bodyBytes));

@ -28,9 +28,9 @@ class AmService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = user.patientIdentificationNo;
await baseAppClient.get(GET_ALL_TRANSPORTATIONS_RC + "?patientID=" + user.patientID.toString(), isExternal: false, onSuccess: (dynamic response, int statusCode) { await baseAppClient.get(GET_ALL_TRANSPORTATIONS_RC + "?patientID=" + user.patientID.toString(), isRCService: true, isExternal: false, onSuccess: (dynamic response, int statusCode) {
amModelList.clear(); amModelList.clear();
response['data']['transportationservices'].forEach((item) { response['response']['transportationservices'].forEach((item) {
amModelList.add(PatientERTransportationMethod.fromJson(item)); amModelList.add(PatientERTransportationMethod.fromJson(item));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -69,18 +69,18 @@ class AmService extends BaseService {
pickUpRequestPresOrder = null; pickUpRequestPresOrder = null;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['patientId'] = patientID.toString(); body['patientId'] = patientID;
body['PatientID'] = patientID.toString(); body['PatientID'] = patientID;
await baseAppClient.post(GET_ALL_TRANSPORTATIONS_ORDERS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_TRANSPORTATIONS_ORDERS, isRCService: true, onSuccess: (dynamic response, int statusCode) {
patientAmbulanceRequestOrdersList.clear(); patientAmbulanceRequestOrdersList.clear();
hasPendingOrder = false; hasPendingOrder = false;
pendingOrderID = 0; pendingOrderID = 0;
pendingAmbulanceRequestOrder = null; pendingAmbulanceRequestOrder = null;
response['data'].forEach((item) { response['response'].forEach((item) {
patientAmbulanceRequestOrdersList.add(AmbulanceRequestOrdersModel.fromJson(item)); patientAmbulanceRequestOrdersList.add(AmbulanceRequestOrdersModel.fromJson(item));
if (item['statusId'] == 1) { if (item['StatusId'] == 1) {
hasPendingOrder = true; hasPendingOrder = true;
pendingOrderID = item['orderpayment']['id']; pendingOrderID = item['orderpayment']['id'];
pendingOrderStatus = item['statusText']; pendingOrderStatus = item['statusText'];
@ -127,14 +127,14 @@ class AmService extends BaseService {
}, body: body); }, body: body);
} }
Future updatePressOrderRC({@required int presOrderID, @required String patientID}) async { Future updatePressOrderRC({@required int presOrderID, @required int patientID}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['Id'] = presOrderID; body['Id'] = presOrderID;
body['StatusId'] = 6; body['StatusId'] = 6;
body['ClickButton'] = 14; body['ClickButton'] = 14;
body['PatientID'] = patientID; body['PatientID'] = patientID;
await baseAppClient.post(CANCEL_AMBULANCE_REQUEST, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(CANCEL_AMBULANCE_REQUEST, isRCService: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
@ -146,7 +146,7 @@ class AmService extends BaseService {
var body = patientER.toJson(); var body = patientER.toJson();
print(body); print(body);
await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
@ -25,8 +26,8 @@ class HospitalService extends BaseService {
if(isResBasedOnLoc) if(isResBasedOnLoc)
await _getCurrentLocation(); await _getCurrentLocation();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['Latitude'] = isResBasedOnLoc?_latitude:0; body['Latitude'] = await this.sharedPref.getDouble(USER_LAT);
body['Longitude'] = isResBasedOnLoc?_longitude:0; body['Longitude'] = await this.sharedPref.getDouble(USER_LONG);
body['IsOnlineCheckIn'] = isResBasedOnLoc; body['IsOnlineCheckIn'] = isResBasedOnLoc;
body['PatientOutSA'] = 0; body['PatientOutSA'] = 0;

@ -28,7 +28,7 @@ class MyBalanceService extends BaseService {
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
MyBalanceService() { MyBalanceService() {
getFamilyFiles(); // getFamilyFiles();
} }
getPatientAdvanceBalanceAmount() async { getPatientAdvanceBalanceAmount() async {

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_info_rc_model.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
@ -18,6 +19,7 @@ class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List(); List<Prescriptions> prescriptionsList = List();
List<PrescriptionReportINP> prescriptionReportListINP = List(); List<PrescriptionReportINP> prescriptionReportListINP = List();
List<GetCMCAllOrdersResponseModel> prescriptionsOrderList = List(); List<GetCMCAllOrdersResponseModel> prescriptionsOrderList = List();
List<PrescriptionInfoRCModel> prescriptionsOrderListRC = List();
var isMedDeliveryAllowed; var isMedDeliveryAllowed;
Future getPrescriptions() async { Future getPrescriptions() async {
@ -49,6 +51,20 @@ class PrescriptionsService extends BaseService {
}, body: body); }, body: body);
} }
Future getPrescriptionsInfoRC(int orderID, dynamic patientID) async {
prescriptionsOrderListRC.clear();
Map<String, dynamic> body = Map();
body['ID'] = orderID;
await baseAppClient.post(GET_ALL_PRESCRIPTION_INFO_RC + "?PatientId=" + patientID.toString(), onSuccess: (dynamic response, int statusCode) {
response['response']['report'].forEach((prescriptionsOrder) {
prescriptionsOrderListRC.add(PrescriptionInfoRCModel.fromJson(prescriptionsOrder));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getPrescriptionsOrdersRC() async { Future getPrescriptionsOrdersRC() async {
prescriptionsOrderList.clear(); prescriptionsOrderList.clear();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -162,7 +178,6 @@ class PrescriptionsService extends BaseService {
List<PrescriptionReportEnh> prescriptionReportEnhList = List(); List<PrescriptionReportEnh> prescriptionReportEnhList = List();
Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async { Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
///This logic copy from the old app from class [order-history.component.ts] in line 45
bool isInPatient = false; bool isInPatient = false;
prescriptionsList.forEach((element) { prescriptionsList.forEach((element) {
if (prescriptionsOrder.appointmentNo == "0") { if (prescriptionsOrder.appointmentNo == "0") {
@ -184,8 +199,6 @@ class PrescriptionsService extends BaseService {
_requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.setupID = element.setupID;
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
isInPatient = element.isInOutPatient; isInPatient = element.isInOutPatient;
///call inpGetPrescriptionReport
} }
} }
}); });
@ -212,6 +225,18 @@ class PrescriptionsService extends BaseService {
}, body: _requestPrescriptionReportEnh.toJson()); }, body: _requestPrescriptionReportEnh.toJson());
} }
Future updatePressOrderRC({@required int presOrderID}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['Id'] = presOrderID;
body['StatusId'] = 6;
body['ClickButton'] = 14;
await baseAppClient.post(UPDATE_PRESCRIPTION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future updatePressOrder({@required int presOrderID}) async { Future updatePressOrder({@required int presOrderID}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();

@ -4,6 +4,7 @@ import 'dart:developer';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/ResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/ResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/requests/AddProductToCartRequestModel.dart'; import 'package:diplomaticquarterapp/core/model/packages_offers/requests/AddProductToCartRequestModel.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/requests/CreateCustomerRequestModel.dart'; import 'package:diplomaticquarterapp/core/model/packages_offers/requests/CreateCustomerRequestModel.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart'; import 'package:diplomaticquarterapp/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart';
@ -15,13 +16,12 @@ import 'package:diplomaticquarterapp/core/model/packages_offers/responses/Packag
import 'package:diplomaticquarterapp/core/model/packages_offers/responses/order_response_model.dart'; import 'package:diplomaticquarterapp/core/model/packages_offers/responses/order_response_model.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/responses/tamara_payment_option.dart'; import 'package:diplomaticquarterapp/core/model/packages_offers/responses/tamara_payment_option.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
var packagesAuthHeader = <String,String>{'Authorization' : ''}; Map<String, String> packagesAuthHeader = {};
class OffersAndPackagesServices extends BaseService { class OffersAndPackagesServices extends BaseService {
AuthenticatedUser patientUser; AuthenticatedUser patientUser;
List<PackagesCategoriesResponseModel> categoryList = List(); List<PackagesCategoriesResponseModel> categoryList = List();
@ -31,9 +31,10 @@ class OffersAndPackagesServices extends BaseService {
List<PackagesResponseModel> bestSellerList = List(); List<PackagesResponseModel> bestSellerList = List();
List<PackagesResponseModel> bannersList = List(); List<PackagesResponseModel> bannersList = List();
List<PackagesCartItemsResponseModel> cartItemList = List(); List<PackagesCartItemsResponseModel> cartItemList = List();
List<HospitalsModel> _hospitals = List();
List<HospitalsModel> get hospitals => _hospitals;
String cartItemCount = ""; String cartItemCount = "";
PackagesCustomerResponseModel customer; PackagesCustomerResponseModel customer;
Future<List<PackagesCategoriesResponseModel>> getAllCategories(OffersCategoriesRequestModel request) async { Future<List<PackagesCategoriesResponseModel>> getAllCategories(OffersCategoriesRequestModel request) async {
@ -47,8 +48,7 @@ class OffersAndPackagesServices extends BaseService {
categoryList.add(PackagesCategoriesResponseModel().fromJson(json)); categoryList.add(PackagesCategoriesResponseModel().fromJson(json));
}); });
} }
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {}, queryParams: request.toFlatMap());
}, queryParams: request.toFlatMap());
return categoryList; return categoryList;
} }
@ -67,15 +67,13 @@ class OffersAndPackagesServices extends BaseService {
productList.add(PackagesResponseModel().fromJson(json)); productList.add(PackagesResponseModel().fromJson(json));
}); });
} }
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {}, queryParams: request.toFlatMap());
}, queryParams: request.toFlatMap());
return productList; return productList;
} }
Future<List<TamaraPaymentOption>> getTamaraOptions({@required BuildContext context, @required bool showLoading = true}) async { Future<List<TamaraPaymentOption>> getTamaraOptions({@required BuildContext context, @required bool showLoading = true}) async {
if(tamaraPaymentOptions != null && tamaraPaymentOptions.isNotEmpty) if (tamaraPaymentOptions != null && tamaraPaymentOptions.isNotEmpty) return tamaraPaymentOptions;
return tamaraPaymentOptions;
var url = EXA_CART_API_BASE_URL + PACKAGES_TAMARA_OPT; var url = EXA_CART_API_BASE_URL + PACKAGES_TAMARA_OPT;
await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) { await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
@ -93,9 +91,9 @@ class OffersAndPackagesServices extends BaseService {
} }
Future<List<PackagesResponseModel>> getLatestOffers({@required OffersProductsRequestModel request, @required BuildContext context, @required bool showLoading = true}) async { Future<List<PackagesResponseModel>> getLatestOffers({@required OffersProductsRequestModel request, @required BuildContext context, @required bool showLoading = true}) async {
var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS; var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS;
await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) { await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
latestOffersList.clear();
if (statusCode == 200) { if (statusCode == 200) {
var jsonResponse = json.decode(stringResponse); var jsonResponse = json.decode(stringResponse);
jsonResponse['products'].forEach((json) { jsonResponse['products'].forEach((json) {
@ -110,9 +108,9 @@ class OffersAndPackagesServices extends BaseService {
} }
Future<List<PackagesResponseModel>> getBestSellers({@required OffersProductsRequestModel request, @required BuildContext context, @required bool showLoading = true}) async { Future<List<PackagesResponseModel>> getBestSellers({@required OffersProductsRequestModel request, @required BuildContext context, @required bool showLoading = true}) async {
var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS; var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS;
await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) { await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
bestSellerList.clear();
if (statusCode == 200) { if (statusCode == 200) {
var jsonResponse = json.decode(stringResponse); var jsonResponse = json.decode(stringResponse);
jsonResponse['products'].forEach((json) { jsonResponse['products'].forEach((json) {
@ -126,7 +124,6 @@ class OffersAndPackagesServices extends BaseService {
return bestSellerList; return bestSellerList;
} }
Future<List<PackagesResponseModel>> getBanners({@required OffersProductsRequestModel request, @required BuildContext context, @required bool showLoading = true}) async { Future<List<PackagesResponseModel>> getBanners({@required OffersProductsRequestModel request, @required BuildContext context, @required bool showLoading = true}) async {
var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS; var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS;
await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) { await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
@ -143,15 +140,13 @@ class OffersAndPackagesServices extends BaseService {
return bannersList; return bannersList;
} }
Future loadOffersPackagesDataForMainPage({@required BuildContext context, bool showLoading = true, Function completion }) async { Future loadOffersPackagesDataForMainPage({@required BuildContext context, bool showLoading = true, Function completion}) async {
var finished = 0; var finished = 0;
var totalCalls = 3; var totalCalls = 2;
completedAll(){
completedAll() {
finished++; finished++;
if(completion != null && finished == totalCalls) { if (completion != null && finished == totalCalls) {
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
completion(); completion();
} }
@ -160,57 +155,56 @@ class OffersAndPackagesServices extends BaseService {
_showLoading(context, showLoading); _showLoading(context, showLoading);
final auth_token = await baseAppClient.generatePackagesToken(); final auth_token = await baseAppClient.generatePackagesToken();
if(auth_token == null){ if (auth_token == null) {
throw 'Something went wrong while authentication, Please try again letter'; throw 'Something went wrong while authentication, Please try again letter';
} }
packagesAuthHeader["Authorization"] = 'Bearer $auth_token'; packagesAuthHeader["Authorization"] = 'Bearer $auth_token';
// Check and Create Customer // Check and Create Customer
if(patientUser != null){ if (patientUser != null) {
customer = await getCurrentCustomer(context: context, showLoading: showLoading); customer = await getCurrentCustomer(context: context, showLoading: showLoading);
if(customer == null){ if (customer == null) {
createCustomer(PackagesCustomerRequestModel.fromUser(patientUser), context: context); createCustomer(PackagesCustomerRequestModel.fromUser(patientUser), context: context);
} }
} }
// Performing Parallel Request on same time // Performing Parallel Request on same time
// # 1 // # 1
getBestSellers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){ getBestSellers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value) {
completedAll(); completedAll();
}); });
// # 2 // # 2
getLatestOffers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){ getLatestOffers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value) {
completedAll(); completedAll();
}); });
// # 3 // # 3
getBanners(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){ // getBanners(
completedAll(); // request: OffersProductsRequestModel(),
}); // context: context,
// showLoading: false)
// .then((value) {
// completedAll();
// });
} }
// -------------------- // --------------------
// Create Customer // Create Customer
// -------------------- // --------------------
Future createCustomer(PackagesCustomerRequestModel request, {@required BuildContext context, bool showLoading = true, Function(bool) completion }) async{ Future createCustomer(PackagesCustomerRequestModel request, {@required BuildContext context, bool showLoading = true, Function(bool) completion}) async {
if(customer != null) if (customer != null) return Future.value(customer);
return Future.value(customer);
customer = null; customer = null;
Future errorThrow; Future errorThrow;
_showLoading(context, showLoading); _showLoading(context, showLoading);
var url = EXA_CART_API_BASE_URL + PACKAGES_CUSTOMER; var url = EXA_CART_API_BASE_URL + PACKAGES_CUSTOMER;
await baseAppClient.simplePost(url, headers: packagesAuthHeader, body: request.json(), onSuccess: (dynamic stringResponse, int statusCode){ await baseAppClient.simplePost(url, headers: packagesAuthHeader, body: request.json(), onSuccess: (dynamic stringResponse, int statusCode) {
var jsonResponse = json.decode(stringResponse); var jsonResponse = json.decode(stringResponse);
var customerJson = jsonResponse['customers'].first; var customerJson = jsonResponse['customers'].first;
customer = PackagesCustomerResponseModel.fromJson(customerJson); customer = PackagesCustomerResponseModel.fromJson(customerJson);
}, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode){
errorThrow = Future.error(error); errorThrow = Future.error(error);
log(error); log(error);
}); });
@ -221,37 +215,33 @@ class OffersAndPackagesServices extends BaseService {
return errorThrow ?? customer; return errorThrow ?? customer;
} }
Future<PackagesCustomerResponseModel> getCurrentCustomer({@required BuildContext context, bool showLoading = true}) async{ Future<PackagesCustomerResponseModel> getCurrentCustomer({@required BuildContext context, bool showLoading = true}) async {
if(customer != null) if (customer != null) return Future.value(customer);
return Future.value(customer);
_showLoading(context, showLoading); _showLoading(context, showLoading);
var url = EXA_CART_API_BASE_URL + PACKAGES_CUSTOMER + "/username/${patientUser.patientID}"; var url = EXA_CART_API_BASE_URL + PACKAGES_CUSTOMER + "/username/${patientUser.patientID}";
await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode){ await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
var jsonResponse = json.decode(stringResponse); var jsonResponse = json.decode(stringResponse);
var customerJson = jsonResponse['customers'].first; var customerJson = jsonResponse['customers'].first;
customer = PackagesCustomerResponseModel.fromJson(customerJson); customer = PackagesCustomerResponseModel.fromJson(customerJson);
}, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode){
log(error); log(error);
}); });
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
return customer; return customer;
} }
// -------------------- // --------------------
// Shopping Cart // Shopping Cart
// -------------------- // --------------------
Future<Map<String,dynamic>> cartItems({@required BuildContext context, bool showLoading = true}) async{ Future<Map<String, dynamic>> cartItems({@required BuildContext context, bool showLoading = true}) async {
Future errorThrow; Future errorThrow;
cartItemList.clear(); cartItemList.clear();
_showLoading(context, showLoading); _showLoading(context, showLoading);
var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART + '/${customer.id}'; var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART + '/${customer.id}';
Map<String,dynamic> jsonResponse; Map<String, dynamic> jsonResponse;
await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) { await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
@ -259,17 +249,16 @@ class OffersAndPackagesServices extends BaseService {
jsonResponse['shopping_carts'].forEach((json) { jsonResponse['shopping_carts'].forEach((json) {
cartItemList.add(PackagesCartItemsResponseModel.fromJson(json)); cartItemList.add(PackagesCartItemsResponseModel.fromJson(json));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
log(error); log(error);
errorThrow = Future.error({"error":error, "statusCode":statusCode}); errorThrow = Future.error({"error": error, "statusCode": statusCode});
}, queryParams: null); }, queryParams: null);
return errorThrow ?? jsonResponse; return errorThrow ?? jsonResponse;
} }
Future<ResponseModel<PackagesCartItemsResponseModel>> addProductToCart(AddProductToCartRequestModel request, {@required BuildContext context, bool showLoading = true}) async{ Future<ResponseModel<PackagesCartItemsResponseModel>> addProductToCart(AddProductToCartRequestModel request, {@required BuildContext context, bool showLoading = true}) async {
Future errorThrow; Future errorThrow;
ResponseModel<PackagesCartItemsResponseModel> response; ResponseModel<PackagesCartItemsResponseModel> response;
@ -277,15 +266,14 @@ class OffersAndPackagesServices extends BaseService {
_showLoading(context, showLoading); _showLoading(context, showLoading);
var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART; var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART;
await baseAppClient.simplePost(url, headers: packagesAuthHeader, body: request.json(), onSuccess: (dynamic stringResponse, int statusCode){ await baseAppClient.simplePost(url, headers: packagesAuthHeader, body: request.json(), onSuccess: (dynamic stringResponse, int statusCode) {
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
var jsonResponse = json.decode(stringResponse); var jsonResponse = json.decode(stringResponse);
var jsonCartItem = jsonResponse["shopping_carts"][0]; var jsonCartItem = jsonResponse["shopping_carts"][0];
response = ResponseModel(status: true, data: PackagesCartItemsResponseModel.fromJson(jsonCartItem), error: null); response = ResponseModel(status: true, data: PackagesCartItemsResponseModel.fromJson(jsonCartItem), error: null);
cartItemCount = (jsonResponse['count'] ?? 0).toString(); cartItemCount = (jsonResponse['count'] ?? 0).toString();
}, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode){
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
errorThrow = Future.error(ResponseModel(status: true, data: null, error: error)); errorThrow = Future.error(ResponseModel(status: true, data: null, error: error));
}); });
@ -293,39 +281,35 @@ class OffersAndPackagesServices extends BaseService {
return errorThrow ?? response; return errorThrow ?? response;
} }
Future updateProductToCart(int cartItemID, {UpdateProductToCartRequestModel request, @required BuildContext context, bool showLoading = true}) async{ Future updateProductToCart(int cartItemID, {UpdateProductToCartRequestModel request, @required BuildContext context, bool showLoading = true}) async {
Future errorThrow; Future errorThrow;
_showLoading(context, showLoading); _showLoading(context, showLoading);
var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART + '/$cartItemID'; var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART + '/$cartItemID';
await baseAppClient.simplePut(url, headers: packagesAuthHeader, body: request.json(), onSuccess: (dynamic stringResponse, int statusCode){ await baseAppClient.simplePut(url, headers: packagesAuthHeader, body: request.json(), onSuccess: (dynamic stringResponse, int statusCode) {
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
var jsonResponse = json.decode(stringResponse); var jsonResponse = json.decode(stringResponse);
}, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode){
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
log(error); log(error);
errorThrow = Future.error({"error":error, "statusCode":statusCode}); errorThrow = Future.error({"error": error, "statusCode": statusCode});
}); });
return errorThrow ?? bannersList; return errorThrow ?? bannersList;
} }
Future<bool> deleteProductFromCart(int cartItemID, {@required BuildContext context, bool showLoading = true}) async {
Future<bool> deleteProductFromCart(int cartItemID, {@required BuildContext context, bool showLoading = true}) async{
Future errorThrow; Future errorThrow;
_showLoading(context, showLoading); _showLoading(context, showLoading);
var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART + '/$cartItemID'; var url = EXA_CART_API_BASE_URL + PACKAGES_SHOPPING_CART + '/$cartItemID';
await baseAppClient.simpleDelete(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode){ await baseAppClient.simpleDelete(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
// var jsonResponse = json.decode(stringResponse); }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode){
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
log(error); log(error);
errorThrow = Future.error({"error":error, "statusCode":statusCode}); errorThrow = Future.error({"error": error, "statusCode": statusCode});
}); });
return errorThrow ?? true; return errorThrow ?? true;
@ -334,29 +318,28 @@ class OffersAndPackagesServices extends BaseService {
// -------------------- // --------------------
// Place Order // Place Order
// -------------------- // --------------------
Future placeOrder({@required Map<dynamic,dynamic> paymentParams, @required BuildContext context, bool showLoading = true}) async{ Future placeOrder({@required Map<dynamic, dynamic> paymentParams, @required int projectID, @required BuildContext context, bool showLoading = true}) async {
Future errorThrow; Future errorThrow;
Map<dynamic,dynamic> jsonBody = { Map<dynamic, dynamic> jsonBody = {
"customer_id" : customer.id, "customer_id": customer.id,
"billing_address": { "project_id": projectID,
"email": patientUser.emailAddress, "billing_address": {"email": patientUser.emailAddress, "phone_number": patientUser.mobileNumber},
"phone_number": patientUser.mobileNumber
},
}; };
jsonBody.addAll(paymentParams); jsonBody.addAll(paymentParams);
jsonBody = {'order' : jsonBody}; jsonBody = {'order': jsonBody};
print(jsonBody);
int order_id; int order_id;
_showLoading(context, showLoading); _showLoading(context, showLoading);
var url = EXA_CART_API_BASE_URL + PACKAGES_ORDERS; var url = EXA_CART_API_BASE_URL + PACKAGES_ORDERS;
await baseAppClient.simplePost(url, headers: packagesAuthHeader, body: jsonBody, onSuccess: (dynamic stringResponse, int statusCode){ await baseAppClient.simplePost(url, headers: packagesAuthHeader, body: jsonBody, onSuccess: (dynamic stringResponse, int statusCode) {
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
var jsonResponse = json.decode(stringResponse); var jsonResponse = json.decode(stringResponse);
order_id = jsonResponse['orders'][0]['id']; order_id = jsonResponse['orders'][0]['id'];
}, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode){
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
log(error); log(error);
errorThrow = Future.error(error); errorThrow = Future.error(error);
@ -365,7 +348,7 @@ class OffersAndPackagesServices extends BaseService {
return errorThrow ?? order_id; return errorThrow ?? order_id;
} }
Future<ResponseModel<PackagesOrderResponseModel>> getOrderById(int id, {@required BuildContext context, bool showLoading = true}) async{ Future<ResponseModel<PackagesOrderResponseModel>> getOrderById(int id, {@required BuildContext context, bool showLoading = true}) async {
Future errorThrow; Future errorThrow;
ResponseModel<PackagesOrderResponseModel> response; ResponseModel<PackagesOrderResponseModel> response;
@ -377,23 +360,39 @@ class OffersAndPackagesServices extends BaseService {
var jsonResponse = json.decode(stringResponse); var jsonResponse = json.decode(stringResponse);
var jsonOrder = jsonResponse['orders'][0]; var jsonOrder = jsonResponse['orders'][0];
response = ResponseModel(status: true, data: PackagesOrderResponseModel.fromJson(jsonOrder)); response = ResponseModel(status: true, data: PackagesOrderResponseModel.fromJson(jsonOrder));
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
_hideLoading(context, showLoading); _hideLoading(context, showLoading);
errorThrow = Future.error(ResponseModel(status: false,error: error)); errorThrow = Future.error(ResponseModel(status: false, error: error));
}, queryParams: null); }, queryParams: null);
return errorThrow ?? response; return errorThrow ?? response;
} }
Future getHospitals({bool isResBasedOnLoc = true}) async {
Map<String, dynamic> body = Map();
body['Latitude'] = await this.sharedPref.getDouble(USER_LAT);
body['Longitude'] = await this.sharedPref.getDouble(USER_LONG);
body['IsOnlineCheckIn'] = isResBasedOnLoc;
body['PatientOutSA'] = 0;
await baseAppClient.post(GET_PROJECT,
onSuccess: (dynamic response, int statusCode) {
_hospitals.clear();
response['ListProject'].forEach((hospital) {
_hospitals.add(HospitalsModel.fromJson(hospital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
} }
_showLoading(BuildContext context, bool flag){ _showLoading(BuildContext context, bool flag) {
if(flag) if (flag) GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
} }
_hideLoading(BuildContext context, bool flag){ _hideLoading(BuildContext context, bool flag) {
if(flag) if (flag) GifLoaderDialogUtils.hideDialog(context);
GifLoaderDialogUtils.hideDialog(context);
} }

@ -23,6 +23,8 @@ class LacumService extends BaseService{
await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION, await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
lacumInformation = LacumAccountInformation.fromJson(response); lacumInformation = LacumAccountInformation.fromJson(response);
print("Test Lacum Account Information");
print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -45,6 +47,8 @@ class LacumService extends BaseService{
await baseAppClient.post(GET_LACUM_GROUP_INFORMATION, await baseAppClient.post(GET_LACUM_GROUP_INFORMATION,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
lacumGroupInformation = LacumAccountInformation.fromJson(response); lacumGroupInformation = LacumAccountInformation.fromJson(response);
print("Test Lacum Group Information");
print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -7,7 +7,6 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:flutter/cupertino.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
class OrderPreviewService extends BaseService { class OrderPreviewService extends BaseService {
@ -25,8 +24,7 @@ class OrderPreviewService extends BaseService {
Map<String, String> queryParams = {'fields': 'addresses'}; Map<String, String> queryParams = {'fields': 'addresses'};
hasError = false; hasError = false;
try { try {
await baseAppClient.getPharmacy("$GET_CUSTOMERS_ADDRESSES$customerId", await baseAppClient.getPharmacy("$GET_CUSTOMERS_ADDRESSES$customerId", onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
addresses.clear(); addresses.clear();
response['customers'][0]['addresses'].forEach((item) { response['customers'][0]['addresses'].forEach((item) {
addresses.add(Addresses.fromJson(item)); addresses.add(Addresses.fromJson(item));
@ -46,9 +44,7 @@ class OrderPreviewService extends BaseService {
dynamic localRes; dynamic localRes;
hasError = false; hasError = false;
try { try {
await baseAppClient await baseAppClient.getPharmacy("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}", onSuccess: (dynamic response, int statusCode) {
.getPharmacy("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}",
onSuccess: (dynamic response, int statusCode) {
localRes = response['shipping_option'][0]; localRes = response['shipping_option'][0];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -68,8 +64,7 @@ class OrderPreviewService extends BaseService {
dynamic localRes; dynamic localRes;
hasError = false; hasError = false;
try { try {
await baseAppClient.getPharmacy("$GET_SHOPPING_CART$customerId", await baseAppClient.getPharmacy("$GET_SHOPPING_CART$customerId", onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -81,8 +76,7 @@ class OrderPreviewService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> changeProductQuantity( Future<Map> changeProductQuantity(String productId, ShoppingCart product) async {
String productId, ShoppingCart product) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
dynamic localRes; dynamic localRes;
@ -96,8 +90,7 @@ class OrderPreviewService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body["shopping_cart_item"] = choppingCartObject; body["shopping_cart_item"] = choppingCartObject;
await baseAppClient.pharmacyPost("$GET_SHOPPING_CART$productId", await baseAppClient.pharmacyPost("$GET_SHOPPING_CART$productId", isExternal: false, onSuccess: (response, statusCode) async {
isExternal: false, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -114,8 +107,7 @@ class OrderPreviewService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
await baseAppClient.pharmacyPost("$DELETE_SHOPPING_CART$productId", await baseAppClient.pharmacyPost("$DELETE_SHOPPING_CART$productId", isExternal: false, onSuccess: (response, statusCode) async {
isExternal: false, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -132,9 +124,7 @@ class OrderPreviewService extends BaseService {
super.error = ""; super.error = "";
dynamic localRes; dynamic localRes;
await baseAppClient await baseAppClient.getPharmacy("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart", onSuccess: (response, statusCode) async {
.getPharmacy("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart",
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -144,16 +134,15 @@ class OrderPreviewService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future getLacumAccountInformation() async { Future getLacumAccountInformation(String identificationNo) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = identificationNo;
try { try {
await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION, await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
lacumInformation = LacumAccountInformation.fromJson(response); lacumInformation = LacumAccountInformation.fromJson(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -164,17 +153,16 @@ class OrderPreviewService extends BaseService {
} }
} }
Future getLacumGroupInformation() async { Future getLacumGroupInformation(String identificationNo) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = identificationNo;
body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}"; body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}";
try { try {
await baseAppClient.post(GET_LACUM_GROUP_INFORMATION, await baseAppClient.post(GET_LACUM_GROUP_INFORMATION, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
lacumGroupInformation = LacumAccountInformation.fromJson(response); lacumGroupInformation = LacumAccountInformation.fromJson(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -185,31 +173,29 @@ class OrderPreviewService extends BaseService {
} }
} }
Future makeOrder(PaymentCheckoutData paymentCheckoutData, Future makeOrder(PaymentCheckoutData paymentCheckoutData, List<ShoppingCart> shoppingCarts) async {
List<ShoppingCart> shoppingCarts) async {
paymentCheckoutData.address.isChecked = true; paymentCheckoutData.address.isChecked = true;
hasError = false; hasError = false;
super.error = ""; super.error = "";
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en');
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
Map<String, dynamic> orderBody = Map(); Map<String, dynamic> orderBody = Map();
orderBody['rx_attachments'] = ""; orderBody['rx_attachments'] = "";
orderBody['customer_language_id'] = languageID == 'ar' ? 1 : 2; orderBody['customer_language_id'] = languageID == 'ar' ? 2 : 1;
orderBody['billing_address'] = paymentCheckoutData.address; orderBody['billing_address'] = paymentCheckoutData.address;
orderBody['pick_up_in_store'] = false; orderBody['pick_up_in_store'] = false;
orderBody['payment_method_system_name'] = "Payments.PayFort"; orderBody['payment_method_system_name'] = "Payments.PayFort";
orderBody['shipping_method'] = languageID == 'ar'
? paymentCheckoutData.shippingOption.namen if (paymentCheckoutData.shippingOption.shippingRateComputationMethodSystemName == "Shipping.Aramex")
: paymentCheckoutData.shippingOption.name; orderBody['shipping_method'] = "Aramex Domestic";
orderBody['shipping_rate_computation_method_system_name'] = else
paymentCheckoutData orderBody['shipping_method'] = "Fixed Price";
.shippingOption.shippingRateComputationMethodSystemName;
orderBody['shipping_rate_computation_method_system_name'] = paymentCheckoutData.shippingOption.shippingRateComputationMethodSystemName;
orderBody['customer_id'] = int.parse(customerId); orderBody['customer_id'] = int.parse(customerId);
orderBody['custom_values_xml'] = orderBody['custom_values_xml'] = "PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}";
"PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}";
orderBody['shippingOption'] = paymentCheckoutData.shippingOption; orderBody['shippingOption'] = paymentCheckoutData.shippingOption;
orderBody['shipping_address'] = paymentCheckoutData.address; orderBody['shipping_address'] = paymentCheckoutData.address;
orderBody['lakum_amount'] = paymentCheckoutData.usedLakumPoints; orderBody['lakum_amount'] = paymentCheckoutData.usedLakumPoints;
@ -227,9 +213,7 @@ class OrderPreviewService extends BaseService {
body['order'] = orderBody; body['order'] = orderBody;
try { try {
await baseAppClient.pharmacyPost(ORDER_SHOPPING_CART, await baseAppClient.pharmacyPost(ORDER_SHOPPING_CART, isExternal: false, isAllowAny: true, onSuccess: (response, statusCode) async {
isExternal: false,
isAllowAny: true, onSuccess: (response, statusCode) async {
orderList.clear(); orderList.clear();
response['orders'].forEach((item) { response['orders'].forEach((item) {
orderList.add(OrderDetailModel.fromJson(item)); orderList.add(OrderDetailModel.fromJson(item));
@ -271,8 +255,7 @@ class OrderPreviewService extends BaseService {
jsonBody['DriverID'] = driverId; jsonBody['DriverID'] = driverId;
LatLng coordinates; LatLng coordinates;
await baseAppClient.post(DRIVER_LOCATION, await baseAppClient.post(DRIVER_LOCATION, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
if (statusCode == 200) { if (statusCode == 200) {
dynamic locationObject = response['PatientER_GetDriverLocationList'][0]; dynamic locationObject = response['PatientER_GetDriverLocationList'][0];
double lat = locationObject['Latitude']; double lat = locationObject['Latitude'];

@ -19,14 +19,19 @@ class PharmacyModuleService extends BaseService {
List<Manufacturer> manufacturerList = List(); List<Manufacturer> manufacturerList = List();
List<PharmacyProduct> bestSellerProducts = List(); List<PharmacyProduct> bestSellerProducts = List();
List<PharmacyProduct> lastVisitedProducts = List(); List<PharmacyProduct> lastVisitedProducts = List();
List<PharmacyProduct> mostViewedProducts = List();
Future makeVerifyCustomer(dynamic data) async { Future makeVerifyCustomer(dynamic data) async {
Map<String, String> queryParams = {'FileNumber': data['PatientID'].toString()}; Map<String, String> queryParams = {
'FileNumber': data['PatientID'].toString()
};
hasError = false; hasError = false;
try { try {
await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) async { await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER,
onSuccess: (dynamic response, int statusCode) async {
if (response['UserName'] != null) { if (response['UserName'] != null) {
sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString()); sharedPref.setString(
PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
print(response); print(response);
} else { } else {
await createUser(); await createUser();
@ -52,12 +57,13 @@ class PharmacyModuleService extends BaseService {
}; };
hasError = false; hasError = false;
try { try {
await baseAppClient.getPharmacy(PHARMACY_CREATE_CUSTOMER, onSuccess: (dynamic response, int statusCode) async { await baseAppClient.getPharmacy(PHARMACY_CREATE_CUSTOMER,
onSuccess: (dynamic response, int statusCode) async {
if (!response['IsRegistered']) { if (!response['IsRegistered']) {
} else { } else {
customerInfo = CustomerInfo.fromJson(response); customerInfo = CustomerInfo.fromJson(response);
await sharedPref.setObject(PHARMACY_CUSTOMER_ID, customerInfo.customerId); await sharedPref.setObject(
PHARMACY_CUSTOMER_ID, customerInfo.customerId);
} }
// await generatePharmacyToken(); // await generatePharmacyToken();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -77,9 +83,11 @@ class PharmacyModuleService extends BaseService {
}; };
hasError = false; hasError = false;
try { try {
await baseAppClient.getPharmacy(PHARMACY_AUTORZIE_CUSTOMER, onSuccess: (dynamic response, int statusCode) async { await baseAppClient.getPharmacy(PHARMACY_AUTORZIE_CUSTOMER,
onSuccess: (dynamic response, int statusCode) async {
if (response['Status'] == 200) { if (response['Status'] == 200) {
await sharedPref.setString(PHARMACY_AUTORZIE_TOKEN, response['token'].toString()); await sharedPref.setString(
PHARMACY_AUTORZIE_TOKEN, response['token'].toString());
} }
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -93,7 +101,8 @@ class PharmacyModuleService extends BaseService {
Future getBannerListList() async { Future getBannerListList() async {
hasError = false; hasError = false;
try { try {
await baseAppClient.getPharmacy(GET_PHARMACY_BANNER, onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(GET_PHARMACY_BANNER,
onSuccess: (dynamic response, int statusCode) {
bannerItems.clear(); bannerItems.clear();
response['images'].forEach((item) { response['images'].forEach((item) {
bannerItems.add(PharmacyImageObject.fromJson(item)); bannerItems.add(PharmacyImageObject.fromJson(item));
@ -111,7 +120,8 @@ class PharmacyModuleService extends BaseService {
if (manufacturerList.isNotEmpty) return; if (manufacturerList.isNotEmpty) return;
Map<String, String> queryParams = {'page': '1', 'limit': '8'}; Map<String, String> queryParams = {'page': '1', 'limit': '8'};
try { try {
await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER, onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER,
onSuccess: (dynamic response, int statusCode) {
manufacturerList.clear(); manufacturerList.clear();
response['manufacturer'].forEach((item) { response['manufacturer'].forEach((item) {
Manufacturer manufacturer = Manufacturer.fromJson(item); Manufacturer manufacturer = Manufacturer.fromJson(item);
@ -137,7 +147,8 @@ class PharmacyModuleService extends BaseService {
'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews', 'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews',
}; };
try { try {
await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT,
onSuccess: (dynamic response, int statusCode) {
bestSellerProducts.clear(); bestSellerProducts.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
bestSellerProducts.add(PharmacyProduct.fromJson(item)); bestSellerProducts.add(PharmacyProduct.fromJson(item));
@ -160,7 +171,9 @@ class PharmacyModuleService extends BaseService {
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
// lastVisited = "2458,4561"; // lastVisited = "2458,4561";
try { try {
await baseAppClient.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", onSuccess: (dynamic response, int statusCode) { await baseAppClient
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
onSuccess: (dynamic response, int statusCode) {
lastVisitedProducts.clear(); lastVisitedProducts.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
lastVisitedProducts.add(PharmacyProduct.fromJson(item)); lastVisitedProducts.add(PharmacyProduct.fromJson(item));
@ -176,4 +189,30 @@ class PharmacyModuleService extends BaseService {
} }
} }
} }
Future getMostViewedProducts() async {
hasError = false;
Map<String, String> queryParams = {
'fields':
'id,discount_ids,name,reviews,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage',
};
try {
await baseAppClient.getPharmacy(GET_MOST_VIEWED_PRODUCTS,
onSuccess: (dynamic response, int statusCode) {
mostViewedProducts.clear();
response['products'].forEach((item) {
mostViewedProducts.add(PharmacyProduct.fromJson(item));
});
// print("most viewed products ---------");
// print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
} catch (error) {
hasError = true;
super.error = error.toString();
// throw error;
}
}
} }

@ -1,8 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
class PrescriptionService extends BaseService { class PrescriptionService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences(); final AppSharedPreferences sharedPref = AppSharedPreferences();
@ -11,14 +10,14 @@ class PrescriptionService extends BaseService {
String errorMsg = ''; String errorMsg = '';
List<Prescriptions> _prescriptionsList = List(); List<Prescriptions> _prescriptionsList = List();
List<Prescriptions> get prescriptionsList => _prescriptionsList; List<Prescriptions> get prescriptionsList => _prescriptionsList;
Future getPrescription() async { Future getPrescription() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(PRESCRIPTION, await baseAppClient.post(PRESCRIPTION, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear(); _prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((prescriptions) { response['PatientPrescriptionList'].forEach((prescriptions) {
_prescriptionsList.add(Prescriptions.fromJson(prescriptions)); _prescriptionsList.add(Prescriptions.fromJson(prescriptions));

@ -143,11 +143,14 @@ class PharmacyCategoriseService extends BaseService {
); );
} }
Future getParentProducts({String id}) async { Future getParentProducts(
{String id, int pageNumber, bool isLoading = false}) async {
hasError = false; hasError = false;
_parentProductsList.clear(); if (isLoading == false) {
_parentProductsList.clear();
}
String endPoint = id != null String endPoint = id != null
? GET_PARENT_PRODUCTS + "$id" + '&page=1&limit=50' ? GET_PARENT_PRODUCTS + "$id" + '&page=' + '$pageNumber' + '&limit=24'
: GET_PARENT_PRODUCTS + ""; : GET_PARENT_PRODUCTS + "";
await baseAppClient.getPharmacy( await baseAppClient.getPharmacy(
endPoint, endPoint,
@ -155,6 +158,7 @@ class PharmacyCategoriseService extends BaseService {
response['products'].forEach((item) { response['products'].forEach((item) {
_parentProductsList.add(PharmacyProduct.fromJson(item)); _parentProductsList.add(PharmacyProduct.fromJson(item));
}); });
//pageNumber++;
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -0,0 +1,17 @@
import 'package:flutter/cupertino.dart';
class PharmacyPagesViewModel with ChangeNotifier {
int currentTab = 0;
PageController pageController;
PharmacyPagesViewModel() {
pageController = PageController(keepPage: true);
}
changeCurrentTab(int tab) {
if (pageController.hasClients) {
currentTab = tab;
pageController.jumpToPage(tab);
notifyListeners();
}
}
}

@ -106,7 +106,7 @@ class AmRequestViewModel extends BaseViewModel {
Future updatePressOrder({@required int presOrderID}) async { Future updatePressOrder({@required int presOrderID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
// await _amService.updatePressOrder(presOrderID: presOrderID); // await _amService.updatePressOrder(presOrderID: presOrderID);
await _amService.updatePressOrderRC(presOrderID: presOrderID, patientID: authenticatedUserObject.user.patientID.toString()); await _amService.updatePressOrderRC(presOrderID: presOrderID, patientID: authenticatedUserObject.user.patientID);
if (_amService.hasError) { if (_amService.hasError) {
error = _amService.error; error = _amService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -62,7 +62,7 @@ class RRTViewModel extends BaseViewModel {
// body['OrderServiceID'] = 5; // body['OrderServiceID'] = 5;
var localRes; var localRes;
int requestNo; int requestNo;
await _service.baseAppClient.post(ADD_RRT_ORDER_RC, body: body, onSuccess: (response, statusCode) { await _service.baseAppClient.post(ADD_RRT_ORDER_RC, isRCService: true, body: body, onSuccess: (response, statusCode) {
requestNo = response['response']; requestNo = response['response'];
}, onFailure: (error, statusCode) { }, onFailure: (error, statusCode) {
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
@ -94,7 +94,7 @@ class RRTViewModel extends BaseViewModel {
} }
Future<_RRTServiceData> getAllOrdersRC() async { Future<_RRTServiceData> getAllOrdersRC() async {
await _service.baseAppClient.post(GET_ALL_RRT_ORDERS_RC, body: {}, onSuccess: (response, statusCode) { await _service.baseAppClient.post(GET_ALL_RRT_ORDERS_RC, isRCService: true, body: {}, onSuccess: (response, statusCode) {
var data = response["response"]; var data = response["response"];
rrtServiceData.completedOrders.clear(); rrtServiceData.completedOrders.clear();
rrtServiceData.pendingOrders.clear(); rrtServiceData.pendingOrders.clear();
@ -159,9 +159,9 @@ class RRTViewModel extends BaseViewModel {
} }
Future<bool> cancelOrderRC(GetCMCAllOrdersResponseModel order, {String reason = ""}) async { Future<bool> cancelOrderRC(GetCMCAllOrdersResponseModel order, {String reason = ""}) async {
Map<String, dynamic> body = {"Id": order.iD, "ClickButton": 16}; Map<String, dynamic> body = {"Id": order.iD, "ClickButton": 14};
var success = false; var success = false;
await _service.baseAppClient.post(UPDATE_RRT_ORDER_RC, body: body, onSuccess: (response, statusCode) { await _service.baseAppClient.post(UPDATE_RRT_ORDER_RC, isRCService: true, body: body, onSuccess: (response, statusCode) {
success = true; success = true;
rrtServiceData.pendingOrders.remove(order); rrtServiceData.pendingOrders.remove(order);
}, onFailure: (error, statusCode) { }, onFailure: (error, statusCode) {

@ -81,13 +81,15 @@ class MyBalanceViewModel extends BaseViewModel {
} }
Future getCities() async { Future getCities() async {
setState(ViewState.Busy); if(isLogin) {
await _bloodDonationService.getAllCitiesOrders(); setState(ViewState.Busy);
if (_bloodDonationService.hasError) { await _bloodDonationService.getAllCitiesOrders();
error = _bloodDonationService.error; if (_bloodDonationService.hasError) {
setState(ViewState.Error); error = _bloodDonationService.error;
} else setState(ViewState.Error);
setState(ViewState.Idle); } else
setState(ViewState.Idle);
}
} }
Future getBlood() async { Future getBlood() async {

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_info_rc_model.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
@ -31,6 +32,10 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList; List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
List<PrescriptionInfoRCModel> get prescriptionsOrderListRC => _prescriptionsService.prescriptionsOrderListRC;
List<PrescriptionsList> get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; List<PrescriptionsList> get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
List<PrescriptionsList> prescriptionsOrderListByValue(filterValue) { List<PrescriptionsList> prescriptionsOrderListByValue(filterValue) {
@ -131,8 +136,6 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
} }
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async { getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder); await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder);
@ -144,9 +147,21 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
} }
getPrescriptionReportDetailsRC() async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionsInfoRC(4, 2001273);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future updatePressOrder({@required int presOrderID}) async { Future updatePressOrder({@required int presOrderID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.updatePressOrder(presOrderID: presOrderID); // await _prescriptionsService.updatePressOrder(presOrderID: presOrderID);
await _prescriptionsService.updatePressOrderRC(presOrderID: presOrderID);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCartItemsResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCartItemsResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/packages_offers/responses/PackagesResponseModel.dart';
@ -22,6 +23,7 @@ class PackagesViewModel extends BaseViewModel {
List<PackagesResponseModel> get bestSellerList => service.bestSellerList; List<PackagesResponseModel> get bestSellerList => service.bestSellerList;
List<PackagesResponseModel> get bannersList => service.bannersList; List<PackagesResponseModel> get bannersList => service.bannersList;
List<PackagesCartItemsResponseModel> get cartItemList => service.cartItemList; List<PackagesCartItemsResponseModel> get cartItemList => service.cartItemList;
List<HospitalsModel> get hospitals => service.hospitals;
String _cartItemCount = ""; String _cartItemCount = "";

@ -0,0 +1,23 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
class MostViewedViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
List<PharmacyProduct> get mostViewedProducts =>
_pharmacyService.mostViewedProducts;
getMostViewedProducts() async {
setState(ViewState.BusyLocal);
await _pharmacyService.getMostViewedProducts();
// if (_pharmacyService.hasError) {
// error = _pharmacyService.error;
// setState(ViewState.Error);
// } else {
setState(ViewState.Idle);
// }
}
}

@ -8,8 +8,6 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
@ -19,18 +17,21 @@ class OrderPreviewViewModel extends BaseViewModel {
List<Addresses> get addresses => _orderService.addresses; List<Addresses> get addresses => _orderService.addresses;
LacumAccountInformation get lacumInformation => LacumAccountInformation get lacumInformation => _orderService.lacumInformation;
_orderService.lacumInformation;
List<OrderDetailModel> get orderListModel => _orderService.orderList; List<OrderDetailModel> get orderListModel => _orderService.orderList;
PharmacyModuleViewModel pharmacyModuleViewModel = PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
locator<PharmacyModuleViewModel>();
ShoppingCartResponse cartResponse = ShoppingCartResponse(); ShoppingCartResponse cartResponse = ShoppingCartResponse();
PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData(); PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData();
double totalAdditionalShippingCharge = 0; double totalAdditionalShippingCharge = 0;
setShoppingCartResponse(ShoppingCartResponse cart) {
cartResponse = cart;
notifyListeners();
}
Future getOrderPreviewData() async { Future getOrderPreviewData() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.getAddresses(); await _orderService.getAddresses();
@ -66,27 +67,27 @@ class OrderPreviewViewModel extends BaseViewModel {
} }
} }
Future<ShoppingCartResponse> changeProductQuantity( Future<ShoppingCartResponse> changeProductQuantity(ShoppingCart product) async {
ShoppingCart product) async { setState(ViewState.BusyLocal);
setState(ViewState.Busy);
var resp = await _orderService.changeProductQuantity(product.id, product); var resp = await _orderService.changeProductQuantity(product.id, product);
var object = _handleGetShoppingCartResponse(resp);
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
var object = _handleGetShoppingCartResponse(resp);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
return object; // return object;
} }
Future<ShoppingCartResponse> deleteProduct(ShoppingCart product) async { Future<ShoppingCartResponse> deleteProduct(ShoppingCart product) async {
setState(ViewState.Busy); setState(ViewState.BusyLocal);
var resp = await _orderService.deleteProduct(product.id); var resp = await _orderService.deleteProduct(product.id);
var object = _handleGetShoppingCartResponse(resp); var object = _handleGetShoppingCartResponse(resp);
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
@ -107,6 +108,7 @@ class OrderPreviewViewModel extends BaseViewModel {
} }
ShoppingCartResponse _handleGetShoppingCartResponse(Map res) { ShoppingCartResponse _handleGetShoppingCartResponse(Map res) {
cartResponse.totalAmount = 0.0;
totalAdditionalShippingCharge = 0; totalAdditionalShippingCharge = 0;
if (res == null) { if (res == null) {
error = "response is null"; error = "response is null";
@ -120,12 +122,19 @@ class OrderPreviewViewModel extends BaseViewModel {
cartResponse.subtotalVatAmount = res["subtotal_vat_amount"]; cartResponse.subtotalVatAmount = res["subtotal_vat_amount"];
cartResponse.subtotalVatRate = res["subtotal_vat_rate"]; cartResponse.subtotalVatRate = res["subtotal_vat_rate"];
cartResponse.shoppingCarts = List(); cartResponse.shoppingCarts = List();
if (paymentCheckoutData.shippingOption != null) {
totalAdditionalShippingCharge = paymentCheckoutData.shippingOption.rate;
cartResponse.subtotalVatAmount += paymentCheckoutData.shippingOption.rateVat;
cartResponse.totalAmount += (paymentCheckoutData.shippingOption.rate + paymentCheckoutData.shippingOption.rateVat);
}
res["shopping_carts"].forEach((item) { res["shopping_carts"].forEach((item) {
ShoppingCart shoppingCart = ShoppingCart.fromJson(item); ShoppingCart shoppingCart = ShoppingCart.fromJson(item);
cartResponse.shoppingCarts.add(shoppingCart); cartResponse.shoppingCarts.add(shoppingCart);
totalAdditionalShippingCharge += totalAdditionalShippingCharge += shoppingCart.product.additionalShippingCharge;
shoppingCart.product.additionalShippingCharge;
}); });
if (paymentCheckoutData.shippingOption != null) cartResponse.totalAmount = (cartResponse.subtotalWithVat + totalAdditionalShippingCharge + paymentCheckoutData.shippingOption.rateVat);
return cartResponse; return cartResponse;
} }
@ -156,28 +165,27 @@ class OrderPreviewViewModel extends BaseViewModel {
return _orderService.getPaymentOptionName(paymentOption); return _orderService.getPaymentOptionName(paymentOption);
} }
getInformationsByAddress() async { getInformationsByAddress(String identificationNo) async {
await getLacumAccountInformation();
await getShippingOption(); await getShippingOption();
await getLacumAccountInformation(identificationNo);
} }
getLacumAccountInformation() async { getLacumAccountInformation(String identificationNo) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.getLacumAccountInformation(); await _orderService.getLacumAccountInformation(identificationNo);
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
getLacumGroupData(); if (_orderService.lacumInformation.yahalaAccountNo != 0) getLacumGroupData(identificationNo);
} }
} }
Future getLacumGroupData() async { Future getLacumGroupData(String identificationNo) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService.getLacumGroupInformation(); await _orderService.getLacumGroupInformation(identificationNo);
paymentCheckoutData.lacumInformation = _orderService.lacumGroupInformation; paymentCheckoutData.lacumInformation = _orderService.lacumGroupInformation;
paymentCheckoutData.usedLakumPoints = paymentCheckoutData paymentCheckoutData.usedLakumPoints = paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount;
.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount;
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -188,9 +196,7 @@ class OrderPreviewViewModel extends BaseViewModel {
getShippingOption() async { getShippingOption() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderService await _orderService.getShippingOption(paymentCheckoutData.address).then((res) {
.getShippingOption(paymentCheckoutData.address)
.then((res) {
paymentCheckoutData.shippingOption = ShippingOption.fromJson(res); paymentCheckoutData.shippingOption = ShippingOption.fromJson(res);
setState(ViewState.Idle); setState(ViewState.Idle);
}); });
@ -206,8 +212,7 @@ class OrderPreviewViewModel extends BaseViewModel {
setState(ViewState.Busy); setState(ViewState.Busy);
await pharmacyModuleViewModel.generatePharmacyToken(); await pharmacyModuleViewModel.generatePharmacyToken();
await _orderService.makeOrder( await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts);
paymentCheckoutData, cartResponse.shoppingCarts);
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -1,5 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
@ -14,6 +14,7 @@ class PrescriptionViewModel extends BaseViewModel {
getPrescription() async { getPrescription() async {
await getSavedLanguage(); await getSavedLanguage();
prescriptionsList.clear();
if(prescriptionsList.isEmpty){ if(prescriptionsList.isEmpty){
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.getPrescription(); await _prescriptionService.getPrescription();

@ -1,9 +1,11 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/brands_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/brands_service.dart';
import '../../../locator.dart'; import '../../../locator.dart';
class BrandsViewModel extends BaseViewModel{ class BrandsViewModel extends BaseViewModel{
@ -22,6 +24,7 @@ class BrandsViewModel extends BaseViewModel{
Future getBrandsData() async { Future getBrandsData() async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _brandsService.getBrands(); await _brandsService.getBrands();
if (_brandsService.hasError) { if (_brandsService.hasError) {
error = _brandsService.error; error = _brandsService.error;

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_serv
import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
@ -77,7 +78,8 @@ class OrderModelViewModel extends BaseViewModel {
dynamic res; dynamic res;
await _cancelOrderService.getCanceledOrder(order).then((value) { await _cancelOrderService.getCanceledOrder(order).then((value) {
res = value['success']['SuccessEndUserMsg']; res = value['success']['SuccessEndUserMsg'];
AppToast.showSuccessToast(message: "Request Sent Successfully"); // AppToast.showSuccessToast(message: "Request Sent Successfully");
AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent);
// Navigator.pop(context); // Navigator.pop(context);
}); });
if (_cancelOrderService.hasError) { if (_cancelOrderService.hasError) {
@ -95,7 +97,7 @@ class OrderModelViewModel extends BaseViewModel {
return res; return res;
} }
Future makeReview(PharmacyProduct product, double rating, String reviewText) async { Future makeReview(PharmacyProduct product, double rating, String reviewText, context) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderDetailsService.makeReview(product, rating, reviewText); await _orderDetailsService.makeReview(product, rating, reviewText);
if (_orderDetailsService.hasError) { if (_orderDetailsService.hasError) {
@ -104,8 +106,9 @@ class OrderModelViewModel extends BaseViewModel {
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
AppToast.showSuccessToast( AppToast.showSuccessToast(message: TranslationBase.of(context).submitReview);
message: "Your review has been Submitted successfully"); // AppToast.showSuccessToast(
// message: "Your review has been Submitted successfully");
} }
} }

@ -1,17 +1,20 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/specification.dart'; import 'package:diplomaticquarterapp/models/pharmacy/specification.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/product_detail_service.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/product_detail_service.dart';
import '../../../locator.dart'; import '../../../locator.dart';
class ProductDetailViewModel extends BaseViewModel{ class ProductDetailViewModel extends BaseViewModel {
ProductDetailService _productDetailService = locator<ProductDetailService>(); ProductDetailService _productDetailService = locator<ProductDetailService>();
List<ProductDetail> get productDetailService => _productDetailService.productDetailList; List<ProductDetail> get productDetailService => _productDetailService.productDetailList;
@ -24,6 +27,13 @@ class ProductDetailViewModel extends BaseViewModel{
bool hasError = false; bool hasError = false;
num get stockQuantity => _productDetailService.stockQuantity;
String get stockAvailability => _productDetailService.stockAvailability;
String get stockAvailabilityn => _productDetailService.stockAvailabilityn;
bool get isStockAvailable => _productDetailService.isStockAvailable;
Future getProductReviewsData(productID) async { Future getProductReviewsData(productID) async {
hasError = false; hasError = false;
@ -36,10 +46,10 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getProductLocationData() async { Future getProductLocationData(String productSKU) async {
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _productDetailService.getProductAvailabiltyDetail(); await _productDetailService.getProductAvailabiltyDetail(productSKU);
if (_productDetailService.hasError) { if (_productDetailService.hasError) {
error = _productDetailService.error; error = _productDetailService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -47,10 +57,10 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future notifyMe(customerId, itemID) async { Future notifyMe(customerId, itemID, context) async {
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _productDetailService.notifyMe(customerId, itemID); await _productDetailService.notifyMe(customerId, itemID, context);
if (_productDetailService.hasError) { if (_productDetailService.hasError) {
error = _productDetailService.error; error = _productDetailService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -58,25 +68,49 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future addToCartData(quantity, itemID) async { Future addToCartData(quantity, itemID, context) async {
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _productDetailService.addToCart(quantity, itemID); var resp = await _productDetailService.addToCart(quantity, itemID, context);
ShoppingCartResponse object = _handleGetShoppingCartResponse(resp);
if (_productDetailService.hasError) { if (_productDetailService.hasError) {
error = _productDetailService.error; error = _productDetailService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else {
setState(ViewState.Idle); setState(ViewState.Idle);
Provider.of<OrderPreviewViewModel>(locator<NavigationService>().navigatorKey.currentContext, listen: false).setShoppingCartResponse(object);
}
} }
Future addToWishlistData(itemID) async { ShoppingCartResponse _handleGetShoppingCartResponse(Map res) {
ShoppingCartResponse cartResponse = ShoppingCartResponse();
if (res == null) {
error = "response is null";
setState(ViewState.Error);
return null;
}
print(res);
cartResponse.itemCount = res["item_count"];
cartResponse.quantityCount = res["quantity_count"];
cartResponse.subtotal = res["subtotal"];
cartResponse.subtotalWithVat = res["subtotal_with_vat"];
cartResponse.subtotalVatAmount = res["subtotal_vat_amount"];
cartResponse.subtotalVatRate = res["subtotal_vat_rate"];
cartResponse.shoppingCarts = List();
res["shopping_carts"].forEach((item) {
ShoppingCart shoppingCart = ShoppingCart.fromJson(item);
cartResponse.shoppingCarts.add(shoppingCart);
});
return cartResponse;
}
Future addToWishlistData(itemID, context) async {
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
locator<NavigationService>().navigatorKey.currentContext); await _productDetailService.addToWishlist(itemID, context);
await _productDetailService.addToWishlist(itemID); GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
GifLoaderDialogUtils.hideDialog(
locator<NavigationService>().navigatorKey.currentContext);
if (_productDetailService.hasError) { if (_productDetailService.hasError) {
error = _productDetailService.error; error = _productDetailService.error;
@ -96,15 +130,12 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future deleteWishlistData(itemID, context) async {
Future deleteWishlistData(itemID) async {
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
locator<NavigationService>().navigatorKey.currentContext); await _productDetailService.deleteItemFromWishlist(itemID, context);
await _productDetailService.deleteItemFromWishlist(itemID); GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
GifLoaderDialogUtils.hideDialog(
locator<NavigationService>().navigatorKey.currentContext);
if (_productDetailService.hasError) { if (_productDetailService.hasError) {
error = _productDetailService.error; error = _productDetailService.error;
@ -113,7 +144,6 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future productSpecificationData(itemID) async { Future productSpecificationData(itemID) async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
@ -125,10 +155,7 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
clearReview(){ clearReview() {
productDetailService.clear(); productDetailService.clear();
} }
} }

@ -5,25 +5,43 @@ import 'package:diplomaticquarterapp/core/model/pharmacy/pharmacy_categorise.dar
import 'package:diplomaticquarterapp/core/model/pharmacy/scan_qr_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacy/scan_qr_model.dart';
import 'package:diplomaticquarterapp/core/service/pharmacy_categorise_service.dart'; import 'package:diplomaticquarterapp/core/service/pharmacy_categorise_service.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
class PharmacyCategoriseViewModel extends BaseViewModel { class PharmacyCategoriseViewModel extends BaseViewModel {
bool hasError = false; bool hasError = false;
PharmacyCategoriseService _pharmacyCategoriseService = locator<PharmacyCategoriseService>();
List<PharmacyCategorise> get categorise => _pharmacyCategoriseService.categoriseList; int firstSubsetIndex = 0;
int inPatientPageSize = 20;
int lastSubsetIndex = 20;
List<CategoriseParentModel> get categoriseParent => _pharmacyCategoriseService.parentCategoriseList; List<PharmacyProduct> filteredInPatientItems = List();
List<PharmacyProduct> filteredMyInPatientItems = List();
List<PharmacyProduct> get parentProducts => _pharmacyCategoriseService.parentProductsList; PharmacyCategoriseService _pharmacyCategoriseService =
locator<PharmacyCategoriseService>();
List<CategoriseParentModel> get subCategorise => _pharmacyCategoriseService.subCategoriseList; List<PharmacyCategorise> get categorise =>
_pharmacyCategoriseService.categoriseList;
List<PharmacyProduct> get subProducts => _pharmacyCategoriseService.subProductsList; List<CategoriseParentModel> get categoriseParent =>
_pharmacyCategoriseService.parentCategoriseList;
List<PharmacyProduct> get finalProducts => _pharmacyCategoriseService.finalProducts; List<PharmacyProduct> get parentProducts =>
List<CategoriseParentModel> get brandsList => _pharmacyCategoriseService.brandsList; _pharmacyCategoriseService.parentProductsList;
List<CategoriseParentModel> get subCategorise =>
_pharmacyCategoriseService.subCategoriseList;
List<PharmacyProduct> get subProducts =>
_pharmacyCategoriseService.subProductsList;
List<PharmacyProduct> get finalProducts =>
_pharmacyCategoriseService.finalProducts;
List<CategoriseParentModel> get brandsList =>
_pharmacyCategoriseService.brandsList;
List<PharmacyProduct> get searchList => _pharmacyCategoriseService.searchList; List<PharmacyProduct> get searchList => _pharmacyCategoriseService.searchList;
@ -81,29 +99,37 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getCategoriseParent({String i}) async { Future getCategoriseParent(
{String i, int pageIndex, bool isLoading, BuildContext context}) async {
hasError = false; hasError = false;
// _insuranceCardService.clearInsuranceCard(); // _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
// GifLoaderDialogUtils.showMyDialog(context);
await _pharmacyCategoriseService.getCategoriseParent(id: i); await _pharmacyCategoriseService.getCategoriseParent(id: i);
if (_pharmacyCategoriseService.hasError) { if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error; error = _pharmacyCategoriseService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
await getParentProducts(i: i); await getBrands(id: i);
await getBrands(id: i); await getParentProducts(
i: i, pageIndex: pageIndex, isLoading: isLoading, context: context);
// GifLoaderDialogUtils.showMyDialog(context);
} }
Future getParentProducts({String i}) async { Future getParentProducts(
{String i, int pageIndex, bool isLoading, BuildContext context}) async {
hasError = false; hasError = false;
// _insuranceCardService.clearInsuranceCard(); // _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.BusyLocal);
await _pharmacyCategoriseService.getParentProducts(id: i); //GifLoaderDialogUtils.showMyDialog(context);
await _pharmacyCategoriseService.getParentProducts(
id: i, pageNumber: pageIndex, isLoading: isLoading);
if (_pharmacyCategoriseService.hasError) { if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error; error = _pharmacyCategoriseService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
//GifLoaderDialogUtils.hideDialog(context);
} }
Future getSubCategorise({String i}) async { Future getSubCategorise({String i}) async {
@ -142,11 +168,13 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getFilteredProducts({String categoryId, String brandId, String min, String max}) async { Future getFilteredProducts(
{String categoryId, String brandId, String min, String max}) async {
hasError = false; hasError = false;
// _insuranceCardService.clearInsuranceCard(); // _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyCategoriseService.getFilteredProducts(categoryId: categoryId, brandId: brandId, max: max, min: min); await _pharmacyCategoriseService.getFilteredProducts(
categoryId: categoryId, brandId: brandId, max: max, min: min);
if (_pharmacyCategoriseService.hasError) { if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error; error = _pharmacyCategoriseService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -154,7 +182,8 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getFilteredSubProducts({String categoryId, String brandId, String min, String max}) async { Future getFilteredSubProducts(
{String categoryId, String brandId, String min, String max}) async {
hasError = false; hasError = false;
// _insuranceCardService.clearInsuranceCard(); // _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
@ -221,4 +250,27 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
addOnFilteredList() {
if (lastSubsetIndex < parentProducts.length) {
firstSubsetIndex = firstSubsetIndex +
(parentProducts.length - lastSubsetIndex < inPatientPageSize - 1
? parentProducts.length - lastSubsetIndex
: inPatientPageSize - 1);
lastSubsetIndex = lastSubsetIndex +
(parentProducts.length - lastSubsetIndex < inPatientPageSize - 1
? parentProducts.length - lastSubsetIndex
: inPatientPageSize - 1);
filteredInPatientItems
.addAll(parentProducts.sublist(firstSubsetIndex, lastSubsetIndex));
setState(ViewState.Idle);
}
}
removeOnFilteredList() {
if (lastSubsetIndex - inPatientPageSize - 1 > 0) {
filteredInPatientItems.removeAt(lastSubsetIndex - inPatientPageSize - 1);
setState(ViewState.Idle);
}
}
} }

@ -313,6 +313,12 @@ offerProductsResponseModelFromJson(PackagesResponseModel data, Map<String, dynam
data.storeIds = new List<dynamic>(); data.storeIds = new List<dynamic>();
data.storeIds.addAll(json['store_ids']); data.storeIds.addAll(json['store_ids']);
} }
if (json['store_names'] != null) {
data.storeNames = new List<dynamic>();
data.storeNames.addAll(json['store_names']);
}
if (json['manufacturer_ids'] != null) { if (json['manufacturer_ids'] != null) {
data.manufacturerIds = json['manufacturer_ids']?.map((v) => v?.toInt())?.toList()?.cast<int>(); data.manufacturerIds = json['manufacturer_ids']?.map((v) => v?.toInt())?.toList()?.cast<int>();
} }

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/MostViewedViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/product_categories_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/product_categories_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
@ -305,11 +306,14 @@ void setupLocator() {
locator.registerFactory(() => BrandViewModel()); locator.registerFactory(() => BrandViewModel());
locator.registerFactory(() => BestSellerViewModel()); locator.registerFactory(() => BestSellerViewModel());
locator.registerFactory(() => LastVisitedViewModel()); locator.registerFactory(() => LastVisitedViewModel());
locator.registerFactory(() => MostViewedViewModel());
// Offer And Packages // Offer And Packages
//---------------------- //----------------------
locator.registerLazySingleton(() => OffersAndPackagesServices()); // offerPackagesServices Service locator.registerLazySingleton(
locator.registerFactory(() => OfferCategoriesViewModel()); // Categories View Model () => OffersAndPackagesServices()); // offerPackagesServices Service
locator.registerFactory(
() => OfferCategoriesViewModel()); // Categories View Model
locator.registerFactory(() => PackagesViewModel()); // Products View Model locator.registerFactory(() => PackagesViewModel()); // Products View Model
//pharmacy //pharmacy

@ -1,5 +1,4 @@
import 'dart:io'; import 'package:diplomaticquarterapp/core/viewModels/PharmacyPagesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
@ -84,6 +83,9 @@ class _MyApp extends State<MyApp> {
SizeConfig().init(constraints, orientation); SizeConfig().init(constraints, orientation);
return MultiProvider( return MultiProvider(
providers: [ providers: [
ChangeNotifierProvider<PharmacyPagesViewModel>(
create: (context) => PharmacyPagesViewModel(),
),
ChangeNotifierProvider<ProjectViewModel>( ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(), create: (context) => ProjectViewModel(),
), ),

@ -1,47 +1,47 @@
class DoctorProfileList { class DoctorProfileList {
int doctorID; num doctorID;
String doctorName; String doctorName;
Null doctorNameN; dynamic doctorNameN;
int clinicID; num clinicID;
String clinicDescription; String clinicDescription;
Null clinicDescriptionN; dynamic clinicDescriptionN;
Null licenseExpiry; dynamic licenseExpiry;
int employmentType; num employmentType;
Null setupID; dynamic setupID;
int projectID; num projectID;
String projectName; String projectName;
String nationalityID; String nationalityID;
String nationalityName; String nationalityName;
Null nationalityNameN; dynamic nationalityNameN;
int gender; num gender;
String genderDescription; String genderDescription;
Null genderDescriptionN; dynamic genderDescriptionN;
Null doctorTitle; dynamic doctorTitle;
Null projectNameN; dynamic projectNameN;
bool isAllowWaitList; bool isAllowWaitList;
String titleDescription; String titleDescription;
Null titleDescriptionN; dynamic titleDescriptionN;
Null isRegistered; dynamic isRegistered;
Null isDoctorDummy; dynamic isDoctorDummy;
bool isActive; bool isActive;
bool isDoctorHasPrePostImages; bool isDoctorHasPrePostImages;
Null isDoctorAppointmentDisplayed; dynamic isDoctorAppointmentDisplayed;
bool doctorClinicActive; bool doctorClinicActive;
Null isbookingAllowed; dynamic isbookingAllowed;
String doctorCases; String doctorCases;
Null doctorPicture; dynamic doctorPicture;
String doctorProfileInfo; String doctorProfileInfo;
List<String> specialty; List<String> specialty;
int actualDoctorRate; num actualDoctorRate;
String doctorImageURL; String doctorImageURL;
int doctorRate; num doctorRate;
double decimalDoctorRate; num decimalDoctorRate;
String doctorTitleForProfile; String doctorTitleForProfile;
bool isAppointmentAllowed; bool isAppointmentAllowed;
String nationalityFlagURL; String nationalityFlagURL;
int noOfPatientsRate; num noOfPatientsRate;
String qR; String qR;
int serviceID; num serviceID;
DoctorProfileList( DoctorProfileList(
{this.doctorID, {this.doctorID,

@ -25,6 +25,9 @@ class SendActivationRequest {
String dob; String dob;
int isHijri; int isHijri;
String healthId; String healthId;
int responseID;
int status;
SendActivationRequest( SendActivationRequest(
{this.patientMobileNumber, {this.patientMobileNumber,
this.mobileNo, this.mobileNo,
@ -51,7 +54,9 @@ class SendActivationRequest {
this.sMSSignature, this.sMSSignature,
this.dob, this.dob,
this.isHijri, this.isHijri,
this.healthId}); this.healthId,
this.responseID,
this.status});
SendActivationRequest.fromJson(Map<String, dynamic> json) { SendActivationRequest.fromJson(Map<String, dynamic> json) {
patientMobileNumber = json['PatientMobileNumber']; patientMobileNumber = json['PatientMobileNumber'];
@ -80,6 +85,8 @@ class SendActivationRequest {
dob = json['DOB']; dob = json['DOB'];
isHijri = json['IsHijri']; isHijri = json['IsHijri'];
healthId = json['HealthId']; healthId = json['HealthId'];
responseID = json['ReponseID'];
status = json['Status'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -110,6 +117,8 @@ class SendActivationRequest {
data['DOB'] = dob; data['DOB'] = dob;
data['IsHijri'] = isHijri; data['IsHijri'] = isHijri;
data['HealthId'] = healthId; data['HealthId'] = healthId;
data['ResponseID'] = responseID;
data['Status'] = status;
return data; return data;
} }
} }

@ -52,7 +52,7 @@ class LocationModel {
int barcode; int barcode;
dynamic companybarcode; dynamic companybarcode;
int cityId; int cityId;
CityName cityName; String cityName;
int distanceInKilometers; int distanceInKilometers;
String latitude; String latitude;
int locationType; int locationType;
@ -78,7 +78,7 @@ class LocationModel {
barcode: json["Barcode"], barcode: json["Barcode"],
companybarcode: json["Companybarcode"], companybarcode: json["Companybarcode"],
cityId: json["CityID"], cityId: json["CityID"],
cityName: cityNameValues.map[json["CityName"]], cityName: json["CityName"],
distanceInKilometers: json["DistanceInKilometers"], distanceInKilometers: json["DistanceInKilometers"],
latitude: json["Latitude"], latitude: json["Latitude"],
locationType: json["LocationType"], locationType: json["LocationType"],
@ -105,7 +105,7 @@ class LocationModel {
"Barcode": barcode, "Barcode": barcode,
"Companybarcode": companybarcode, "Companybarcode": companybarcode,
"CityID": cityId, "CityID": cityId,
"CityName": cityNameValues.reverse[cityName], "CityName": cityName,
"DistanceInKilometers": distanceInKilometers, "DistanceInKilometers": distanceInKilometers,
"Latitude": latitude, "Latitude": latitude,
"LocationType": locationType, "LocationType": locationType,

@ -1,7 +1,3 @@
// To parse this JSON data, do
//
// final productDetail = productDetailFromJson(jsonString);
import 'dart:convert'; import 'dart:convert';
List<ProductDetail> productDetailFromJson(String str) => List<ProductDetail>.from(json.decode(str).map((x) => ProductDetail.fromJson(x))); List<ProductDetail> productDetailFromJson(String str) => List<ProductDetail>.from(json.decode(str).map((x) => ProductDetail.fromJson(x)));
@ -16,12 +12,12 @@ class ProductDetail {
List<Review> reviews; List<Review> reviews;
factory ProductDetail.fromJson(Map<String, dynamic> json) => ProductDetail( factory ProductDetail.fromJson(Map<String, dynamic> json) => ProductDetail(
reviews: List<Review>.from(json["reviews"].map((x) => Review.fromJson(x))), reviews: List<Review>.from(json["reviews"].map((x) => Review.fromJson(x))),
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"reviews": List<dynamic>.from(reviews.map((x) => x.toJson())), "reviews": List<dynamic>.from(reviews.map((x) => x.toJson())),
}; };
} }
class Review { class Review {
@ -62,42 +58,42 @@ class Review {
dynamic product; dynamic product;
factory Review.fromJson(Map<String, dynamic> json) => Review( factory Review.fromJson(Map<String, dynamic> json) => Review(
id: json["id"], id: json["id"],
position: json["position"], position: json["position"],
reviewId: json["review_id"], reviewId: json["review_id"],
customerId: json["customer_id"], customerId: json["customer_id"],
productId: json["product_id"], productId: json["product_id"],
storeId: json["store_id"], storeId: json["store_id"],
isApproved: json["is_approved"], isApproved: json["is_approved"],
title: json["title"], title: json["title"],
reviewText: json["review_text"], reviewText: json["review_text"],
replyText: json["reply_text"], replyText: json["reply_text"],
rating: json["rating"], rating: json["rating"],
helpfulYesTotal: json["helpful_yes_total"], helpfulYesTotal: json["helpful_yes_total"],
helpfulNoTotal: json["helpful_no_total"], helpfulNoTotal: json["helpful_no_total"],
createdOnUtc: DateTime.parse(json["created_on_utc"]), createdOnUtc: DateTime.parse(json["created_on_utc"]),
customer: Customer.fromJson(json["customer"]), customer: Customer.fromJson(json["customer"]),
product: json["product"], product: json["product"],
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"id": id, "id": id,
"position": position, "position": position,
"review_id": reviewId, "review_id": reviewId,
"customer_id": customerId, "customer_id": customerId,
"product_id": productId, "product_id": productId,
"store_id": storeId, "store_id": storeId,
"is_approved": isApproved, "is_approved": isApproved,
"title": title, "title": title,
"review_text": reviewText, "review_text": reviewText,
"reply_text": replyText, "reply_text": replyText,
"rating": rating, "rating": rating,
"helpful_yes_total": helpfulYesTotal, "helpful_yes_total": helpfulYesTotal,
"helpful_no_total": helpfulNoTotal, "helpful_no_total": helpfulNoTotal,
"created_on_utc": createdOnUtc.toIso8601String(), "created_on_utc": createdOnUtc.toIso8601String(),
"customer": customer.toJson(), "customer": customer.toJson(),
"product": product, "product": product,
}; };
} }
class Customer { class Customer {
@ -164,75 +160,73 @@ class Customer {
dynamic registeredInStoreId; dynamic registeredInStoreId;
factory Customer.fromJson(Map<String, dynamic> json) => Customer( factory Customer.fromJson(Map<String, dynamic> json) => Customer(
fileNumber: json["file_number"], fileNumber: json["file_number"],
iqamaNumber: json["iqama_number"], iqamaNumber: json["iqama_number"],
isOutSa: json["is_out_sa"], isOutSa: json["is_out_sa"],
patientType: json["patient_type"], patientType: json["patient_type"],
gender: json["gender"], gender: json["gender"],
birthDate: DateTime.parse(json["birth_date"]), birthDate: DateTime.parse(json["birth_date"]),
phone: json["phone"], phone: json["phone"],
countryCode: json["country_code"], countryCode: json["country_code"],
yahalaAccountno: json["yahala_accountno"], yahalaAccountno: json["yahala_accountno"],
billingAddress: json["billing_address"], billingAddress: json["billing_address"],
shippingAddress: json["shipping_address"], shippingAddress: json["shipping_address"],
id: json["id"], id: json["id"],
username: emailValues.map[json["username"]], username: emailValues.map[json["username"]],
email: emailValues.map[json["email"]], email: emailValues.map[json["email"]],
firstName: json["first_name"], firstName: json["first_name"],
lastName: json["last_name"], lastName: json["last_name"],
languageId: json["language_id"], languageId: json["language_id"],
adminComment: json["admin_comment"], adminComment: json["admin_comment"],
isTaxExempt: json["is_tax_exempt"], isTaxExempt: json["is_tax_exempt"],
hasShoppingCartItems: json["has_shopping_cart_items"], hasShoppingCartItems: json["has_shopping_cart_items"],
active: json["active"], active: json["active"],
deleted: json["deleted"], deleted: json["deleted"],
isSystemAccount: json["is_system_account"], isSystemAccount: json["is_system_account"],
systemName: json["system_name"], systemName: json["system_name"],
lastIpAddress: json["last_ip_address"], lastIpAddress: json["last_ip_address"],
createdOnUtc: json["created_on_utc"], createdOnUtc: json["created_on_utc"],
lastLoginDateUtc: json["last_login_date_utc"], lastLoginDateUtc: json["last_login_date_utc"],
lastActivityDateUtc: json["last_activity_date_utc"], lastActivityDateUtc: json["last_activity_date_utc"],
registeredInStoreId: json["registered_in_store_id"], registeredInStoreId: json["registered_in_store_id"],
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"file_number": fileNumber, "file_number": fileNumber,
"iqama_number": iqamaNumber, "iqama_number": iqamaNumber,
"is_out_sa": isOutSa, "is_out_sa": isOutSa,
"patient_type": patientType, "patient_type": patientType,
"gender": gender, "gender": gender,
"birth_date": birthDate.toIso8601String(), "birth_date": birthDate.toIso8601String(),
"phone": phone, "phone": phone,
"country_code": countryCode, "country_code": countryCode,
"yahala_accountno": yahalaAccountno, "yahala_accountno": yahalaAccountno,
"billing_address": billingAddress, "billing_address": billingAddress,
"shipping_address": shippingAddress, "shipping_address": shippingAddress,
"id": id, "id": id,
"username": emailValues.reverse[username], "username": emailValues.reverse[username],
"email": emailValues.reverse[email], "email": emailValues.reverse[email],
"first_name": firstName, "first_name": firstName,
"last_name": lastName, "last_name": lastName,
"language_id": languageId, "language_id": languageId,
"admin_comment": adminComment, "admin_comment": adminComment,
"is_tax_exempt": isTaxExempt, "is_tax_exempt": isTaxExempt,
"has_shopping_cart_items": hasShoppingCartItems, "has_shopping_cart_items": hasShoppingCartItems,
"active": active, "active": active,
"deleted": deleted, "deleted": deleted,
"is_system_account": isSystemAccount, "is_system_account": isSystemAccount,
"system_name": systemName, "system_name": systemName,
"last_ip_address": lastIpAddress, "last_ip_address": lastIpAddress,
"created_on_utc": createdOnUtc, "created_on_utc": createdOnUtc,
"last_login_date_utc": lastLoginDateUtc, "last_login_date_utc": lastLoginDateUtc,
"last_activity_date_utc": lastActivityDateUtc, "last_activity_date_utc": lastActivityDateUtc,
"registered_in_store_id": registeredInStoreId, "registered_in_store_id": registeredInStoreId,
}; };
} }
enum Email { STEVE_GATES_NOP_COMMERCE_COM } enum Email { STEVE_GATES_NOP_COMMERCE_COM }
final emailValues = EnumValues({ final emailValues = EnumValues({"steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM});
"steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM
});
class EnumValues<T> { class EnumValues<T> {
Map<String, T> map; Map<String, T> map;

@ -170,7 +170,6 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
child: Container( child: Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
width: double.infinity, width: double.infinity,
// height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
color: Colors.white, color: Colors.white,

@ -56,7 +56,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: ListView.separated( body: model.cmcAllPresOrders.length > 0 ? ListView.separated(
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -178,7 +178,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 12), separatorBuilder: (context, index) => SizedBox(height: 12),
itemCount: model.cmcAllPresOrders.length), itemCount: model.cmcAllPresOrders.length) : getNoDataWidget(context),
); );
} }
} }

@ -149,23 +149,15 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).serviceName + ": ", TranslationBase.of(context).hospital + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), ),
Column( Expanded(
children: [ child: Text(
...List.generate( widget.model.pendingOrder.nearestProjectName.toString(),
widget.model.hhcAllOrderDetail.length, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
(index) => Container( ),
child: Texts( ),
projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description.capitalize(),
fontSize: 13,
bold: false,
),
),
)
],
)
], ],
) )
], ],

@ -1,13 +1,14 @@
import 'dart:math'; import 'dart:math';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../health_calc_desc.dart';
import 'result_page.dart'; import 'result_page.dart';
const activeCardColor = Color(0xff70777A); const activeCardColor = Color(0xff70777A);
@ -23,52 +24,17 @@ class _BMICalculatorState extends State<BMICalculator> {
String textResult; String textResult;
String msg; String msg;
double bmiResult; double bmiResult;
int height = 150;
int weight = 40;
Color cmCard = activeCardColor;
Color ftCard = inactiveCardColor;
Color lbCard = inactiveCardColor;
Color kgCard = activeCardColor;
void updateColor(int type) { TextEditingController _heightController = TextEditingController();
//MG/DLT card TextEditingController _weightController = TextEditingController();
if (type == 1) {
if (cmCard == inactiveCardColor) {
cmCard = activeCardColor;
ftCard = inactiveCardColor;
} else {
cmCard = inactiveCardColor;
}
}
if (type == 2) {
if (ftCard == inactiveCardColor) {
ftCard = activeCardColor;
cmCard = inactiveCardColor;
} else {
ftCard = inactiveCardColor;
}
}
}
void updateColorWeight(int type) { List<PopupMenuItem> _weightPopupList = List();
//MG/DLT card List<PopupMenuItem> _heightPopupList = List();
if (type == 1) {
if (kgCard == inactiveCardColor) { bool _isHeightCM = true;
kgCard = activeCardColor; bool _isWeightKG = true;
lbCard = inactiveCardColor; double _heightValue = 150;
} else { double _weightValue = 40;
kgCard = inactiveCardColor;
}
}
if (type == 2) {
if (lbCard == inactiveCardColor) {
lbCard = activeCardColor;
kgCard = inactiveCardColor;
} else {
lbCard = inactiveCardColor;
}
}
}
double convertToCm(double number) { double convertToCm(double number) {
return number * 30.48; return number * 30.48;
@ -79,10 +45,11 @@ class _BMICalculatorState extends State<BMICalculator> {
} }
double calculateBMI() { double calculateBMI() {
if (ftCard == activeCardColor) { if (!_isHeightCM) _heightValue = convertToCm(_heightValue.toDouble());
convertToCm(height.toDouble());
} if (!_isWeightKG) _weightValue = convertToKg(_weightValue);
bmiResult = weight / pow(height / 100, 2);
bmiResult = _weightValue / pow(_heightValue / 100, 2);
return bmiResult; return bmiResult;
} }
@ -115,432 +82,261 @@ class _BMICalculatorState extends State<BMICalculator> {
void initState() { void initState() {
super.initState(); super.initState();
textController.text = '0'; // Setting the initial value for the field. textController.text = '0'; // Setting the initial value for the field.
_heightValue = 100;
_weightValue = 50;
_heightController.text = _heightValue.toStringAsFixed(0);
_weightController.text = _weightValue.toStringAsFixed(0);
_isWeightKG = true;
_isHeightCM = true;
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
_weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)];
_heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)];
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
showHomeAppBarIcon: false, showHomeAppBarIcon: true,
appBarIcons: [ showNewAppBar: true,
IconButton( showNewAppBarTitle: true,
icon: Icon(Icons.info_outline), appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
color: Colors.white, body: Column(
onPressed: () { children: [
Navigator.push( Expanded(
context, child: Padding(
MaterialPageRoute( padding: const EdgeInsets.all(16.0),
builder: (context) => HealthDescPage(
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
TranslationBase.of(context).bmiCalcDesc,
"assets/images/AlHabibMedicalService/health_calculator/bmi.png")),
);
},
)
],
appBarTitle:
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: Padding(
padding: EdgeInsets.symmetric(vertical: 15.0),
child: Text(
TranslationBase.of(context).bmiCalcDesc,
style: TextStyle(fontSize: 18.0),
),
),
),
),
Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.0),
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Text(
children: [ TranslationBase.of(context).bmiCalcDesc,
Padding( style: TextStyle(
padding: EdgeInsets.all(8.0), fontSize: 14.0,
child: Texts(TranslationBase.of(context).height), letterSpacing: -0.56,
), fontWeight: FontWeight.w600,
], ),
),
Row(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(height.toString()),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (height < 250) height++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (height > 120) height--;
});
},
),
],
),
),
],
),
),
),
),
Slider(
value: height.toDouble(),
min: 120,
max: 250,
onChanged: (double newValue) {
setState(() {
height = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
],
),
Row(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).selectUnit),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColor(1);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
),
],
color: cmCard,
borderRadius: BorderRadius.circular(3.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(
child: Texts(TranslationBase.of(context).cm)),
),
),
),
GestureDetector(
onTap: () {
setState(() {
updateColor(2);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
color: ftCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
),
],
),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(
child: Texts(TranslationBase.of(context).feet)),
),
),
),
],
),
],
),
),
SizedBox(
height: 25.0,
),
Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.0),
),
child: Column(
children: [
Row(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).weight),
),
],
), ),
Row( mHeight(24),
children: [ _commonInputAndUnitRow(
Padding( TranslationBase.of(context).height,
padding: EdgeInsets.symmetric( _heightController,
vertical: 10.0, horizontal: 8.0), 1,
child: Center( 270,
child: Container( _heightValue,
width: 60.0, (text) {
foregroundDecoration: BoxDecoration( _heightController.text = text;
borderRadius: BorderRadius.circular(5.0), },
border: Border.all( (value) {
color: Colors.blueGrey, _heightValue = value;
width: 2.0, },
), _isHeightCM ? TranslationBase.of(context).cm : TranslationBase.of(context).ft,
), (value) {
child: Row( if (_isHeightCM != value) {
children: <Widget>[ setState(() {
Expanded( _isHeightCM = value;
child: Center( });
child: Text(weight.toString()), }
), },
), _heightPopupList,
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (weight < 250) weight++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (weight > 40) weight--;
});
},
),
],
),
),
],
),
),
),
),
Slider(
value: weight.toDouble(),
min: 40,
max: 250,
onChanged: (double newValue) {
setState(() {
weight = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
],
), ),
Row( mHeight(12),
children: [ _commonInputAndUnitRow(
Padding( TranslationBase.of(context).weight,
padding: EdgeInsets.all(8.0), _weightController,
child: Texts(TranslationBase.of(context).selectUnit), 1,
), 270,
], _weightValue,
), (text) {
Row( _weightController.text = text;
mainAxisAlignment: MainAxisAlignment.spaceEvenly, },
children: [ (value) {
GestureDetector( _weightValue = value;
onTap: () { },
setState(() { _isWeightKG ? TranslationBase.of(context).kg : TranslationBase.of(context).pound,
updateColorWeight(1); (value) {
}); if (_isWeightKG != value) {
}, setState(() {
child: Container( _isWeightKG = value;
height: 55.0, });
width: 150.0, }
decoration: BoxDecoration( },
boxShadow: [ _weightPopupList,
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
),
],
color: kgCard,
borderRadius: BorderRadius.circular(3.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(
child: Texts(TranslationBase.of(context).kg)),
),
),
),
GestureDetector(
onTap: () {
setState(() {
updateColorWeight(2);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
color: lbCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
),
],
),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(
child:
Texts(TranslationBase.of(context).pound)),
),
),
),
],
), ),
], ],
), ),
), ),
SizedBox( ),
height: 25.0, Container(
), color: Colors.white,
Container( padding: EdgeInsets.all(16),
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16), child: SecondaryButton(
padding: EdgeInsets.symmetric(vertical: 8), label: TranslationBase.of(context).calculate,
child: SecondaryButton( color: CustomColors.accentColor,
label: TranslationBase.of(context).calculate, onTap: () {
onTap: () => { setState(() {
setState(() { calculateBMI();
calculateBMI(); showTextResult(context);
showTextResult(context); showMsg(context);
showMsg(context); {
{ Navigator.push(
Navigator.push( context,
context, FadePage(
FadePage( page: ResultPage(
page: ResultPage(
finalResult: bmiResult, finalResult: bmiResult,
textResult: textResult, textResult: textResult,
msg: msg, msg: msg,
)), ),
); ),
} );
}) }
});
},
),
),
],
),
);
}
Widget _commonInputAndUnitRow(_title, _controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange, String unitTitle,
Function(bool) onUnitTap, _list) {
return Row(
children: [
Expanded(
flex: 3,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_title,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.44,
),
),
TextField(
controller: _controller,
keyboardType: TextInputType.number,
onChanged: (value) {
double _value = double.parse(value);
if (_value > _maxValue) {
onTextValueChange(_maxValue.toStringAsFixed(0));
onValueChange(_maxValue);
return;
} else if (_value < _minValue) {
onTextValueChange(_minValue.toStringAsFixed(0));
onValueChange(_minValue);
return;
} else if (_value >= _minValue && _value <= _maxValue) {
onValueChange(_value);
return;
}
}, },
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
],
style: TextStyle(
color: Color(0xff575757),
letterSpacing: -0.56,
),
decoration: InputDecoration(
isDense: true,
hintText: "0",
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
), ),
), ],
], ),
), ),
Container(height: 34, width: 1, color: Color(0xffE0E0E0), margin: EdgeInsets.only(left: 12, right: 12)),
Expanded(
flex: 1,
child: PopupMenuButton(
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null),
onSelected: (value) {
onUnitTap(value);
},
itemBuilder: (context) => _list),
)
],
).withBorderedContainer;
}
}
// todo 'sikander' move these to separate file once usability known
class CommonDropDownView extends StatelessWidget {
final String title;
final String value;
final VoidCallback callback;
final IconData iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key key, this.iconData}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: callback,
child: Row(
children: [
Expanded(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(
title,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.44,
),
),
Text(
value,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
),
]),
),
Icon(
iconData ?? Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A),
)
],
), ),
); );
} }
} }
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
}

@ -1,45 +1,58 @@
import 'dart:collection';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:percent_indicator/percent_indicator.dart'; import 'package:flutter_svg/svg.dart';
class ResultPage extends StatelessWidget { class ResultPage extends StatefulWidget {
final double finalResult; final double finalResult;
final String textResult; final String textResult;
final String msg; final String msg;
ResultPage({this.finalResult, this.textResult, this.msg}); ResultPage({this.finalResult, this.textResult, this.msg});
@override
_ResultPageState createState() => _ResultPageState();
}
class _ResultPageState extends State<ResultPage> {
Color inductorColor; Color inductorColor;
double percent; double percent;
Color colorInductor() { Color colorInductor() {
if (finalResult >= 30) { if (widget.finalResult >= 30) {
inductorColor = Color(0xffC70D00); inductorColor = Color(0xffC70D00);
} else if (finalResult < 30 && finalResult >= 25) { } else if (widget.finalResult < 30 && widget.finalResult >= 25) {
inductorColor = Color(0xffC25400); inductorColor = Color(0xffC25400);
} else if (finalResult < 25 && finalResult >= 18.5) { } else if (widget.finalResult < 25 && widget.finalResult >= 18.5) {
inductorColor = Color(0xff36D600); inductorColor = Color(0xff36D600);
} else if (finalResult < 18.5) { } else if (widget.finalResult < 18.5) {
inductorColor = Color(0xff1BE0EE); inductorColor = Color(0xff1BE0EE);
} }
return inductorColor; return inductorColor;
} }
double percentInductor() { double percentInductor() {
if (finalResult >= 30) { if (widget.finalResult >= 30) {
percent = 1.0; percent = 1.0;
} else if (finalResult < 30 && finalResult >= 25) { } else if (widget.finalResult < 30 && widget.finalResult >= 25) {
percent = 0.73; percent = 0.73;
} else if (finalResult < 25 && finalResult >= 18.5) { } else if (widget.finalResult < 25 && widget.finalResult >= 18.5) {
percent = 0.5; percent = 0.5;
} else if (finalResult < 18.5) { } else if (widget.finalResult < 18.5) {
percent = 0.25; percent = 0.25;
} }
return percent; return percent;
@ -50,71 +63,71 @@ class ResultPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: Column( body: Column(
children: [ children: [
Expanded( Container(
child: SingleChildScrollView( margin: EdgeInsets.only(left: 20, right: 20, top: 20, bottom: 6),
decoration: cardRadius(12),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [ children: [
Container( Text(
margin: EdgeInsets.only(top: 50), TranslationBase.of(context).bodyMassIndex + widget.finalResult.toStringAsFixed(2),
child: Center( style: TextStyle(
child: CircularPercentIndicator( fontSize: 16,
radius: 220.0, letterSpacing: -0.64,
lineWidth: 20.0, fontWeight: FontWeight.w600,
percent: percentInductor(),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
finalResult.toStringAsFixed(1),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 5.0,
),
Text(
textResult,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
),
),
],
),
progressColor: colorInductor(),
backgroundColor: Colors.white,
),
), ),
), ),
mHeight(20),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), height: MediaQuery.of(context).size.width / 2.8,
child: Texts(msg), child: Row(
children: [
showMass(context, TranslationBase.of(context).underWeight, "< 18.5", widget.finalResult <= 18.5 ? Colors.red : Colors.black, 8),
mWidth(12),
showMass(context, TranslationBase.of(context).healthy, "18.5 - 24.9", (widget.finalResult > 18.5 && widget.finalResult < 25) ? Colors.red : Colors.black, 6),
mWidth(12),
showMass(context, TranslationBase.of(context).overWeight, "25 - 29.9", (widget.finalResult >= 25 && widget.finalResult < 30) ? Colors.red : Colors.black, 4),
mWidth(12),
showMass(context, TranslationBase.of(context).obese, "30 - 34.9", (widget.finalResult >= 30 && widget.finalResult < 35) ? Colors.red : Colors.black, 2),
mWidth(12),
showMass(context, TranslationBase.of(context).extremeObese, "> 35", (widget.finalResult >= 35) ? Colors.red : Colors.black, 0),
],
),
),
mHeight(20),
Text(
widget.textResult,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.56,
),
),
mHeight(4),
Text(
widget.msg,
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.56, color: CustomColors.textColor),
), ),
], ],
), ),
), ),
), ),
mFlex(1),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), color: Colors.white,
child: BorderedButton( padding: EdgeInsets.all(16),
child: DefaultButton(
TranslationBase.of(context).seeListOfDoctor, TranslationBase.of(context).seeListOfDoctor,
fontSize: SizeConfig.textMultiplier * 2.1, () {
textColor: Colors.white, callDoctorsSearchAPI();
vPadding: 8,
hPadding: 8,
backgroundColor: Theme.of(context).primaryColor,
radius: 8,
fontWeight: FontWeight.bold,
handler: () {
Navigator.push(
context,
FadePage(page: BariatricsPage(1, 1, finalResult)),
);
}, },
), ),
), ),
@ -122,4 +135,116 @@ class ResultPage extends StatelessWidget {
), ),
); );
} }
callDoctorsSearchAPI() {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];
List<String> arrDistance = [];
List<String> result;
int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(108, 0, false, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
}
});
} else {}
});
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
});
}
Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)))
.then((value) {
setState(() {
// dropdownValue = null;
});
// getProjectsList();
});
}
Widget showMass(BuildContext context, String title, String weight, Color color, int f) {
return Expanded(
flex: 1,
child: Container(
height: double.infinity,
width: double.infinity,
child: Column(
children: [
Flexible(
child: Row(
children: [
mFlex(f),
Flexible(
flex: 10,
child: SvgPicture.asset(
"assets/images/new/mass/health_BMI.svg",
height: double.infinity,
width: double.infinity,
fit: BoxFit.fill,
color: color,
),
),
mFlex(f),
],
),
),
mHeight(20),
AutoSizeText(
title,
maxLines: 1,
minFontSize: 6,
style: TextStyle(
color: color,
fontSize: 10,
letterSpacing: -0.6,
),
),
AutoSizeText(
weight,
maxLines: 1,
minFontSize: 6,
style: TextStyle(
color: color,
fontSize: 10,
letterSpacing: -0.6,
),
)
],
),
),
);
}
} }

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -27,50 +30,81 @@ class BmrResultPage extends StatelessWidget {
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Center( Padding(
child: CircularPercentIndicator( padding: const EdgeInsets.all(20.0),
radius: 220.0, child: Column(
lineWidth: 20.0, mainAxisAlignment: MainAxisAlignment.start,
percent: ((this.bmrResult > 3500) ? 100 : this.bmrResult / 3500), crossAxisAlignment: CrossAxisAlignment.start,
center: Column( children: [
mainAxisAlignment: MainAxisAlignment.center, Text(
children: [ TranslationBase.of(context).calories,
Text( style: TextStyle(
bmrResult.toStringAsFixed(1), fontSize: 19,
style: TextStyle( letterSpacing: -1.34,
fontSize: 18.0, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold,
),
), ),
SizedBox( ),
height: 5.0, mHeight(20),
Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 3.0,
percent: ((this.bmrResult > 3500) ? 100 : this.bmrResult / 3500),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
bmrResult.toStringAsFixed(1),
style: TextStyle(
fontSize: 17,
letterSpacing: -1.02,
fontWeight: FontWeight.w600,
),
),
SizedBox(
height: 5.0,
),
Text(
TranslationBase.of(context).calories,
style: TextStyle(
fontSize: 18,
letterSpacing: -1.08,
fontWeight: FontWeight.w600,
),
),
],
),
progressColor: CustomColors.accentColor,
backgroundColor: Colors.white,
), ),
Text( ),
'Calories/Day', mHeight(20),
style: TextStyle( Text(
fontSize: 16.0, TranslationBase.of(context).bodyWillBurn+' ( ${bmrResult.toStringAsFixed(1)} )'+TranslationBase.of(context).caloriesEachDay+'( ${calories.toStringAsFixed(1)} ) '+TranslationBase.of(context).maintainWeight,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), color: CustomColors.textColor
), ),
], ),
), ],
progressColor: Color(0xff3C3939), ).withBorderedContainer,
),
),
Container(
height: 120,
width: 280.0,
child: Texts(
'This means the body will burn ( ${bmrResult.toStringAsFixed(1)} ) calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is ( ${calories.toStringAsFixed(1)} ) calories, to maintain the current weight.'),
), ),
mFlex(1),
Container( Container(
width: 350, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
child: Button( color: Colors.white,
label: TranslationBase.of(context).viewDocList, child: SecondaryButton(
onTap: () { label: TranslationBase.of(context).viewDocList,
getDoctorsList(context); color: CustomColors.accentColor,
}), onTap: () {
getDoctorsList(context);
},
),
), ),
], ],
), ),
); );
@ -129,3 +163,18 @@ class BmrResultPage extends StatelessWidget {
}); });
} }
} }
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
}

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -41,49 +44,70 @@ class FatResult extends StatelessWidget {
showNewAppBar: true, showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bodyFatTitle, appBarTitle: TranslationBase.of(context).bodyFatTitle,
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
SizedBox( Padding(
// height: 40.0, padding: const EdgeInsets.all(20.0),
), child: Column(
Center( mainAxisAlignment: MainAxisAlignment.start,
child: CircularPercentIndicator( crossAxisAlignment: CrossAxisAlignment.start,
radius: 220.0, children: [
lineWidth: 20.0, Text(
percent: ((fat > 70) ? 100 : fat / 100), TranslationBase.of(context).bodyFatTitle,
center: Column( style: TextStyle(
mainAxisAlignment: MainAxisAlignment.center, fontSize: 19,
children: [ letterSpacing: -1.34,
Text( fontWeight: FontWeight.bold,
fat.toStringAsFixed(1) + '%', ),
style: TextStyle( ),
fontSize: 18.0, mHeight(20),
fontWeight: FontWeight.bold, Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 3.0,
percent: ((fat > 70) ? 100 : fat / 100),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
fat.toStringAsFixed(1) + '%',
style: TextStyle(
fontSize: 17,
letterSpacing: -1.02,
fontWeight: FontWeight.w600,
),
),
],
), ),
progressColor: CustomColors.accentColor,
backgroundColor: Colors.white,
), ),
SizedBox( ),
height: 5.0, mHeight(20),
Text(
textResult, style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
fontWeight: FontWeight.w600,
color: CustomColors.textColor
), ),
], ),
), ],
progressColor: inductorColor, ).withBorderedContainer,
backgroundColor: Colors.white,
),
),
Container(
height: 120,
width: 280.0,
child: Texts(textResult),
), ),
mFlex(1),
Container( Container(
width: 350, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
child: Button( color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).viewDocList, label: TranslationBase.of(context).viewDocList,
color: CustomColors.accentColor,
onTap: () { onTap: () {
getDoctorsList(context); getDoctorsList(context);
}, },
), ),
), ),
], ],
), ),
); );
@ -142,3 +166,18 @@ class FatResult extends StatelessWidget {
}); });
} }
} }
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
}

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -24,45 +27,83 @@ class CalorieResultPage extends StatelessWidget {
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Center( Padding(
child: CircularPercentIndicator( padding: const EdgeInsets.all(20.0),
radius: 220.0, child: Column(
lineWidth: 20.0, mainAxisAlignment: MainAxisAlignment.start,
percent: ((this.calorie > 3500) ? 100 : this.calorie / 3500), crossAxisAlignment: CrossAxisAlignment.start,
center: Column( children: [
mainAxisAlignment: MainAxisAlignment.center, Text(
children: [ TranslationBase.of(context).calories,
Text( style: TextStyle(
calorie.toStringAsFixed(1), fontSize: 19,
style: TextStyle( letterSpacing: -1.34,
fontSize: 18.0, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, ),
),
mHeight(20),
Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 3.0,
percent: ((this.calorie > 3500) ? 100 : this.calorie / 3500),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
calorie.toStringAsFixed(1),
style: TextStyle(
fontSize: 17,
letterSpacing: -1.02,
fontWeight: FontWeight.w600,
),
),
SizedBox(
height: 5.0,
),
Text(
TranslationBase.of(context).calories,
style: TextStyle(
fontSize: 18,
letterSpacing: -1.08,
fontWeight: FontWeight.w600,
),
),
],
), ),
progressColor: CustomColors.accentColor,
backgroundColor: Colors.white,
), ),
SizedBox( ),
height: 5.0, mHeight(20),
Text(
TranslationBase.of(context).dailyIntake+' ${calorie.toStringAsFixed(1)} '+TranslationBase.of(context).calories,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
fontWeight: FontWeight.w600,
color: CustomColors.textColor
), ),
Texts('Calories'), ),
], ],
), ).withBorderedContainer,
progressColor: Color(0xff3C3939),
backgroundColor: Colors.white,
),
),
Container(
child: Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'),
), ),
mFlex(1),
Container( Container(
width: 350, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
child: Button( color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).viewDocList, label: TranslationBase.of(context).viewDocList,
color: CustomColors.accentColor,
onTap: () { onTap: () {
getDoctorsList(context); getDoctorsList(context);
}, },
), ),
), ),
], ],
), ),
); );
@ -121,3 +162,19 @@ class CalorieResultPage extends StatelessWidget {
}); });
} }
} }
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
}

@ -1,12 +1,13 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'carbs_result_page.dart'; import 'carbs_result_page.dart';
@ -17,6 +18,7 @@ class Carbs extends StatefulWidget {
class _CarbsState extends State<Carbs> { class _CarbsState extends State<Carbs> {
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
final GlobalKey clinicDropdownKey = GlobalKey();
int calories; int calories;
String dropdownValue; String dropdownValue;
bool _visible = false; bool _visible = false;
@ -36,27 +38,27 @@ class _CarbsState extends State<Carbs> {
double fCalMeal; double fCalMeal;
void calculateDietRatios() { void calculateDietRatios() {
if (dropdownValue == 'Very Low Carb') { if (dropdownValue == TranslationBase.of(context).dietVeryLow) {
meals = 3; meals = 3;
protein = 45; protein = 45;
carbs = 10; carbs = 10;
fat = 45; fat = 45;
} else if (dropdownValue == 'Low Carb') { } else if (dropdownValue == TranslationBase.of(context).dietLow) {
meals = 3; meals = 3;
protein = 40; protein = 40;
carbs = 30; carbs = 30;
fat = 30; fat = 30;
} else if (dropdownValue == 'Moderate Carb') { } else if (dropdownValue == TranslationBase.of(context).dietModerate) {
meals = 3; meals = 3;
protein = 25; protein = 25;
carbs = 50; carbs = 50;
fat = 25; fat = 25;
} else if (dropdownValue == 'USDA Gudilines') { } else if (dropdownValue == TranslationBase.of(context).dietUSDA) {
meals = 3; meals = 3;
protein = 15; protein = 15;
carbs = 55; carbs = 55;
fat = 30; fat = 30;
} else if (dropdownValue == 'Zone Diet') { } else if (dropdownValue == TranslationBase.of(context).dietZone) {
meals = 3; meals = 3;
protein = 30; protein = 30;
carbs = 40; carbs = 40;
@ -67,9 +69,9 @@ class _CarbsState extends State<Carbs> {
void calculate() { void calculate() {
pCal = (protein / 100.0) * int.parse(textController.text).ceil(); pCal = (protein / 100.0) * int.parse(textController.text).ceil();
cCal = (carbs / 100.0) * int.parse(textController.text); cCal = (carbs / 100.0) * int.parse(textController.text);
;
fCal = (fat / 100) * int.parse(textController.text); fCal = (fat / 100) * int.parse(textController.text);
;
pCalGram = pCal / 4.0; pCalGram = pCal / 4.0;
cCalGram = cCal / 4.0; cCalGram = cCal / 4.0;
fCalGram = fCal / 9.0; fCalGram = fCal / 9.0;
@ -80,6 +82,7 @@ class _CarbsState extends State<Carbs> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
@ -95,286 +98,280 @@ class _CarbsState extends State<Carbs> {
), ),
) )
], ],
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
child: Column( child: Container(
crossAxisAlignment: CrossAxisAlignment.start, padding: EdgeInsets.all(21),
children: [ child: Column(
Texts( crossAxisAlignment: CrossAxisAlignment.start,
'Calculates carbohydrate protein and fat\n ratio in calories and grams according to a\n pre-set ratio',
),
SizedBox(
height: 15.0,
),
Column(
children: [ children: [
Container( Text(
width: 340.0, TranslationBase.of(context).carbProteinDesc,
height: 60.0, style: TextStyle(
decoration: BoxDecoration( fontSize: 14,
color: Colors.white, fontWeight: FontWeight.w600,
), letterSpacing: -0.56,
child: Row( color: CustomColors.textColor,
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 300.0,
foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: TextFormField(
controller: textController,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter
.digitsOnly
],
keyboardType: TextInputType.number,
decoration: InputDecoration(
hintText: " The Calories per day ",
labelStyle: TextStyle(
color: Colors.black87,
),
),
),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
int currentValue = int.parse(
textController.text);
currentValue++;
textController.text =
(currentValue).toString();
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
int currentValue = int.parse(
textController.text);
currentValue--;
textController.text =
(currentValue).toString();
});
},
),
],
),
),
],
),
),
),
),
],
), ),
), ),
SizedBox( SizedBox(
height: 20.0, height: 15.0,
), ),
Button( Column(
backgroundColor: Color(0xffC5272D), mainAxisAlignment: MainAxisAlignment.end,
label: 'NOT SURE? CLICK HERE', crossAxisAlignment: CrossAxisAlignment.end,
onTap: () { children: [
setState(() { inputWidget(TranslationBase.of(context).calDay, "0", textController),
{ InkWell(
onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage(page: CalorieCalculator()), FadePage(page: CalorieCalculator()),
); );
} },
}); child: Padding(
}, padding: const EdgeInsets.all(12.0),
child: Text(
TranslationBase.of(context).notSure,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.56, color: CustomColors.accentColor, decoration: TextDecoration.underline),
),
),
)
],
), ),
], SizedBox(
), height: 12.0,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Select Diet Type'),
Container(
width: 400,
child: DropdownButton<String>(
value: dropdownValue,
icon: Icon(Icons.arrow_downward),
iconSize: 24,
elevation: 16,
style: TextStyle(color: Colors.black87),
underline: Container(
height: 2,
color: Colors.black54,
),
onChanged: (String newValue) {
setState(() {
dropdownValue = newValue;
calculateDietRatios();
dropdownValue == null
? _visible = false
: _visible = true;
});
},
items: <String>[
'Very Low Carb',
'Low Carb',
'Moderate Carb',
'USDA Gudilines',
'Zone Diet',
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
), ),
Visibility( InkWell(
visible: _visible, onTap: () {
// dropdownKey.currentState;
openDropdown(clinicDropdownKey);
},
child: Container( child: Container(
height: 170.0, // width: double.infinity,
child: Column( // decoration: containerRadius(Colors.white, 12),
crossAxisAlignment: CrossAxisAlignment.start, // padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
mainAxisAlignment: MainAxisAlignment.spaceEvenly, child: Row(
children: [ children: [
Texts( Flexible(
'Ratios are divided according to the selected diet'), child: Column(
RichText( crossAxisAlignment: CrossAxisAlignment.start,
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [
TextSpan(text: 'Meals Per Day '),
TextSpan(
text: '$meals',
style: TextStyle(color: Color(0xffC5272D)),
),
],
),
),
RichText(
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [ children: [
TextSpan( Text(
text: 'Protein ', TranslationBase.of(context).selectDiet,
), style: TextStyle(
TextSpan( fontSize: 11,
text: '$protein%', letterSpacing: -0.44,
style: TextStyle(color: Color(0xffC5272D)), fontWeight: FontWeight.w600,
) ),
],
),
),
RichText(
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [
TextSpan(
text: 'Carbohydrate ',
), ),
TextSpan( Container(
text: '$carbs%', height: 18,
style: TextStyle(color: Color(0xffC5272D)), child: DropdownButtonHideUnderline(
) child: DropdownButton<String>(
], value: dropdownValue, key: clinicDropdownKey,
), icon: Icon(Icons.arrow_downward),
), iconSize: 0,
RichText( elevation: 16,
text: TextSpan( isExpanded: true,
style: TextStyle(color: Colors.black), style: TextStyle(color: Colors.black87),
children: [ underline: Container(
TextSpan( height: 2,
text: 'Fat ', color: Colors.black54,
),
onChanged: (String newValue) {
setState(() {
dropdownValue = newValue;
calculateDietRatios();
});
},
items: <String>[
TranslationBase.of(context).dietVeryLow,
TranslationBase.of(context).dietLow,
TranslationBase.of(context).dietModerate,
TranslationBase.of(context).dietUSDA,
TranslationBase.of(context).dietZone
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontSize: 11, letterSpacing: -0.44, fontWeight: FontWeight.w600)),
);
}).toList(),
),
),
), ),
TextSpan(
text: '$fat%',
style: TextStyle(color: Color(0xffC5272D)),
)
], ],
), ),
), ),
Icon(Icons.keyboard_arrow_down),
], ],
), ),
), ).withBorderedContainer,
) ),
SizedBox(
height: 25.0,
),
SizedBox(
height: 55.0,
),
], ],
), ),
SizedBox( ),
height: 55.0, ),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).calculate,
color: CustomColors.accentColor,
onTap: () {
setState(() {
{
calculate();
Navigator.push(
context,
FadePage(
page: CarbsResult(
cCal: cCal,
pCal: pCal,
fCal: fCal,
pCalGram: pCalGram,
pCalMeal: pCalMeal,
fCalGram: fCalGram,
fCalMeal: fCalMeal,
cCalGram: cCalGram,
cCalMeal: cCalMeal,
)),
);
}
});
},
),
),
],
),
);
}
void openDropdown(GlobalKey key) {
GestureDetector detector;
void searchForGestureDetector(BuildContext element) {
element.visitChildElements((element) {
if (element.widget != null && element.widget is GestureDetector) {
detector = element.widget;
return false;
} else {
searchForGestureDetector(element);
}
return true;
});
}
searchForGestureDetector(key.currentContext);
assert(detector != null);
detector.onTap();
}
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
), ),
Container( TextField(
height: 50.0, enabled: isEnable,
width: 350.0, scrollPadding: EdgeInsets.zero,
child: SecondaryButton( keyboardType: TextInputType.number,
label: 'CALCULATE', controller: _controller,
onTap: () { onChanged: (value) => {},
setState(() { style: TextStyle(
{ fontSize: 14,
calculate(); height: 21 / 14,
Navigator.push( fontWeight: FontWeight.w400,
context, color: Color(0xff2B353E),
FadePage( letterSpacing: -0.44,
page: CarbsResult( ),
cCal: cCal, decoration: InputDecoration(
pCal: pCal, isDense: true,
fCal: fCal, hintText: _hintText,
pCalGram: pCalGram, hintStyle: TextStyle(
pCalMeal: pCalMeal, fontSize: 14,
fCalGram: fCalGram, height: 21 / 14,
fCalMeal: fCalMeal, fontWeight: FontWeight.w400,
cCalGram: cCalGram, color: Color(0xff575757),
cCalMeal: cCalMeal, letterSpacing: -0.56,
)), ),
); prefixIconConstraints: BoxConstraints(minWidth: 50),
} prefixIcon: prefix == null
}); ? null
}, : Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
), ),
), ),
], ],
), ),
), ),
), if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
), ),
); ),
} );
}
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
} }

@ -1,15 +1,20 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/painting.dart'; import 'package:flutter/painting.dart';
import 'package:provider/provider.dart';
class CarbsResult extends StatelessWidget { class CarbsResult extends StatelessWidget {
double pCal; double pCal;
@ -22,18 +27,11 @@ class CarbsResult extends StatelessWidget {
double cCalMeal; double cCalMeal;
double fCalMeal; double fCalMeal;
CarbsResult( CarbsResult({this.pCal, this.cCal, this.fCal, this.pCalGram, this.cCalGram, this.fCalGram, this.fCalMeal, this.cCalMeal, this.pCalMeal});
{this.pCal,
this.cCal,
this.fCal,
this.pCalGram,
this.cCalGram,
this.fCalGram,
this.fCalMeal,
this.cCalMeal,
this.pCalMeal});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
@ -43,135 +41,96 @@ class CarbsResult extends StatelessWidget {
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Padding( Container(
padding: EdgeInsets.symmetric(vertical: 30.0, horizontal: 10.0), decoration: containerRadius(Colors.white, 12),
child: Table( padding: EdgeInsets.all(12),
border: TableBorder( margin: EdgeInsets.all(20),
verticalInside: BorderSide(width: 1, color: Colors.black54), child: Column(
bottom: BorderSide(width: 1, color: Colors.black54), crossAxisAlignment: CrossAxisAlignment.start,
left: BorderSide(width: 1, color: Colors.black54),
right: BorderSide(width: 1, color: Colors.black54),
top: BorderSide(width: 1, color: Colors.black54),
),
children: [ children: [
TableRow( Text(
decoration: BoxDecoration( TranslationBase.of(context).carbsProtin,
color: Colors.white, style: TextStyle(
), fontSize: 19,
children: [ fontWeight: FontWeight.bold,
TableCell( letterSpacing: -1.34,
child: Center(
child: Texts('Description'),
),
),
TableCell(
child: Center(
child: Texts('Protein'),
),
),
TableCell(
child: Center(
child: Texts(
'Carbohydrate',
),
),
),
TableCell(
child: Center(
child: Texts('Fat'),
),
),
]),
TableRow(children: [
Padding(
padding: EdgeInsets.all(8.0),
child: TableCell(
child: Center(
child: Texts('Calories\n Per Day'),
),
),
),
TableCell(
child: Center(
child: Texts(pCal.ceil().toString() + ' Cals'),
),
),
TableCell(
child: Center(
child: Texts(cCal.ceil().toString() + ' Cals'),
),
),
TableCell(
child: Center(
child: Texts(fCal.ceil().toString() + ' Cals'),
),
),
]),
TableRow(children: [
Padding(
padding: EdgeInsets.all(8.0),
child: TableCell(
child: Center(
child: Texts('Grams Per\n Day'),
),
),
),
TableCell(
child: Center(
child: Texts(pCalGram.ceil().toString() + ' gr'),
),
),
TableCell(
child: Center(
child: Texts(cCalGram.ceil().toString() + ' gr'),
),
), ),
TableCell( ),
child: Center( mHeight(12),
child: Texts(fCalGram.ceil().toString() + ' gr'), Table(
), columnWidths: {
), 0: FlexColumnWidth(2.4),
]), 1: FlexColumnWidth(1.8),
TableRow(children: [ 2: FlexColumnWidth(2),
Padding( 3: FlexColumnWidth(1),
padding: EdgeInsets.all(8.0), },
child: TableCell( children: fullData(context, projectViewModel),
child: Center( ),
child: Texts('Grams Per\n Meal'),
),
),
),
TableCell(
child: Center(
child: Texts(pCalMeal.ceil().toString() + ' gr'),
),
),
TableCell(
child: Center(
child: Texts(cCalMeal.ceil().toString() + ' gr'),
),
),
TableCell(
child: Center(
child: Texts(fCalMeal.ceil().toString() + ' gr'),
),
),
]),
], ],
), ),
), ),
Container( Container(
width: 350, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
child: Button( color: Colors.white,
label: TranslationBase.of(context).viewDocList, child: SecondaryButton(
label: TranslationBase.of(context).seeListOfDoctor,
color: CustomColors.accentColor,
onTap: () { onTap: () {
getDoctorsList(context); getDoctorsList(context);
}, },
), ),
), ),
],
),
);
}
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
children: [
Utils.tableColumnTitle(TranslationBase.of(context).description),
Utils.tableColumnTitle(TranslationBase.of(context).Protein),
Utils.tableColumnTitle(TranslationBase.of(context).carbohydrate),
Utils.tableColumnTitle(TranslationBase.of(context).fat),
],
),
);
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue(TranslationBase.of(context).calDay, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(pCal.ceil().toString() + ' '+TranslationBase.of(context).Cals, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCal.ceil().toString() + ' '+TranslationBase.of(context).Cals, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCal.ceil().toString() + ' '+TranslationBase.of(context).Cals, isCapitable: false, mProjectViewModel: projectViewModel),
],
),
);
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue(TranslationBase.of(context).gramsPerDay, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(pCalGram.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCalGram.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(fCalGram.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
], ],
), ),
); );
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue(TranslationBase.of(context).gramsPerMeal, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(pCalMeal.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCalMeal.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(fCalMeal.ceil().toString() + ' '+TranslationBase.of(context).gr, isCapitable: false, mProjectViewModel: projectViewModel),
],
),
);
return tableRow;
} }
getDoctorsList(BuildContext context) { getDoctorsList(BuildContext context) {
@ -208,7 +167,7 @@ class CarbsResult extends StatelessWidget {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where( .where(
(elementClinic) => elementClinic.filterName == element.projectName, (elementClinic) => elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
@ -226,5 +185,4 @@ class CarbsResult extends StatelessWidget {
print(err); print(err);
}); });
} }
} }

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -44,103 +46,114 @@ class _DeliveryDueState extends State<DeliveryDue> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).pregnancyTitle, appBarTitle: TranslationBase.of(context).pregnancyTitle,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 35.0, vertical: 20.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
child: Column( child: Container(
children: [ padding: EdgeInsets.symmetric(horizontal: 21.0, vertical: 21.0),
Texts( child: Column(
TranslationBase.of(context).pregnancyDesc,
),
Divider(
//height: 2,
thickness: 2,
),
Column(
children: [ children: [
Texts( Text(
TranslationBase.of(context).pregnancyDateLabel, TranslationBase.of(context).pregnancyDesc,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
),
), ),
InkWell( Divider(
onTap: () { //height: 2,
DatePicker.showDatePicker( thickness: 1,
context, ),
showTitleActions: true, Column(
minTime: DateTime(DateTime.now().year - 1, 1, 1), children: [
maxTime: DateTime.now(), Text(
onConfirm: (date) { TranslationBase.of(context).pregnancyDateLabel,
print('confirm $date'); style: TextStyle(
setState(() { fontSize: 14,
bloodSugarDate = date; fontWeight: FontWeight.w600,
dateFrom = date.add(Duration(days: 10)); ),
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
print('confirm $date');
setState(() {
bloodSugarDate = date;
dateFrom = date.add(Duration(days: 10));
dateTo = date.add(Duration(days: 20)); dateTo = date.add(Duration(days: 20));
conceivedDate = date.add(Duration(days: 14)); conceivedDate = date.add(Duration(days: 14));
deliveryDue = date.add(Duration(days: 280)); deliveryDue = date.add(Duration(days: 280));
firstTrimester = date.add(Duration(days: 85)); firstTrimester = date.add(Duration(days: 85));
secondTrimester = date.add(Duration(days: 190)); secondTrimester = date.add(Duration(days: 190));
thirdTrimester = date.add(Duration(days: 280)); thirdTrimester = date.add(Duration(days: 280));
}); });
},
currentTime: DateTime.now(),
);
}, },
currentTime: DateTime.now(), child: Container(
); padding: EdgeInsets.all(12),
}, margin: EdgeInsets.only(top: 15.0),
child: Container( width: double.infinity,
padding: EdgeInsets.all(12), height: 65,
margin: EdgeInsets.only(top: 15.0), decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
width: double.infinity, child: Row(
height: 65, mainAxisAlignment: MainAxisAlignment.spaceBetween,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [ children: [
Icon(Icons.date_range), Row(
Texts(TranslationBase.of(context).date), children: [
Icon(Icons.date_range),
Texts(TranslationBase.of(context).date),
],
),
Texts(getDate()),
], ],
), ),
Texts(getDate()), ),
],
), ),
), ],
), ),
], ],
), ),
SizedBox( ),
height: 280.0, ),
), ),
Container( Container(
height: 50.0, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
width: 350.0, color: Colors.white,
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).calculate, label: TranslationBase.of(context).calculate,
() { color: CustomColors.accentColor,
setState(() { onTap: () {
{ setState(() {
Navigator.push( {
context, Navigator.push(
FadePage( context,
page: DeliveryDueResult( FadePage(
conceivedDate: conceivedDate, page: DeliveryDueResult(
dateFrom: dateFrom, conceivedDate: conceivedDate,
dateTo: dateTo, dateFrom: dateFrom,
deliveryDue: deliveryDue, dateTo: dateTo,
firstTrimester: firstTrimester, deliveryDue: deliveryDue,
secondTrimester: secondTrimester, firstTrimester: firstTrimester,
thirdTrimester: thirdTrimester, secondTrimester: secondTrimester,
)), thirdTrimester: thirdTrimester,
); )),
} );
}); }
}, });
), },
),
],
), ),
), ),
), ],
), ),
); );
} }

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -29,78 +32,102 @@ class DeliveryDueResult extends StatelessWidget {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).pregnancyTitle, appBarTitle: TranslationBase.of(context).pregnancyTitle,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 12.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
height: 750.0, child: Container(
child: Column( padding: EdgeInsets.symmetric(horizontal: 21.0, vertical: 21.0),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Texts( children: [
TranslationBase.of(context).ovulationPeriod, Text(
fontWeight: FontWeight.w400, TranslationBase.of(context).pregnancyTitle,
), style: TextStyle(
Texts( fontSize: 19,
TranslationBase.of(context).from, letterSpacing: -1.14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w600,
), ),
Texts(DateFormat.yMMMEd().format(dateFrom), fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), ),
Texts( Text(
TranslationBase.of(context).to, TranslationBase.of(context).ovulationPeriod,
fontWeight: FontWeight.w400, style: TextStyle(
), fontSize: 14,
Texts(DateFormat.yMMMEd().format(dateTo), fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), letterSpacing: -0.56,
Texts( fontWeight: FontWeight.w600,
TranslationBase.of(context).conceive, color: CustomColors.textColor,
fontWeight: FontWeight.w400, ),
), ),
Texts( mHeight(20),
DateFormat.yMMMEd().format(conceivedDate), showItem(TranslationBase.of(context).from, DateFormat.yMMMEd().format(dateFrom), titleColor: CustomColors.accentColor),
fontWeight: FontWeight.w800, mHeight(12),
fontSize: 21.0, showItem(TranslationBase.of(context).to, DateFormat.yMMMEd().format(dateTo), titleColor: CustomColors.accentColor),
), mHeight(12),
Texts( mDivider(CustomColors.devider),
TranslationBase.of(context).firstTri, mHeight(12),
fontWeight: FontWeight.w400, showItem(TranslationBase.of(context).conceive, DateFormat.yMMMEd().format(conceivedDate)),
), mHeight(12),
Texts( mDivider(CustomColors.devider),
DateFormat.yMMMEd().format(firstTrimester), mHeight(12),
fontWeight: FontWeight.w800, showItem(TranslationBase.of(context).firstTri, DateFormat.yMMMEd().format(firstTrimester)),
fontSize: 21.0, mHeight(12),
), mDivider(CustomColors.devider),
Texts( mHeight(12),
TranslationBase.of(context).secondTri, showItem(TranslationBase.of(context).secondTri, DateFormat.yMMMEd().format(secondTrimester)),
fontWeight: FontWeight.w400, mHeight(12),
), mDivider(CustomColors.devider),
Texts( mHeight(12),
DateFormat.yMMMEd().format(secondTrimester), showItem(TranslationBase.of(context).thirdTri, DateFormat.yMMMEd().format(thirdTrimester)),
fontWeight: FontWeight.w800, mHeight(12),
fontSize: 21.0, mDivider(CustomColors.devider),
), mHeight(12),
Texts( ],
TranslationBase.of(context).thirdTri, ).withBorderedContainer,
fontWeight: FontWeight.w400, ),
),
Texts(
DateFormat.yMMMEd().format(thirdTrimester),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Container(
width: 350,
child: DefaultButton(
TranslationBase.of(context).seeDoctorsList,
() {
getDoctorsList(context);
},
),
),
],
), ),
), ),
), Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).seeDoctorsList,
color: CustomColors.accentColor,
onTap: () {
getDoctorsList(context);
},
),
),
],
),
);
}
Widget showItem(String title, String value, {Color titleColor}) {
return Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
color: titleColor ?? Colors.black,
fontWeight: FontWeight.w500,
// fontWeight: FontWeight.w600,
),
),
Text(
value,
style: TextStyle(
fontSize: 18,
letterSpacing: -1.08,
fontWeight: FontWeight.w600,
),
),
],
), ),
); );
} }
@ -145,20 +172,11 @@ class DeliveryDueResult extends StatelessWidget {
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }
}); });
Navigator.push( Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
doctorsList: doctorsList,
patientDoctorAppointmentListHospital:
_patientDoctorAppointmentListHospital)));
} }
} }
}).catchError((err) { }).catchError((err) {
@ -167,3 +185,19 @@ class DeliveryDueResult extends StatelessWidget {
}); });
} }
} }
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
}

@ -1,10 +1,11 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'ideal_body_result_page.dart'; import 'ideal_body_result_page.dart';
@ -24,69 +25,44 @@ class _IdealBodyState extends State<IdealBody> {
Color lbCard = inactiveCardColor; Color lbCard = inactiveCardColor;
Color cmCard = activeCardColor; Color cmCard = activeCardColor;
Color ftCard = inactiveCardColor; Color ftCard = inactiveCardColor;
int age = 0;
int height = 0; // int age = 0;
// int height = 0;
double heightInches; double heightInches;
double minRange; double minRange;
double maxRange; double maxRange;
double overWeightBy; double overWeightBy;
int weight = 0; int weight = 0;
double idealWeight = 0; double idealWeight = 0;
String dropdownValue = 'Medium(fingers touch)'; String dropdownValue = null;
double calories = 0; double calories = 0;
String textResult = ''; String textResult = '';
double maxIdealWeight; double maxIdealWeight;
double heightFeet; double heightFeet;
void updateColorHeight(int type) { final GlobalKey clinicDropdownKey = GlobalKey();
//MG/DLT card bool _isHeightCM = true;
if (type == 1) { bool _isWeightKG = true;
if (cmCard == inactiveCardColor) { double _heightValue = 0;
cmCard = activeCardColor; double _weightValue = 0;
ftCard = inactiveCardColor;
} else { TextEditingController _heightController = new TextEditingController();
cmCard = inactiveCardColor; TextEditingController _weightController = TextEditingController();
}
} List<PopupMenuItem> _heightPopupList = List();
if (type == 2) { List<PopupMenuItem> _weightPopupList = List();
if (ftCard == inactiveCardColor) {
ftCard = activeCardColor;
cmCard = inactiveCardColor;
} else {
ftCard = inactiveCardColor;
}
}
}
void updateColorWeight(int type) {
//MG/DLT card
if (type == 1) {
if (kgCard == inactiveCardColor) {
kgCard = activeCardColor;
lbCard = inactiveCardColor;
} else {
kgCard = inactiveCardColor;
}
}
if (type == 2) {
if (lbCard == inactiveCardColor) {
lbCard = activeCardColor;
kgCard = inactiveCardColor;
} else {
lbCard = inactiveCardColor;
}
}
}
void calculateIdealWeight() { void calculateIdealWeight() {
heightInches = height * .39370078740157477; heightInches = int.parse(_heightController.text) * .39370078740157477;
heightFeet = heightInches / 12; heightFeet = heightInches / 12;
idealWeight = (50 + 2.3 * (heightInches - 60)); idealWeight = (50 + 2.3 * (heightInches - 60));
if (dropdownValue == 'Small(fingers overlap)') { if (dropdownValue == TranslationBase.of(context).smallFinger) {
idealWeight = idealWeight - 10; idealWeight = idealWeight - 10;
} else if (dropdownValue == 'Medium(fingers touch)') { } else if (dropdownValue == TranslationBase.of(context).mediumFinger) {
idealWeight = idealWeight; idealWeight = idealWeight;
} else if (dropdownValue == 'Large(fingers don\'n touch)') { } else if (dropdownValue == TranslationBase.of(context).largeFinger) {
idealWeight = idealWeight + 10; idealWeight = idealWeight + 10;
} }
@ -99,6 +75,11 @@ class _IdealBodyState extends State<IdealBody> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if(dropdownValue==null)
dropdownValue=TranslationBase.of(context).mediumFinger;
_weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)];
_heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)];
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
@ -115,458 +96,418 @@ class _IdealBodyState extends State<IdealBody> {
), ),
) )
], ],
body: Padding( body: Column(
padding: EdgeInsets.symmetric(vertical: 15.0, horizontal: 25.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
height: 800.0, child: Container(
child: Column( padding: EdgeInsets.all(21),
children: [ child: Column(
Padding(
padding: EdgeInsets.all(10.0),
child: Texts(
'Calculates the ideal body weight based on height, Weight, and Body Size',
),
),
Divider(
thickness: 2.0,
),
SizedBox(
height: 5.0,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
'Height', TranslationBase.of(context).idealBodyWeight,
), style: TextStyle(
Row( fontSize: 14,
children: [ fontWeight: FontWeight.w600,
Expanded( letterSpacing: -0.56,
child: Container( color: CustomColors.textColor,
width: 340.0, ),
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
),
child: Row(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
foregroundDecoration: BoxDecoration(
borderRadius:
BorderRadius.circular(5.0),
border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(height.toString()),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (height < 250)
height++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (height > 0) height--;
});
},
),
],
),
),
],
),
),
),
),
Expanded(
child: Slider(
value: height.toDouble(),
min: 0,
max: 250,
onChanged: (double newValue) {
setState(() {
height = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
),
),
],
), ),
Texts('Select Unit'),
SizedBox( SizedBox(
height: 5.0, height: 5.0,
), ),
Row( Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
GestureDetector( SizedBox(
onTap: () { height: 12.0,
setState(() { ),
updateColorHeight(1); _commonInputAndUnitRow(
isHeightCm = true; TranslationBase.of(context).height,
}); _heightController,
1,
270,
_heightValue,
(text) {
_heightController.text = text;
}, },
child: Container( (value) {
height: 55.0, _heightValue = value;
width: 150.0, },
decoration: BoxDecoration( _isHeightCM ? TranslationBase.of(context).cm : TranslationBase.of(context).ft,
boxShadow: [ (value) {
BoxShadow( if (_isHeightCM != value) {
color: Colors.grey.withOpacity(0.5), setState(() {
spreadRadius: 3, _isHeightCM = value;
blurRadius: 7, });
offset: Offset( }
0, 3), // changes position of shadow },
), _heightPopupList,
],
color: cmCard,
borderRadius: BorderRadius.circular(3.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('CM')),
),
),
), ),
GestureDetector( SizedBox(
onTap: () { height: 12.0,
setState(() { ),
updateColorHeight(2); _commonInputAndUnitRow(
isHeightCm = false; TranslationBase.of(context).weight,
}); _weightController,
1,
270,
_weightValue,
(text) {
_weightController.text = text;
}, },
child: Container( (value) {
height: 55.0, _weightValue = value;
width: 150.0, },
decoration: BoxDecoration( _isWeightKG ? TranslationBase.of(context).kg : TranslationBase.of(context).pound,
color: ftCard, (value) {
borderRadius: BorderRadius.circular(3.0), if (_isWeightKG != value) {
boxShadow: [ setState(() {
BoxShadow( _isWeightKG = value;
color: Colors.grey.withOpacity(0.5), });
spreadRadius: 3, }
blurRadius: 7, },
offset: Offset( _weightPopupList,
0, 3), // changes position of shadow
),
],
),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('Ft')),
),
),
), ),
], SizedBox(
), height: 12.0,
SizedBox( ),
height: 45.0, InkWell(
), onTap: () {
Divider( // dropdownKey.currentState;
thickness: 2.0, openDropdown(clinicDropdownKey);
), },
Texts(
'Weight',
),
SizedBox(
height: 5.0,
),
Row(
children: [
Expanded(
child: Container( child: Container(
width: 340.0, // width: double.infinity,
height: 60.0, // decoration: containerRadius(Colors.white, 12),
decoration: BoxDecoration( // padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
color: Colors.white,
),
child: Row( child: Row(
children: [ children: [
Padding( Flexible(
padding: EdgeInsets.symmetric( child: Column(
vertical: 10.0, horizontal: 8.0), crossAxisAlignment: CrossAxisAlignment.start,
child: Center( children: [
child: Container( Text(
width: 60.0, TranslationBase.of(context).bodyFrameSize,
foregroundDecoration: BoxDecoration( style: TextStyle(
borderRadius: fontSize: 11,
BorderRadius.circular(5.0), letterSpacing: -0.44,
border: Border.all( fontWeight: FontWeight.w600,
color: Colors.blueGrey,
width: 2.0,
), ),
), ),
child: Row( Container(
children: <Widget>[ height: 18,
Expanded( child: DropdownButtonHideUnderline(
child: Center( child: DropdownButton<String>(
child: Text(weight.toString()), value: dropdownValue,
), icon: Icon(Icons.arrow_downward), key: clinicDropdownKey,
), iconSize: 0,
Container( elevation: 16,
height: 38.0, isExpanded: true,
child: Column( style: TextStyle(color: Colors.black87),
crossAxisAlignment: underline: Container(
CrossAxisAlignment.center, height: 2,
mainAxisAlignment: color: Colors.black54,
MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (weight < 250)
weight++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (weight > 0) weight--;
});
},
),
],
), ),
onChanged: (String newValue) {
setState(() {
dropdownValue = newValue;
});
},
items: <String>[
TranslationBase.of(context).smallFinger,
TranslationBase.of(context).mediumFinger,
TranslationBase.of(context).largeFinger,
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
), ),
], ),
), ),
), ],
),
),
Expanded(
child: Slider(
value: weight.toDouble(),
min: 0,
max: 250,
onChanged: (double newValue) {
setState(() {
weight = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
), ),
), ),
Icon(Icons.keyboard_arrow_down),
], ],
), ),
), ).withBorderedContainer,
),
],
),
Texts('Select Unit'),
SizedBox(
height: 5.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColorWeight(1);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
],
color: kgCard,
borderRadius: BorderRadius.circular(3.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('KG')),
),
),
),
GestureDetector(
onTap: () {
setState(() {
updateColorWeight(2);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
color: lbCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
],
),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('LB')),
),
),
), ),
], ],
), ),
SizedBox( ],
height: 45.0, ),
), ),
Divider( ),
thickness: 2.0, ),
Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).calculate,
color: CustomColors.accentColor,
onTap: () {
setState(() {
// calculateBmr();
// calculateCalories();
calculateIdealWeight();
print(idealWeight);
print(minRange);
print(maxRange);
print(overWeightBy);
print(textResult);
//print(overWeightBy);
{
Navigator.push(
context,
FadePage(
page: IdealBodyResult(
idealBodyWeight: idealWeight,
minRange: minRange,
mixRange: maxRange,
overWeightBy: overWeightBy,
textResult: textResult,
)),
);
}
});
},
),
),
],
),
);
}
void openDropdown(GlobalKey key) {
GestureDetector detector;
void searchForGestureDetector(BuildContext element) {
element.visitChildElements((element) {
if (element.widget != null && element.widget is GestureDetector) {
detector = element.widget;
return false;
} else {
searchForGestureDetector(element);
}
return true;
});
}
searchForGestureDetector(key.currentContext);
assert(detector != null);
detector.onTap();
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
), ),
SizedBox( ),
height: 5.0, TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
controller: _controller,
onChanged: (value) => {},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
), ),
Texts('Body Frame Size'), decoration: InputDecoration(
Container( isDense: true,
width: 300, hintText: _hintText,
child: DropdownButton<String>( hintStyle: TextStyle(
value: dropdownValue, fontSize: 14,
icon: Icon(Icons.arrow_downward), height: 21 / 14,
iconSize: 24, fontWeight: FontWeight.w400,
elevation: 16, color: Color(0xff575757),
style: TextStyle(color: Colors.black87), letterSpacing: -0.56,
underline: Container(
height: 2,
color: Colors.black54,
),
onChanged: (String newValue) {
setState(() {
dropdownValue = newValue;
});
},
items: <String>[
'Small(fingers overlap)',
'Medium(fingers touch)',
'Large(fingers don\'n touch)',
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
), ),
prefixIconConstraints: BoxConstraints(minWidth: 50),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
), ),
SizedBox( ),
height: 30.0, ],
), ),
Container( ),
height: 50.0, if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
width: 350.0, ],
child: SecondaryButton( ),
label: 'CALCULATE', ),
onTap: () { );
setState(() { }
// calculateBmr();
// calculateCalories();
calculateIdealWeight();
print(idealWeight); Widget _commonInputAndUnitRow(_title, _controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange, String unitTitle,
//print(overWeightBy); Function(bool) onUnitTap, _list) {
{ return Row(
Navigator.push( children: [
context, Expanded(
FadePage( flex: 3,
page: IdealBodyResult( child: Column(
idealBodyWeight: idealWeight, mainAxisSize: MainAxisSize.min,
minRange: minRange, crossAxisAlignment: CrossAxisAlignment.start,
mixRange: maxRange, children: [
overWeightBy: overWeightBy, Text(
textResult: textResult, _title,
)), style: TextStyle(
); fontSize: 12,
} fontWeight: FontWeight.w600,
}); color: Color(0xff2E303A),
}, letterSpacing: -0.44,
),
),
],
), ),
], ),
), TextField(
controller: _controller,
keyboardType: TextInputType.number,
onChanged: (value) {
double _value = double.parse(value);
if (_value > _maxValue) {
onTextValueChange(_maxValue.toStringAsFixed(0));
onValueChange(_maxValue);
return;
} else if (_value < _minValue) {
onTextValueChange(_minValue.toStringAsFixed(0));
onValueChange(_minValue);
return;
} else if (_value >= _minValue && _value <= _maxValue) {
onValueChange(_value);
return;
}
},
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
],
style: TextStyle(
color: Color(0xff575757),
letterSpacing: -0.56,
),
decoration: InputDecoration(
isDense: true,
hintText: "0",
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
), ),
), ),
Container(height: 34, width: 1, color: Color(0xffE0E0E0), margin: EdgeInsets.only(left: 12, right: 12)),
Expanded(
flex: 1,
child: PopupMenuButton(
child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null),
onSelected: (value) {
onUnitTap(value);
},
itemBuilder: (context) => _list),
)
],
).withBorderedContainer;
}
}
// todo 'sikander' move these to separate file once usability known
class CommonDropDownView extends StatelessWidget {
final String title;
final String value;
final VoidCallback callback;
final IconData iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key key, this.iconData}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: callback,
child: Row(
children: [
Expanded(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(
title,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.44,
),
),
Text(
value,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
),
]),
),
Icon(
iconData ?? Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A),
)
],
), ),
); );
} }
} }

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -28,139 +31,170 @@ class IdealBodyResult extends StatelessWidget {
appBarTitle: TranslationBase.of(context).idealBody, appBarTitle: TranslationBase.of(context).idealBody,
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(
'Ideal weight range is', Padding(
fontSize: 23.0, padding: const EdgeInsets.all(20.0),
), child: Column(
Row( crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
children: [ Text(
Row( TranslationBase.of(context).idealWeightRange,
children: [ style: TextStyle(
Texts( fontSize: 19,
minRange.toStringAsFixed(1), letterSpacing: -1.34,
fontSize: 30.0, fontWeight: FontWeight.bold,
),
Padding(
padding: EdgeInsets.only(top: 8.0, left: 4.0),
child: Text(
'Kg',
style: TextStyle(color: Colors.red),
),
),
],
),
Icon(
Icons.arrow_forward,
color: Colors.red,
size: 55.0,
),
Row(
children: [
Texts(
mixRange.toStringAsFixed(1),
fontSize: 30.0,
),
Padding(
padding: EdgeInsets.only(top: 8.0, left: 4.0),
child: Text(
'Kg',
style: TextStyle(color: Colors.red),
),
), ),
], ),
), mHeight(12),
], Row(
), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
overWeightBy >= 0 && overWeightBy <= 10
? Column(
children: [ children: [
Texts( Row(
'Congratulations! The current weight is\n perfect and considered healthy', children: [
fontSize: 20.0, Texts(
minRange.toStringAsFixed(1),
fontSize: 30.0,
),
Padding(
padding: EdgeInsets.only(top: 8.0, left: 4.0),
child: Text(
" "+TranslationBase.of(context).kg+" ",
style: TextStyle(color: Colors.red),
),
),
],
), ),
], Icon(
) Icons.arrow_forward,
: overWeightBy > 10 && overWeightBy < 17 color: Colors.red,
? Column( size: 55.0,
),
Row(
children: [ children: [
Texts('This means that the weight is a little bit more than ideal weight by'), Texts(
Texts(overWeightBy.toStringAsFixed(1)), mixRange.toStringAsFixed(1),
Texts('May wish to consult with the doctor for medical help. Click to view our list of Doctors'), fontSize: 30.0,
),
Padding(
padding: EdgeInsets.only(top: 8.0, left: 4.0),
child: Text(
" "+TranslationBase.of(context).kg+" ",
style: TextStyle(color: Colors.red),
),
),
], ],
) ),
: overWeightBy >= 18 ],
? Container( ),
height: 250.0, mHeight(12),
width: 350, overWeightBy >= 0 && overWeightBy <= 10
child: Column( ? Column(
children: [
Texts(
TranslationBase.of(context).currentWeightPerfect,
fontSize: 20.0,
),
],
)
: overWeightBy > 10 && overWeightBy < 17
? Column(
children: [ children: [
Texts( Texts(TranslationBase.of(context).littleBitWeightMore),
'Means that you suffer from excessive\n obesity by', Texts(overWeightBy.toStringAsFixed(1)),
), Texts(TranslationBase.of(context).consultWithDoctor),
SizedBox(
height: 55.0,
),
Texts(
overWeightBy.toStringAsFixed(1),
fontSize: 40.0,
),
SizedBox(
height: 25.0,
),
Texts('May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'),
], ],
), )
) : overWeightBy >= 18
: overWeightBy < -18 ? Container(
? Column(
crossAxisAlignment: CrossAxisAlignment.center, child: Column(
children: [ children: [
Padding( Texts(
padding: const EdgeInsets.all(8.0), TranslationBase.of(context).excessiveObesity,
child: Texts( ),
'Under Weight', SizedBox(
fontSize: 18.0, height: 12.0,
), ),
), Text(
SizedBox( overWeightBy.toStringAsFixed(1),
height: 55.0, style: TextStyle(
), fontSize: 17,
Texts( fontWeight: FontWeight.bold,
overWeightBy.toStringAsFixed(1), letterSpacing: -1.34,
fontSize: 20.0, ),
),
SizedBox(
height: 12.0,
),
Texts(TranslationBase.of(context).mayWish),
],
), ),
], )
) : overWeightBy < -18
: Container( ? Column(
height: 250.0, crossAxisAlignment: CrossAxisAlignment.center,
width: 350.0, children: [
child: Column( Padding(
children: [ padding: const EdgeInsets.all(8.0),
Texts( child: Texts(
'under wheight', TranslationBase.of(context).underWeight,
fontSize: 20.0, fontSize: 18.0,
), ),
SizedBox( ),
height: 55.0, SizedBox(
), height: 12.0,
Texts( ),
overWeightBy.toStringAsFixed(1), Text(
fontSize: 20.0, overWeightBy.toStringAsFixed(1),
), style: TextStyle(
SizedBox( fontSize: 17,
height: 25.0, fontWeight: FontWeight.bold,
letterSpacing: -1.34,
),
),
],
)
: Container(
child: Column(
children: [
Text(
TranslationBase.of(context).underWeight,
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.bold,
letterSpacing: -1.34,
),
),
SizedBox(
height: 12.0,
),
Text(
overWeightBy.toStringAsFixed(1),
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.bold,
letterSpacing: -1.34,
),
),
SizedBox(
height: 12.0,
),
Texts(TranslationBase.of(context).mayWish),
],
),
), ),
Texts('May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'), ],
], ).withBorderedContainer,
), ),
),
Container( Container(
width: 350, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
child: Button( color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).viewDocList, label: TranslationBase.of(context).viewDocList,
color: CustomColors.accentColor,
onTap: () { onTap: () {
getDoctorsList(context); getDoctorsList(context);
}, },
@ -224,3 +258,19 @@ class IdealBodyResult extends StatelessWidget {
}); });
} }
} }
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
}

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -20,8 +22,9 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
DateTime selectedDateTime = DateTime.now(); DateTime selectedDateTime = DateTime.now();
int cycleLength = 0;
int lutealPhaseLength = 0; // int cycleLength = 0;
// int lutealPhaseLength = 0;
String selectedDate; String selectedDate;
var dateFrom = DateTime.now(); var dateFrom = DateTime.now();
var babyAgeWeeks; var babyAgeWeeks;
@ -33,6 +36,9 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
var newFormat = DateFormat("yy-MM-dd"); var newFormat = DateFormat("yy-MM-dd");
String updatedDt; String updatedDt;
TextEditingController cycleLengthController = new TextEditingController();
TextEditingController lutelLengthController = new TextEditingController();
String getTime() { String getTime() {
return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; return " ${timeSugarDate.hour}:${timeSugarDate.minute}";
} }
@ -64,286 +70,176 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).ovulation, appBarTitle: TranslationBase.of(context).ovulation,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
height: 700.0, child: Container(
child: Column( padding: EdgeInsets.all(21),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Texts(TranslationBase.of(context).ovulationDesc),
SizedBox(
height: 12.0,
),
Divider(
//height: 2,
thickness: 2,
),
SizedBox(
height: 12.0,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
print('confirm $date');
setState(() {
selectedDateTime = date;
});
},
currentTime: DateTime.now(),
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
),
),
),
SizedBox(
height: 5.0,
),
Texts(
TranslationBase.of(context).cycleLabel,
fontWeight: FontWeight.w400,
),
SizedBox(
height: 5.0,
),
Row(
children: [ children: [
Container( Text(
width: 340.0, TranslationBase.of(context).ovulationDesc,
height: 60.0, style: TextStyle(
decoration: BoxDecoration( fontSize: 14,
color: Colors.white, letterSpacing: -0.54,
color: Colors.black,
fontWeight: FontWeight.w600,
), ),
child: Row( ),
children: [ SizedBox(
Padding( height: 12.0,
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), ),
child: Center( InkWell(
child: Container( onTap: () {
width: 60.0, DatePicker.showDatePicker(
foregroundDecoration: BoxDecoration( context,
borderRadius: BorderRadius.circular(5.0), showTitleActions: true,
border: Border.all( minTime: DateTime(DateTime.now().year - 1, 1, 1),
color: Colors.blueGrey, maxTime: DateTime.now(),
width: 2.0, onConfirm: (date) {
), print('confirm $date');
), setState(() {
child: Row( selectedDateTime = date;
children: <Widget>[ });
Expanded( },
child: Center( currentTime: DateTime.now(),
child: Text(cycleLength.toString()), );
), },
), child: Container(
Container( padding: EdgeInsets.all(12),
height: 38.0, width: double.infinity,
child: Column( height: 65,
crossAxisAlignment: CrossAxisAlignment.center, decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
mainAxisAlignment: MainAxisAlignment.center, child: Row(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Container( children: [
decoration: BoxDecoration( Texts(TranslationBase.of(context).date),
border: Border( Texts(getDate()),
bottom: BorderSide( ],
width: 0.5, ),
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (cycleLength < 45) cycleLength++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (cycleLength > 0) cycleLength--;
});
},
),
],
),
),
],
),
),
),
),
Expanded(
child: Slider(
value: cycleLength.toDouble(),
min: 0,
max: 45,
onChanged: (double newValue) {
setState(() {
cycleLength = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
), ),
), ),
SizedBox(
height: 12.0,
),
inputWidget(TranslationBase.of(context).cycleLabel, "0", cycleLengthController),
SizedBox(
height: 12.0,
),
inputWidget(TranslationBase.of(context).lutealLabel, "0", lutelLengthController),
], ],
), ),
Texts( ),
TranslationBase.of(context).lutealLabel, ),
fontWeight: FontWeight.w400, ),
), Container(
SizedBox( margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
height: 5.0, color: Colors.white,
), child: SecondaryButton(
Row( label: TranslationBase.of(context).calculate,
children: [ color: CustomColors.accentColor,
Container( onTap: () {
width: 340.0, calculateBabyInformation();
height: 60.0, Navigator.push(
decoration: BoxDecoration( context,
color: Colors.white, FadePage(
page: OvulationResult(
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
babyAge: babyAgeWeeks,
babyAgeDays: babyAgeDays,
),
),
);
},
),
),
],
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
controller: _controller,
onChanged: (value) => {},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
), ),
child: Row( prefixIconConstraints: BoxConstraints(minWidth: 50),
children: [ prefixIcon: prefix == null
Padding( ? null
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), : Text(
child: Center( "+" + prefix,
child: Container( style: TextStyle(
width: 60.0, fontSize: 14,
foregroundDecoration: BoxDecoration( height: 21 / 14,
borderRadius: BorderRadius.circular(5.0), fontWeight: FontWeight.w500,
border: Border.all( color: Color(0xff2E303A),
color: Colors.blueGrey, letterSpacing: -0.56,
width: 2.0,
),
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(lutealPhaseLength.toString()),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (lutealPhaseLength < 15) lutealPhaseLength++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (lutealPhaseLength > 0) lutealPhaseLength--;
});
},
),
],
),
),
],
),
), ),
), ),
), contentPadding: EdgeInsets.zero,
Expanded( border: InputBorder.none,
child: Slider( focusedBorder: InputBorder.none,
value: lutealPhaseLength.toDouble(), enabledBorder: InputBorder.none,
min: 0,
max: 15,
onChanged: (double newValue) {
setState(() {
lutealPhaseLength = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
), ),
],
),
SizedBox(
height: 220.0,
),
Container(
height: 50.0,
width: 350.0,
child: DefaultButton(
TranslationBase.of(context).calculate,
() {
calculateBabyInformation();
Navigator.push(
context,
FadePage(
page: OvulationResult(
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
babyAge: babyAgeWeeks,
babyAgeDays: babyAgeDays,
)),
);
},
), ),
), ],
], ),
), ),
), if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
), ),
), ),
); );

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -26,6 +29,7 @@ class OvulationResult extends StatelessWidget {
this.babyAge, this.babyAge,
this.babyAgeDays, this.babyAgeDays,
}); });
//var newFormat = DateFormat("yy-MM-dd"); //var newFormat = DateFormat("yy-MM-dd");
@override @override
@ -35,81 +39,105 @@ class OvulationResult extends StatelessWidget {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).ovulation, appBarTitle: TranslationBase.of(context).ovulation,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
height: 750.0, child: Padding(
child: Column( padding: const EdgeInsets.all(21),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
'The next ovulation period is estimated to be:', TranslationBase.of(context).ovulation,
fontWeight: FontWeight.w400, style: TextStyle(
), fontSize: 19,
Texts( letterSpacing: -1.14,
'From:', fontWeight: FontWeight.w600,
fontWeight: FontWeight.w400, ),
), ),
Texts( mHeight(20),
DateFormat.yMMMEd().format(dateFrom), Text(
fontWeight: FontWeight.w800, TranslationBase.of(context).ovulationPeriod,
fontSize: 21.0, style: TextStyle(
), fontSize: 14,
Texts( letterSpacing: -0.56,
'To:', fontWeight: FontWeight.w600,
fontWeight: FontWeight.w400, color: CustomColors.textColor,
), ),
Texts( ),
DateFormat.yMMMEd().format(dateTo), mHeight(20),
fontWeight: FontWeight.w800, showItem(TranslationBase.of(context).from, DateFormat.yMMMEd().format(dateFrom), titleColor: CustomColors.accentColor),
fontSize: 21.0, mHeight(12),
), showItem(TranslationBase.of(context).to, DateFormat.yMMMEd().format(dateTo), titleColor: CustomColors.accentColor),
Texts( mHeight(12),
'Useful Information:', mDivider(CustomColors.devider),
color: Color(0xffC5272D), mHeight(12),
), Text(
Texts( TranslationBase.of(context).useFullInfo,
'You have conceived on:', style: TextStyle(
fontWeight: FontWeight.w400, fontSize: 14,
), letterSpacing: -0.56,
Texts( color: CustomColors.accentColor,
DateFormat.yMMMEd().format(conceivedDate), fontWeight: FontWeight.w500,
fontWeight: FontWeight.w800, ),
fontSize: 21.0, ),
), mHeight(12),
Texts( showItem(TranslationBase.of(context).conceive, DateFormat.yMMMEd().format(conceivedDate)),
'The baby\'s age right now:', mHeight(12),
fontWeight: FontWeight.w400, mDivider(CustomColors.devider),
), mHeight(12),
Texts( showItem(TranslationBase.of(context).babyAge, babyAge <= 0 ? TranslationBase.of(context).babyAgeAvail : babyAge.toString() + TranslationBase.of(context).week),
babyAge <= 0 ? "baby age is not available" : babyAge.toString() + " Weeks",
fontWeight: FontWeight.w800, mHeight(12),
fontSize: 21.0, mDivider(CustomColors.devider),
), mHeight(12), showItem(TranslationBase.of(context).deliveryDue, DateFormat.yMMMEd().format(deliveryDue)),
Texts( ],
'The delivery due date is estimated to be on the: ', ).withBorderedContainer,
fontWeight: FontWeight.w400, ),
),
Texts(
DateFormat.yMMMEd().format(deliveryDue),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Container(
width: 350,
child: DefaultButton(
TranslationBase.of(context).seeDoctorsList,
() {
getDoctorsList(context);
},
),
),
],
), ),
), ),
), Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).viewDocList,
color: CustomColors.accentColor,
onTap: () {
getDoctorsList(context);
},
),
),
],
),
);
}
Widget showItem(String title, String value, {Color titleColor}) {
return Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
color: titleColor ?? Colors.black,
fontWeight: FontWeight.w500,
// fontWeight: FontWeight.w600,
),
),
Text(
value,
style: TextStyle(
fontSize: 18,
letterSpacing: -1.08,
fontWeight: FontWeight.w600,
),
),
],
), ),
); );
} }
@ -148,26 +176,17 @@ class OvulationResult extends StatelessWidget {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where( .where(
(elementClinic) => elementClinic.filterName == element.projectName, (elementClinic) => elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }
}); });
Navigator.push( Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
doctorsList: doctorsList,
patientDoctorAppointmentListHospital:
_patientDoctorAppointmentListHospital)));
} }
} }
}).catchError((err) { }).catchError((err) {
@ -175,5 +194,20 @@ class OvulationResult extends StatelessWidget {
print(err); print(err);
}); });
} }
}
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
} }

@ -109,11 +109,11 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
), ),
), ),
Container( Container(
margin: EdgeInsets.all(20.0), // margin: EdgeInsets.all(20.0),
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(left: 12, right: 12), padding: EdgeInsets.only(left: 12, right: 12, top: 20.0),
child: GridView.builder( child: GridView.builder(
shrinkWrap: true, shrinkWrap: true,
primary: false, primary: false,
@ -147,9 +147,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
), ),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).bmi, title: TranslationBase.of(context).bmi,
imagePath: 'assets/images/new-design/bmi_health_calculator.png', imagePath: 'bmi.svg',
subTitle: TranslationBase.of(context).calcHealth, subTitle: TranslationBase.of(context).calcHealth,
isPngImage: true,
), ),
)); ));
@ -160,9 +160,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
), ),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).calories, title: TranslationBase.of(context).calories,
imagePath: 'assets/images/new-design/calories-calculator.png', imagePath: 'calories_calc.svg',
subTitle: TranslationBase.of(context).calcHealth, subTitle: TranslationBase.of(context).calcHealth,
isPngImage: true,
), ),
)); ));
@ -173,9 +173,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
), ),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).bmr, title: TranslationBase.of(context).bmr,
imagePath: 'assets/images/new-design/BMR_calculator.png', imagePath: 'bmr_calc.svg',
subTitle: TranslationBase.of(context).calcHealth, subTitle: TranslationBase.of(context).calcHealth,
isPngImage: true,
), ),
)); ));
@ -186,9 +186,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
), ),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).idealBody, title: TranslationBase.of(context).idealBody,
imagePath: 'assets/images/new-design/body_weight.png', imagePath: 'ideal_weight_calc.svg',
subTitle: TranslationBase.of(context).weight, subTitle: TranslationBase.of(context).weight,
isPngImage: true,
), ),
)); ));
@ -199,9 +199,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
), ),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).bodyWord, title: TranslationBase.of(context).bodyWord,
imagePath: 'assets/images/new-design/body_fat.png', imagePath: 'bmr_calc.svg',
subTitle: TranslationBase.of(context).fat, subTitle: TranslationBase.of(context).fat,
isPngImage: true,
), ),
)); ));
@ -212,9 +212,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
), ),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).carbohydrate, title: TranslationBase.of(context).carbohydrate,
imagePath: 'assets/images/new-design/carb_protein.png', imagePath: 'carbs_proteitn_fat.svg',
subTitle: TranslationBase.of(context).proteinFat, subTitle: TranslationBase.of(context).proteinFat,
isPngImage: true,
), ),
)); ));
@ -231,9 +231,8 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
), ),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).ovulation, title: TranslationBase.of(context).ovulation,
imagePath: 'assets/images/new-design/ovulation_period_icon.png', imagePath: 'ovulation.svg',
subTitle: TranslationBase.of(context).period, subTitle: TranslationBase.of(context).period,
isPngImage: true,
), ),
)); ));
@ -244,9 +243,8 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
), ),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).delivery, title: TranslationBase.of(context).delivery,
imagePath: 'assets/images/new-design/delivery_date_icon.png', imagePath: 'delivery.svg',
subTitle: TranslationBase.of(context).dueDate, subTitle: TranslationBase.of(context).dueDate,
isPngImage: true,
), ),
)); ));

@ -2,12 +2,8 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -34,28 +30,20 @@ class BloodDonationPage extends StatefulWidget {
} }
class _BloodDonationPageState extends State<BloodDonationPage> { class _BloodDonationPageState extends State<BloodDonationPage> {
TextEditingController _fileTextController = TextEditingController();
TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON; BeneficiaryType beneficiaryType = BeneficiaryType.NON;
// Gender gender = Gender.Male; //Gender.NON;
// Blood blood = Blood.Aminus; //Blood.NON;
//HospitalsModel _selectedHospital;
CitiesModel _selectedHospital; CitiesModel _selectedHospital;
int _selectedHospitalIndex = 0; int _selectedHospitalIndex = 0;
int _selectedGenderIndex = 1; int _selectedGenderIndex = 1;
int _selectedBloodTypeIndex = 0; int _selectedBloodTypeIndex = 0;
String _selectedBloodType = "O+";
String amount = ""; String amount = "";
String email; String email;
PatientInfo _selectedPatientInfo;
AuthenticatedUser authenticatedUser;
GetAllSharedRecordsByStatusList selectedPatientFamily;
AdvanceModel advanceModel = AdvanceModel();
List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-"); List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-");
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
var checkedValue = false; var checkedValue = false;
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
@ -66,21 +54,17 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
imagesInfo.add( imagesInfo.add(
ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'), ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'),
); );
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {});
if (projectProvider.isLogin) authUser = projectProvider.user;
});
super.initState(); super.initState();
} }
int getSelectedCityID(MyBalanceViewModel model) { int getSelectedCityID(MyBalanceViewModel model) {
int cityID = 1; int cityID = 1;
model.CitiesModelList.forEach((element) { model.CitiesModelList.forEach((element) {
if (element.description == model.bloodModelList[0].city) { if (element.description == model.bloodModelList[0].city) {
cityID = element.iD; cityID = element.iD;
} }
}); });
return cityID; return cityID;
} }
@ -89,22 +73,42 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) { onModelReady: (model) => model.getCities().then((value) {
model.getCities().then((value) { model.getBlood().then((value) {
model.getBlood().then((value) { if (model.bloodModelList.length > 0) {
if (model.bloodModelList.length > 0) { CitiesModel citiesModel = new CitiesModel();
CitiesModel citiesModel = new CitiesModel(); citiesModel.iD = getSelectedCityID(model);
citiesModel.iD = getSelectedCityID(model); _selectedHospitalIndex = (citiesModel.iD - 1);
_selectedHospitalIndex = (citiesModel.iD - 1); citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description;
citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description; citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN;
citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN; _selectedHospital = citiesModel;
_selectedHospital = citiesModel; _selectedBloodType = model.bloodModelList[0].bloodGroup;
} else { _selectedBloodTypeIndex = getBloodIndex(_selectedBloodType);
_selectedHospital = model.CitiesModelList[0]; } else {
} _selectedHospital = model.CitiesModelList[0];
}); }
}); });
}, }),
// {
// if (projectProvider.isLogin && projectProvider.user != null) {
// model.getCities().then((value) {
// model.getBlood().then((value) {
// if (model.bloodModelList.length > 0) {
// CitiesModel citiesModel = new CitiesModel();
// citiesModel.iD = getSelectedCityID(model);
// _selectedHospitalIndex = (citiesModel.iD - 1);
// citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description;
// citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN;
// _selectedHospital = citiesModel;
// _selectedBloodType = model.bloodModelList[0].bloodGroup;
// _selectedBloodTypeIndex = getBloodIndex(_selectedBloodType);
// } else {
// _selectedHospital = model.CitiesModelList[0];
// }
// });
// });
// }
// },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
@ -177,7 +181,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
); );
}).withBorderedContainer, }).withBorderedContainer,
SizedBox(height: 12), SizedBox(height: 12),
CommonDropDownView(TranslationBase.of(context).bloodType, model.bloodModelList.isNotEmpty ? model.bloodModelList[0].bloodGroup : getBlood(_selectedBloodTypeIndex), () { CommonDropDownView(TranslationBase.of(context).bloodType, _selectedBloodType, () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel("O+", 0), RadioSelectionDialogModel("O+", 0),
RadioSelectionDialogModel("O-", 1), RadioSelectionDialogModel("O-", 1),
@ -197,6 +201,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
isScrollable: true, isScrollable: true,
onValueSelected: (index) { onValueSelected: (index) {
_selectedBloodTypeIndex = index; _selectedBloodTypeIndex = index;
_selectedBloodType = getBlood(index);
setState(() {}); setState(() {});
}, },
), ),
@ -330,6 +335,41 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
} }
} }
int getBloodIndex(String type) {
switch (type) {
case "O+":
return 0;
break;
case "O-":
return 1;
break;
case "AB+":
return 2;
break;
case "AB-":
return 3;
break;
case "A+":
return 4;
break;
case "A-":
return 5;
break;
case "B-":
return 6;
break;
case "B-":
return 7;
break;
case "B+":
return 8;
break;
default:
return 0;
}
}
String getHospitalName(ProjectViewModel projectProvider, BuildContext context) { String getHospitalName(ProjectViewModel projectProvider, BuildContext context) {
if (_selectedHospital != null) if (_selectedHospital != null)
return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;

@ -47,6 +47,8 @@ class BookConfirm extends StatefulWidget {
class _BookConfirmState extends State<BookConfirm> { class _BookConfirmState extends State<BookConfirm> {
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
AppSharedPreferences sharedPref = new AppSharedPreferences();
@override @override
void initState() { void initState() {
widget.authUser = new AuthenticatedUser(); widget.authUser = new AuthenticatedUser();
@ -86,6 +88,7 @@ class _BookConfirmState extends State<BookConfirm> {
null, null,
widget.doctor.noOfPatientsRate, widget.doctor.noOfPatientsRate,
"", "",
), ),
isNeedToShowButton: false, isNeedToShowButton: false,
), ),
@ -195,8 +198,8 @@ class _BookConfirmState extends State<BookConfirm> {
elevation: 0, elevation: 0,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
onPressed: () { onPressed: () async {
if (!widget.isLiveCareAppointment) { if (!await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor); insertAppointment(context, widget.doctor);
} else { } else {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
@ -244,8 +247,8 @@ class _BookConfirmState extends State<BookConfirm> {
service.cancelAppointment(appo, context).then((res) { service.cancelAppointment(appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () { Future.delayed(new Duration(milliseconds: 1500), () async {
if (!widget.isLiveCareAppointment) { if (!await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor); insertAppointment(context, widget.doctor);
} else { } else {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
@ -441,6 +444,7 @@ class _BookConfirmState extends State<BookConfirm> {
Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async { Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.sharedPref.remove(IS_LIVECARE_APPOINTMENT);
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(

@ -50,7 +50,7 @@ class _DentalComplaintsState extends State<DentalComplaints> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: "Symptoms", appBarTitle: TranslationBase.of(context).chiefComplaints,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
@ -77,13 +77,15 @@ class _DentalComplaintsState extends State<DentalComplaints> {
: Container( : Container(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0),
child: Text(TranslationBase.of(context).dentalProcedureList, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold, letterSpacing: 0.5)), child: Text(TranslationBase.of(context).dentalProcedureList, style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, letterSpacing: -0.46)),
), ),
Container( Container(
margin: EdgeInsets.only(top: 20.0), decoration: cardRadius(10),
margin: EdgeInsets.all(12.0),
child: Table( child: Table(
children: getProceduresData(), children: getProceduresData(),
), ),
@ -148,17 +150,14 @@ class _DentalComplaintsState extends State<DentalComplaints> {
children: [ children: [
Container( Container(
child: Container( child: Container(
child: Center( margin: EdgeInsets.all(12.0),
child: Text(TranslationBase.of(context).procedureName, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)), child: Text(TranslationBase.of(context).procedureName, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
),
), ),
), ),
Container( Container(
child: Container( child: Container(
margin: EdgeInsets.only(bottom: 10.0), margin: EdgeInsets.all(12.0),
child: Center( child: Text(TranslationBase.of(context).timeNeeded, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
child: Text(TranslationBase.of(context).timeNeeded, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)),
),
), ),
), ),
], ],
@ -167,18 +166,12 @@ class _DentalComplaintsState extends State<DentalComplaints> {
dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) { dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) {
tableRow.add(TableRow(children: [ tableRow.add(TableRow(children: [
Container( Container(
child: Container( margin: EdgeInsets.all(12.0),
child: Center( child: Text(procedure.procedureName, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
child: Text(procedure.procedureName, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontSize: 14.0)),
),
),
), ),
Container( Container(
child: Container( margin: EdgeInsets.all(12.0),
child: Center( child: Text(procedure.neededTime.toString() + " " + TranslationBase.of(context).minute, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
child: Text(procedure.neededTime.toString() + " mins", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontSize: 14.0)),
),
),
), ),
])); ]));
}); });
@ -186,19 +179,12 @@ class _DentalComplaintsState extends State<DentalComplaints> {
TableRow( TableRow(
children: [ children: [
Container( Container(
child: Container( margin: EdgeInsets.all(12.0),
child: Center( child: Text(TranslationBase.of(context).totalTimeNeeded, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
child: Text(TranslationBase.of(context).totalTimeNeeded, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)),
),
),
), ),
Container( Container(
child: Container( margin: EdgeInsets.all(12.0),
margin: EdgeInsets.only(bottom: 10.0), child: Text(totalAppointmentTime.toString() + " " + TranslationBase.of(context).minute, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
child: Center(
child: Text(totalAppointmentTime.toString() + " mins", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)),
),
),
), ),
], ],
), ),

@ -12,7 +12,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart';
import '../../../uitl/date_uitl.dart'; import '../../../uitl/date_uitl.dart';
@ -79,7 +78,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
getCurrentLanguage(); getCurrentLanguage();
if (widget.isLiveCareAppointment) if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT))
getDoctorScheduledFreeSlots(context, widget.doctor); getDoctorScheduledFreeSlots(context, widget.doctor);
else { else {
getDoctorFreeSlots(context, widget.doctor); getDoctorFreeSlots(context, widget.doctor);
@ -351,22 +350,27 @@ class MeetingDataSource extends CalendarDataSource {
DateTime getStartTime(int index) { DateTime getStartTime(int index) {
return _getMeetingData(index).from; return _getMeetingData(index).from;
} }
@override @override
DateTime getEndTime(int index) { DateTime getEndTime(int index) {
return _getMeetingData(index).to; return _getMeetingData(index).to;
} }
@override @override
String getSubject(int index) { String getSubject(int index) {
return _getMeetingData(index).eventName; return _getMeetingData(index).eventName;
} }
@override @override
Color getColor(int index) { Color getColor(int index) {
return _getMeetingData(index).background; return _getMeetingData(index).background;
} }
@override @override
bool isAllDay(int index) { bool isAllDay(int index) {
return _getMeetingData(index).isAllDay; return _getMeetingData(index).isAllDay;
} }
Meeting _getMeetingData(int index) { Meeting _getMeetingData(int index) {
final dynamic meeting = appointments[index]; final dynamic meeting = appointments[index];
Meeting meetingData; Meeting meetingData;

@ -342,7 +342,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Select Project", TranslationBase.of(context).selectHospital,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
letterSpacing: -0.44, letterSpacing: -0.44,
@ -354,7 +354,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
key: projectDropdownKey, key: projectDropdownKey,
hint: new Text("Select Project"), hint: new Text(TranslationBase.of(context).selectHospital),
value: projectDropdownValue, value: projectDropdownValue,
iconSize: 0, iconSize: 0,
isExpanded: true, isExpanded: true,

@ -78,7 +78,8 @@ class DoctorView extends StatelessWidget {
if (doctor.projectName != null) MyRichText(TranslationBase.of(context).branch, doctor.projectName, projectViewModel.isArabic), if (doctor.projectName != null) MyRichText(TranslationBase.of(context).branch, doctor.projectName, projectViewModel.isArabic),
if (doctor.speciality != null) if (doctor.speciality != null)
Text( Text(
getDoctorSpeciality(this.doctor.speciality).trim(), this.doctor.speciality[0].trim(),
// getDoctorSpeciality(this.doctor.speciality).trim(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
), ),
if (doctor.nearestFreeSlot != null) if (doctor.nearestFreeSlot != null)

@ -58,7 +58,6 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'));
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,

@ -55,51 +55,6 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// Container(
// height: 150.0,
// decoration: BoxDecoration(
// image: DecorationImage(
// image: AssetImage(
// "assets/images/new-design/covid-19-big-banner-bg.png"),
// fit: BoxFit.fill,
// ),
// color: Colors.white.withOpacity(0.3),
// borderRadius: BorderRadius.all(Radius.circular(10))),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Container(
// margin:
// EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
// child: SvgPicture.asset(
// 'assets/images/new-design/covid-19-car.svg',
// width: 90.0,
// height: 90.0),
// ),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Container(
// margin: EdgeInsets.only(
// left: 20.0, right: 20.0, top: 20.0),
// child: Text(TranslationBase.of(context).covidTest,
// style: TextStyle(
// color: Colors.white,
// fontWeight: FontWeight.bold,
// fontSize: 24.0)),
// ),
// Container(
// margin: EdgeInsets.only(
// left: 20.0, right: 20.0, top: 10.0),
// child: Text(TranslationBase.of(context).driveThru,
// style: TextStyle(
// color: Colors.white, fontSize: 24.0)),
// ),
// ],
// ),
// ],
// ),
// ),
Text(TranslationBase.of(context).covidSelectProcedure, style: TextStyle(color: Colors.black, fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold)), Text(TranslationBase.of(context).covidSelectProcedure, style: TextStyle(color: Colors.black, fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold)),
...List.generate( ...List.generate(
widget.proceduresList.length, widget.proceduresList.length,
@ -144,29 +99,6 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
// ListTile(
// title: Text(
// projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName,
// style: TextStyle(
// fontSize: 12.0,
// letterSpacing: -0.48,
// fontWeight: FontWeight.w600,
// ),
// ),
// leading: Radio(
// value: widget.proceduresList[index],
// groupValue: widget.selectedProcedure,
// activeColor: Colors.red[800],
// toggleable: true,
// onChanged: (value) {
// setState(() {
// widget.selectedProcedure = value;
// print(widget.selectedProcedure.procedureName);
// getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
// });
// },
// ),
// ),
], ],
), ),
), ),

@ -1,7 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart'; import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart';
import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
@ -17,7 +16,6 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -41,6 +39,7 @@ class _AddMember extends State<AddMember> {
var familyFileProvider = FamilyFilesProvider(); var familyFileProvider = FamilyFilesProvider();
var patientShareRequestID; var patientShareRequestID;
var patientShareResponseID;
@override @override
void initState() { void initState() {
@ -50,67 +49,71 @@ class _AddMember extends State<AddMember> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles, appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: isLoading == true body: isLoading == true
? AppCircularProgressIndicator() ? AppCircularProgressIndicator()
: SingleChildScrollView( : SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), padding: EdgeInsets.all(21.0),
height: SizeConfig.realScreenHeight * .9, height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[ child: Column(
Expanded( children: <Widget>[
flex: 2, Expanded(
child: AppText( flex: 1,
TranslationBase.of(context).enterNationalId, child: Text(
fontSize: SizeConfig.textMultiplier * 3.5, loginType == 1 ? TranslationBase.of(context).enterNationalId : TranslationBase.of(context).enterFile,
textAlign: TextAlign.left, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
)), )),
Expanded( Expanded(
flex: 4, flex: 4,
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
//MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
// Container(
// child: TextFields(
// controller: nationalIDorFile,
// onChanged: (value) => {validateForm()},
// prefixIcon: Icon(loginType == 1 ? Icons.chrome_reader_mode : Icons.receipt, color: Colors.red),
// padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
// hintText: loginType == 1 ? TranslationBase.of(context).nationalID : TranslationBase.of(context).fileNo,
// ))
SizedBox(
height: 12,
),
inputWidget(loginType == 1 ? TranslationBase.of(context).nationalIdNumber : TranslationBase.of(context).medicalFileNumber, "Xxxxxxxxx", nationalIDorFile),
],
),
),
Expanded(
flex: 3,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Row( PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
children: <Widget>[ SizedBox(
Expanded( height: 12,
child: DefaultButton(
TranslationBase.of(context).add,
() => {this.addMember()},
color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor,
textColor: Colors.white,
))
],
), ),
inputWidget(loginType == 1 ? TranslationBase.of(context).nationalIdNumber : TranslationBase.of(context).medicalFileNumber, "Xxxxxxxxx", nationalIDorFile),
], ],
)) ),
]), ),
))); // Expanded(
// flex: 3,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// Row(
// children: <Widget>[
// Expanded(
// child: DefaultButton(
// TranslationBase.of(context).add,
// () => {this.addMember()},
// color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor,
// textColor: Colors.white,
// ),
// )
// ],
// ),
// ],
// ),
// )
],
),
),
),
bottomSheet: Container(
color: Colors.white,
padding: EdgeInsets.all(21.0),
child: DefaultButton(
TranslationBase.of(context).add,
() => {this.addMember()},
color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor,
textColor: Colors.white,
)),
);
} }
void validateForm() { void validateForm() {
@ -158,28 +161,30 @@ class _AddMember extends State<AddMember> {
} }
insertFamilyData(addMemberResult) { insertFamilyData(addMemberResult) {
var request = InsertSharePatientFileReq(); sendActivationCode(addMemberResult);
request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID']; // var request = InsertSharePatientFileReq();
request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName']; // request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID'];
request.status = 2; // request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName'];
if (request.patientOutSA == 1) { // request.status = 2;
request.regionID = 2; // if (request.patientOutSA == 1) {
} else { // request.regionID = 2;
request.regionID = 1; // } else {
} // request.regionID = 1;
loading(true); // }
familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)); // loading(true);
// familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)).catchError((err) {
// loading(false);
// AppToast.showErrorToast(message: err);
// });
} }
sendActivationCode(result) { sendActivationCode(result) {
// var request = this.getCommonRequest(); // var request = this.getCommonRequest();
loading(true); loading(true);
patientShareRequestID = result['PatientShareRequestID']; patientShareResponseID = result['ShareFamilyFileObj']['ReponseID'];
familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text).then((result) => { familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text, patientShareResponseID).then((res) => {
if (result != null && result['isSMSSent'] == true) {this.startSMSService(1, result)} patientShareRequestID = res['PatientShareRequestID'],
// {loading(false), this.startSMSService(type)} if (res != null && res['isSMSSent'] == true) {this.startSMSService(1, res)}
// else
// {loading(false)}
}); });
} }
@ -204,7 +209,7 @@ class _AddMember extends State<AddMember> {
checkActivationCode(value, result) { checkActivationCode(value, result) {
Navigator.pop(context); Navigator.pop(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
familyFileProvider.checkActivationCode(result['LogInTokenID'], value, nationalIDorFile.text, mobileNo).then((result) { familyFileProvider.checkActivationCode(result['LogInTokenID'], value, nationalIDorFile.text, mobileNo, patientShareRequestID, patientShareResponseID).then((result) {
SMSOTP.hideSMSBox(context); SMSOTP.hideSMSBox(context);
handleFamilyRequests(this.patientShareRequestID, 3); handleFamilyRequests(this.patientShareRequestID, 3);
}).catchError((err) { }).catchError((err) {
@ -216,12 +221,12 @@ class _AddMember extends State<AddMember> {
} }
handleFamilyRequests(id, stauts) { handleFamilyRequests(id, stauts) {
familyFileProvider.acceptAndRejectRecievedRequests(id, stauts).then((result) => { // familyFileProvider.acceptAndRejectRecievedRequests(id, stauts).then((result) => {
sharedPref.remove(FAMILY_FILE), sharedPref.remove(FAMILY_FILE);
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
MY_FAMILIY, MY_FAMILIY,
) );
}); // });
} }
loading(flag) { loading(flag) {

@ -26,11 +26,11 @@ class AddFamilyMemberType extends StatelessWidget {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: [ children: [
SizedBox(height: 12), SizedBox(height: 21),
HabibLogoWidget(), HabibLogoWidget(),
SizedBox(height: 50), SizedBox(height: 21),
Text( Text(
TranslationBase.of(context).logintypeRadio, TranslationBase.of(context).registerInfoFamily,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
), ),
GridView( GridView(

@ -27,7 +27,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
@ -159,113 +158,115 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else else
return ListView.separated( return checkActive(snapshot.data.getAllSharedRecordsByStatusList) > 0
itemBuilder: (context, index) { ? ListView.separated(
if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3) itemBuilder: (context, index) {
return Container( if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3)
margin: EdgeInsets.all(5), return Container(
decoration: cardRadius( margin: EdgeInsets.all(5),
15, decoration: cardRadius(
elevation: 0, 15,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0xffFDA4B0) : Color(0xff6EA8FF), elevation: 0,
), color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0xffFDA4B0) : Color(0xff6EA8FF),
child: Container( ),
// height: 130,0xffFDA4B0 child: Container(
width: MediaQuery.of(context).size.width, // height: 130,0xffFDA4B0
padding: EdgeInsets.all(10), width: MediaQuery.of(context).size.width,
child: Row( padding: EdgeInsets.all(10),
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach,
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.white,
),
Texts(TranslationBase.of(context).fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(),
fontSize: 12, color: Colors.white),
Texts(
snapshot.data.getAllSharedRecordsByStatusList[index].age.toString() +
' ' +
TranslationBase.of(context).years +
', ' +
snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription,
fontSize: 12,
color: Colors.white),
],
),
Column(
children: [ children: [
SizedBox(height: 10), Column(
InkWell( crossAxisAlignment: CrossAxisAlignment.start,
onTap: () { children: <Widget>[
switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); Texts(
}, snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach,
child: Container( fontSize: 18,
decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)), fontWeight: FontWeight.bold,
padding: EdgeInsets.fromLTRB(15, 10, 15, 10), color: Colors.white,
child: Row( ),
mainAxisAlignment: MainAxisAlignment.center, Texts(TranslationBase.of(context).fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(),
children: [ fontSize: 12, color: Colors.white),
SvgPicture.asset("assets/images/new-design/switch.svg", Texts(
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white), snapshot.data.getAllSharedRecordsByStatusList[index].age.toString() +
SizedBox( ' ' +
width: 5, TranslationBase.of(context).years +
), ', ' +
// CupertinoSwitch( snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription,
// value: isSwitchUser, fontSize: 12,
// onChanged: (value) { color: Colors.white),
// setState(() { ],
// isSwitchUser = value; ),
// }); Column(
// if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); children: [
// }, SizedBox(height: 10),
// ), InkWell(
Texts(TranslationBase.of(context).switchUser, onTap: () {
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white, switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context);
fontSize: 12, },
fontWeight: FontWeight.w600) child: Container(
], decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
))), padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
SizedBox( child: Row(
height: 10, mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/images/new-design/switch.svg",
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white),
SizedBox(
width: 5,
),
// CupertinoSwitch(
// value: isSwitchUser,
// onChanged: (value) {
// setState(() {
// isSwitchUser = value;
// });
// if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context);
// },
// ),
Texts(TranslationBase.of(context).switchUser,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white,
fontSize: 12,
fontWeight: FontWeight.w600)
],
))),
SizedBox(
height: 10,
),
InkWell(
onTap: () {
deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context);
},
child: Container(
decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/images/new-design/delete.svg",
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white),
SizedBox(
width: 5,
),
Texts(TranslationBase.of(context).delete,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white,
fontSize: 12,
fontWeight: FontWeight.w600),
],
))),
SizedBox(height: 10),
],
), ),
InkWell(
onTap: () {
deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context);
},
child: Container(
decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/images/new-design/delete.svg",
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white),
SizedBox(
width: 5,
),
Texts(TranslationBase.of(context).delete,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white,
fontSize: 12,
fontWeight: FontWeight.w600),
],
))),
SizedBox(height: 10),
], ],
), )));
], // else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0)
))); // return getNoDataWidget(context);
else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0) else
return getNoDataWidget(context); return SizedBox(height: 0);
else },
return SizedBox(height: 0); separatorBuilder: (context, index) => SizedBox(height: 0),
}, itemCount: snapshot.data.getAllSharedRecordsByStatusList.length)
separatorBuilder: (context, index) => SizedBox(height: 0), : getNoDataWidget(context);
itemCount: snapshot.data.getAllSharedRecordsByStatusList.length);
} }
}, },
), ),
@ -290,176 +291,98 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
FractionallySizedBox( FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
child: AppExpandableNotifier( child: AppExpandableNotifier(
title: TranslationBase.of(context).userViewRequest, title: TranslationBase.of(context).userViewRequest,
bodyWidget: FutureBuilder( bodyWidget: FutureBuilder(
future: getUserViewRequest(), // async work future: getUserViewRequest(), // async work
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) { builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return SizedBox(); return SizedBox();
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else else
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) { itemBuilder: (context, _index) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(width: 1, color: Color(0xffEFEFEF)), border: Border.all(width: 1, color: Color(0xffEFEFEF)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color(0xff000000).withOpacity(.05), color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5, //spreadRadius: 5,
blurRadius: 27, blurRadius: 27,
offset: Offset(0, -3), offset: Offset(0, -3),
), ),
], ],
color: Colors.white), color: Colors.white),
child: Column( child: Column(
children: [ children: [
Column(children: [ Column(children: [
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row(children: [ child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)), Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)), Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)), Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
])), ])),
Padding( Padding(
padding: const EdgeInsets.only(left: 10.0, right: 10.0), padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: Divider(color: Colors.black, height: 1.5, thickness: 1.5), child: Divider(color: Colors.black, height: 1.5, thickness: 1.5),
), ),
Column( Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) { children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Container( return Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3, flex: 3,
child: Texts( child: Texts(
result.patientName, result.patientName,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
icon: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22), icon: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22),
onPressed: () { onPressed: () {
acceptRemoveRequest(result.iD, 3, context); acceptRemoveRequest(result.iD, 3, context);
}, },
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22), icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
acceptRemoveRequest(result.iD, 4, context); acceptRemoveRequest(result.iD, 4, context);
}, },
)) ))
], ],
)); ));
}).toList()) }).toList())
]) ])
], ],
)); ));
}, },
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: 1); itemCount: 1);
} }
}, },
))), ),
),
// RoundedContainer( ),
// child: ExpansionTile(
// title: Text(
// TranslationBase.of(context).userViewRequest,
// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
// ),
// children: <Widget>[
// FutureBuilder(
// future: getUserViewRequest(), // async work
// builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
// switch (snapshot.connectionState) {
// case ConnectionState.waiting:
// return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
// default:
// if (snapshot.hasError)
// return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
// else
// return Container(
// padding: EdgeInsets.all(15),
// child: Card(
// elevation: 3,
// shape: cardRadius(8),
// child: Column(
// children: [
// Column(children: [
// Padding(
// padding: EdgeInsets.all(10),
// child: Row(children: [
// Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
// ])),
// Divider(color: Colors.black, height: 1.5, thickness: 1.5),
// Column(
// children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
// return Container(
// padding: EdgeInsets.all(10),
// child: Row(
// children: <Widget>[
// Expanded(
// flex: 3,
// child: Texts(
// result.patientName,
// fontWeight: FontWeight.w600,
// fontSize: 12,
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.check_circle,
// color: Color(0xff349745),
// ),
// onPressed: () {
// acceptRemoveRequest(result.iD, 3, context);
// },
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.close,
// color: Colors.red[900],
// ),
// onPressed: () {
// acceptRemoveRequest(result.iD, 4, context);
// },
// ))
// ],
// ));
// }).toList())
// ])
// ],
// )));
// }
// })
// ],
// ),
// ),
SizedBox(height: 15), SizedBox(height: 15),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
@ -521,18 +444,21 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
fontSize: 12, fontSize: 12,
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: Card( child: Card(
// shape: cardRadius(10), // shape: cardRadius(10),
color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127), color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127),
child: Padding( child: Padding(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: AppText( child: AppText(
result.statusDescription, result.statusDescription != null ? result.statusDescription : "",
color: Colors.white, color: Colors.white,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 12, fontSize: 12,
)))), ),
),
),
),
], ],
)); ));
}).toList(), }).toList(),

@ -34,7 +34,6 @@ class NotificationsDetailsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
@ -59,44 +58,45 @@ class NotificationsDetailsPage extends StatelessWidget {
fontSize: 18.0, fontSize: 18.0,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600 fontWeight: FontWeight.w600
),
), ),
), ),
), ),
), SizedBox(
SizedBox( height: 15,
height: 15,
),
if (notification.messageTypeData.length != 0)
FractionallySizedBox(
widthFactor: 0.9,
child: Image.network(notification.messageTypeData,
loadingBuilder: (BuildContext context, Widget child,
ImageChunkEvent loadingProgress) {
if (loadingProgress == null) return child;
return Center(
child: SizedBox(
width: 40.0,
height: 40.0,
child: AppCircularProgressIndicator(),
),
);
},
fit: BoxFit
.fill) //Image.network(notification.messageTypeData),
), ),
SizedBox( if (notification.messageTypeData.length != 0)
height: 15, FractionallySizedBox(
), widthFactor: 0.9,
Row( child: Image.network(notification.messageTypeData,
children: [ loadingBuilder: (BuildContext context, Widget child,
Expanded( ImageChunkEvent loadingProgress) {
child: Center( if (loadingProgress == null) return child;
child: Text(notification.message), return Center(
child: SizedBox(
width: 40.0,
height: 40.0,
child: AppCircularProgressIndicator(),
),
);
},
fit: BoxFit
.fill) //Image.network(notification.messageTypeData),
),
SizedBox(
height: 15,
),
Row(
children: [
Expanded(
child: Center(
child: Text(notification.message),
),
), ),
), ],
], ),
), ],
], ),
), ),
), ),
), ),

@ -78,7 +78,7 @@ class _AmbulanceReqState extends State<AmbulanceReq> with SingleTickerProviderSt
), ),
Expanded( Expanded(
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[
AmbulanceRequestIndexPage( AmbulanceRequestIndexPage(

@ -1,13 +1,22 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/AmbulanceRequestOrdersModel.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'BillAmount.dart'; import 'BillAmount.dart';
import 'PickupLocation.dart'; import 'PickupLocation.dart';
@ -20,8 +29,7 @@ class AmbulanceRequestIndexPage extends StatefulWidget {
AmbulanceRequestIndexPage({Key key, this.amRequestViewModel}); AmbulanceRequestIndexPage({Key key, this.amRequestViewModel});
@override @override
_AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState();
_AmbulanceRequestIndexPageState();
} }
class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> { class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@ -33,12 +41,15 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
TransportationDetails transportationDetails = new TransportationDetails(); TransportationDetails transportationDetails = new TransportationDetails();
int status;
String _statusDisp;
Color _color;
_changeCurrentTab(int tab) { _changeCurrentTab(int tab) {
setState(() { setState(() {
currentIndex = tab; currentIndex = tab;
}); });
pageController.animateToPage(tab, pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
} }
@override @override
@ -50,79 +61,268 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
AmbulanceRequestOrdersModel order = widget.amRequestViewModel.pendingAmbulanceRequestOrder;
if(widget.amRequestViewModel.pendingAmbulanceRequestOrder != null) {
int status = order.statusId;
_statusDisp = order.statusText;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
} else if (status == 2) {
//processing
_color = Color(0xff2E303A);
} else if (status == 3) {
//completed
_color = Color(0xff359846);
} else if (status == 4 || status == 6 || status == 7) {
//cancel // Rejected
_color = Color(0xffD02127);
}
}
return AppScaffold( return AppScaffold(
body: widget.amRequestViewModel.pendingAmbulanceRequestOrder != null body: widget.amRequestViewModel.pendingAmbulanceRequestOrder != null && order != null
? SingleChildScrollView( ? SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Container(
margin: EdgeInsets.only(left: 18, right: 18), margin: EdgeInsets.all(21),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: _color,
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.all(
), Radius.circular(10.0),
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, boxShadow: [
children: [ BoxShadow(
OrderLogItem( color: Color(0xff000000).withOpacity(.05),
title: TranslationBase.of(context).reqId, blurRadius: 27,
value: widget.amRequestViewModel.pendingAmbulanceRequestOrder offset: Offset(0, -3),
.id
.toString(),
),
OrderLogItem(
title: TranslationBase.of(context).status,
value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.statusText,
),
OrderLogItem(
title: TranslationBase.of(context).pickupDate,
value: getDate(widget.amRequestViewModel.pendingAmbulanceRequestOrder.created),
),
OrderLogItem(
title: TranslationBase.of(context).pickupLocation,
value: widget.amRequestViewModel.pendingAmbulanceRequestOrder
.pickupLocation,
),
OrderLogItem(
title: TranslationBase.of(context).dropoffLocation,
value: widget.amRequestViewModel.pendingAmbulanceRequestOrder
.dropOffLocation,
), ),
OrderLogItem( ],
title: TranslationBase.of(context).transportMethod, ),
value: widget child: Container(
.amRequestViewModel.pendingAmbulanceRequestOrder.serviceText, margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
), ),
Container( ),
padding: EdgeInsets.all(10), child: Column(
width: double.maxFinite, crossAxisAlignment: CrossAxisAlignment.start,
margin: EdgeInsets.only(bottom: 4, left: 4, right: 4), children: [
decoration: BoxDecoration( Row(
borderRadius: BorderRadius.only( crossAxisAlignment: CrossAxisAlignment.start,
bottomRight: Radius.circular(12), children: [
bottomLeft: Radius.circular(12), Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_statusDisp,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${order.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).pickupDate + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).transportMethod + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
order.serviceText,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
),
),
],
),
SizedBox(
height: 20.0,
),
],
),
), ),
color: Colors.white), Column(
child: SecondaryButton( mainAxisAlignment: MainAxisAlignment.spaceBetween,
color: Colors.red[900], crossAxisAlignment: CrossAxisAlignment.end,
textColor: Colors.white, children: [
label: TranslationBase.of(context).cancel, SizedBox(height: 12),
onTap: () { if (order.statusId == 1 || order.statusId == 2)
widget.amRequestViewModel.updatePressOrder( InkWell(
presOrderID: widget.amRequestViewModel onTap: () {
.pendingAmbulanceRequestOrder.id); showConfirmMessage(widget.amRequestViewModel, order.iD, context);
}, },
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(10),
),
child: Text(
TranslationBase.of(context).cancel_nocaps,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
],
),
],
), ),
) Row(
], children: [
Container(
margin: projectViewModel.isArabic ? EdgeInsets.only(left: 10.0) : EdgeInsets.only(right: 10.0),
width: 8,
height: 8,
decoration: containerRadius(
CustomColors.textColor,
100,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).pickupLocation + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Text(
order.pickupLocation.trim().toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
],
),
],
),
Container(
height: 20.0,
width: 1.0,
color: CustomColors.grey2,
margin: const EdgeInsets.only(left: 3.0, right: 3.0),
),
Row(
children: [
Container(
margin: projectViewModel.isArabic ? EdgeInsets.only(left: 10.0) : EdgeInsets.only(right: 10.0),
width: 8,
height: 8,
decoration: containerRadius(
CustomColors.accentColor,
100,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).dropoffLocation + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Text(
order.dropOffLocation.trim().toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
],
),
],
),
],
),
), ),
), ),
// Container(
// margin: EdgeInsets.only(left: 18, right: 18),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(2),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// OrderLogItem(
// title: TranslationBase.of(context).reqId,
// value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.iD.toString(),
// ),
// OrderLogItem(
// title: TranslationBase.of(context).status,
// value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.statusText,
// ),
// OrderLogItem(
// title: TranslationBase.of(context).pickupDate,
// value: DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.amRequestViewModel.pendingAmbulanceRequestOrder.created)),
// ),
// OrderLogItem(
// title: TranslationBase.of(context).pickupLocation,
// value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.pickupLocation,
// ),
// OrderLogItem(
// title: TranslationBase.of(context).dropoffLocation,
// value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.dropOffLocation,
// ),
// OrderLogItem(
// title: TranslationBase.of(context).transportMethod,
// value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.serviceText,
// ),
// Container(
// padding: EdgeInsets.all(10),
// width: double.maxFinite,
// margin: EdgeInsets.only(bottom: 4, left: 4, right: 4),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.only(
// bottomRight: Radius.circular(12),
// bottomLeft: Radius.circular(12),
// ),
// color: Colors.white),
// child: SecondaryButton(
// color: Colors.red[900],
// textColor: Colors.white,
// label: TranslationBase.of(context).cancel,
// onTap: () {
// widget.amRequestViewModel.updatePressOrder(presOrderID: widget.amRequestViewModel.pendingAmbulanceRequestOrder.iD);
// },
// ),
// )
// ],
// ),
// ),
], ],
), ),
) )
: Column( : Column(
children: [ children: [
SizedBox( SizedBox(
@ -173,8 +373,25 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
); );
} }
String getDate(String date) { void showConfirmMessage(AmRequestViewModel model, int presOrderID, BuildContext context) {
return date.split("T")[0]; showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg,
onTap: () {
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
// GifLoaderDialogUtils.showMyDialog(context);
await model.updatePressOrder(presOrderID: presOrderID);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
// GifLoaderDialogUtils.hideDialog(context);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
// GifLoaderDialogUtils.hideDialog(context);
}
});
},
));
return;
} }
} }

@ -2,10 +2,9 @@ import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -45,269 +44,222 @@ class _BillAmountState extends State<BillAmount> {
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.only(left: 12, right: 12), margin: EdgeInsets.only(left: 12, right: 12, top: 12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).billAmount), Text(TranslationBase.of(context).billAmount, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Table( Container(
border: TableBorder.symmetric(inside: BorderSide(width: 1.0, color: Colors.grey[300]), outside: BorderSide(width: 1.0, color: Colors.grey[300])), decoration: cardRadius(12),
children: [ child: Padding(
TableRow( padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
height: MediaQuery.of(context).size.height * 0.09, width: double.infinity,
decoration: BoxDecoration( padding: EdgeInsets.only(top: 10, bottom: 3),
color: Colors.white, child: Row(
borderRadius: BorderRadius.only( children: [
topLeft: Radius.circular(10.0), Expanded(
), child: _getNormalText(TranslationBase.of(context).patientShareToDo),
), ),
child: Padding( Expanded(
padding: const EdgeInsets.all(8.0), child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.price}', isBold: true),
child: Texts( )
TranslationBase.of(context).patientShareB, ],
textAlign: TextAlign.start,
color: Colors.black,
fontSize: 15,
),
), ),
), ),
mDivider(Colors.grey[200]),
Container( Container(
height: MediaQuery.of(context).size.height * 0.09, width: double.infinity,
decoration: BoxDecoration( padding: EdgeInsets.only(top: 3, bottom: 3),
color: Colors.white, child: Row(
borderRadius: BorderRadius.only( children: [
topRight: Radius.circular(10.0), Expanded(
), child: _getNormalText(TranslationBase.of(context).patientTaxToDo),
), ),
child: Padding( Expanded(
padding: const EdgeInsets.all(8.0), child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceVAT}', isBold: true),
child: Texts( )
TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.price}', ],
color: Colors.black,
textAlign: TextAlign.start,
fontSize: 15,
),
), ),
), ),
], mDivider(Colors.grey[200]),
),
TableRow(
children: [
Container( Container(
color: Colors.white, width: double.infinity,
height: MediaQuery.of(context).size.height * 0.09, padding: EdgeInsets.only(top: 3, bottom: 3),
child: Padding( child: Row(
padding: const EdgeInsets.all(8.0), children: [
child: Texts( Expanded(
TranslationBase.of(context).patientShareTax, child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo),
color: Colors.black, ),
fontSize: 15, Expanded(
textAlign: TextAlign.start, child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}', isBold: true, isTotal: true),
), )
), ],
),
Container(
height: MediaQuery.of(context).size.height * 0.09,
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceVAT}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
), ),
), ),
], ],
), ),
TableRow( ),
children: [
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).patientShareTotal,
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
bold: true,
),
),
),
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
),
),
],
),
],
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Texts( Text(TranslationBase.of(context).selectAmbulate, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
TranslationBase.of(context).selectAmbulate,
bold: false,
),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Row( Row(
children: [ children: [
Expanded( InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.Wheelchair;
_ambulate = Ambulate.Wheelchair; });
}); },
}, child: Container(
child: Container( width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration( child: ListTile(
shape: BoxShape.rectangle, contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
borderRadius: BorderRadius.circular(8), title: Row(
border: Border.all(color: Colors.grey, width: 0.5), children: [
color: Colors.white, Radio(
), value: Ambulate.Wheelchair,
child: ListTile( groupValue: _ambulate,
title: Text(TranslationBase.of(context).wheelchair, style: TextStyle( onChanged: (value) {
fontSize: 14.0 setState(() {
)), _ambulate = value;
leading: Radio( });
value: Ambulate.Wheelchair, },
groupValue: _ambulate, ),
onChanged: (value) { Text(
setState(() { TranslationBase.of(context).wheelchair,
_ambulate = value; style: TextStyle(
}); fontSize: 12.0,
}, letterSpacing: -0.48,
), fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
), ),
Expanded( ],
child: InkWell( ),
onTap: () { Row(
setState(() { children: [
_ambulate = Ambulate.Walker; InkWell(
}); onTap: () {
}, setState(() {
child: Container( _ambulate = Ambulate.Walker;
decoration: BoxDecoration( });
shape: BoxShape.rectangle, },
borderRadius: BorderRadius.circular(8), child: Container(
border: Border.all(color: Colors.grey, width: 0.5), width: MediaQuery.of(context).size.width * 0.9,
color: Colors.white, child: ListTile(
), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
child: ListTile( title: Row(
title: Text(TranslationBase.of(context).walker, style: TextStyle( children: [
fontSize: 14.0 Radio(
)), value: Ambulate.Walker,
leading: Radio( groupValue: _ambulate,
value: Ambulate.Walker, onChanged: (value) {
groupValue: _ambulate, setState(() {
onChanged: (value) { _ambulate = value;
setState(() { });
_ambulate = value; },
}); ),
}, Text(
), TranslationBase.of(context).walker,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
), ),
], ],
), ),
SizedBox(
height: 5,
),
Row( Row(
children: [ children: [
Expanded( InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.Stretcher;
_ambulate = Ambulate.Stretcher; });
}); },
}, child: Container(
child: Container( width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration( child: ListTile(
shape: BoxShape.rectangle, contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
borderRadius: BorderRadius.circular(8), title: Row(
border: Border.all(color: Colors.grey, width: 0.5), children: [
color: Colors.white, Radio(
), value: Ambulate.Stretcher,
child: ListTile( groupValue: _ambulate,
title: Text(TranslationBase.of(context).stretcher, style: TextStyle( onChanged: (value) {
fontSize: 14.0 setState(() {
)), _ambulate = value;
leading: Radio( });
value: Ambulate.Stretcher, },
groupValue: _ambulate, ),
onChanged: (value) { Text(
setState(() { TranslationBase.of(context).stretcher,
_ambulate = value; style: TextStyle(
}); fontSize: 12.0,
}, letterSpacing: -0.48,
), fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
), ),
Expanded( ],
child: InkWell( ),
onTap: () { Row(
setState(() { children: [
_ambulate = Ambulate.None; InkWell(
}); onTap: () {
}, setState(() {
child: Container( _ambulate = Ambulate.None;
decoration: BoxDecoration( });
shape: BoxShape.rectangle, },
borderRadius: BorderRadius.circular(8), child: Container(
border: Border.all(color: Colors.grey, width: 0.5), width: MediaQuery.of(context).size.width * 0.9,
color: Colors.white, child: ListTile(
), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
child: ListTile( title: Row(
title: Text(TranslationBase.of(context).none, style: TextStyle( children: [
fontSize: 14.0 Radio(
)), value: Ambulate.None,
leading: Radio( groupValue: _ambulate,
value: Ambulate.None, onChanged: (value) {
groupValue: _ambulate, setState(() {
onChanged: (value) { _ambulate = value;
setState(() { });
_ambulate = value; },
}); ),
}, Text(
), TranslationBase.of(context).none,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
@ -317,14 +269,21 @@ class _BillAmountState extends State<BillAmount> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
NewTextFields( Container(
hintText: TranslationBase.of(context).notes, decoration: cardRadius(10),
initialValue: note, child: Padding(
onChanged: (value) { padding: EdgeInsets.all(8.0),
setState(() { child: TextField(
note = value; maxLines: 5,
}); decoration: InputDecoration.collapsed(
}, hintText: TranslationBase.of(context).notes, hintStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16)),
onChanged: (value) {
setState(() {
note = value;
});
},
),
),
), ),
SizedBox( SizedBox(
height: 100, height: 100,
@ -352,4 +311,20 @@ class _BillAmountState extends State<BillAmount> {
), ),
); );
} }
_getNormalText(text, {bool isBold = false, bool isTotal = false}) {
return Text(
text,
style: TextStyle(
fontSize: isBold
? isTotal
? 16
: 12
: 10,
letterSpacing: -0.5,
color: isBold ? Colors.black : Colors.grey[700],
fontWeight: FontWeight.w600,
),
);
}
} }

@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/Blood/dialogs/SelectHospitalDialog.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart';
import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -13,12 +12,12 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart';
@ -51,9 +50,7 @@ class _PickupLocationState extends State<PickupLocation> {
void initState() { void initState() {
super.initState(); super.initState();
_getCurrentLocation(); _getCurrentLocation();
setState(() { setState(() {});
});
} }
_getCurrentLocation() async { _getCurrentLocation() async {
@ -64,7 +61,6 @@ class _PickupLocationState extends State<PickupLocation> {
_longitude = 0; _longitude = 0;
_latitude = 0; _latitude = 0;
}); });
} }
@override @override
@ -75,7 +71,7 @@ class _PickupLocationState extends State<PickupLocation> {
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.only(left: 12, right: 12), margin: EdgeInsets.only(left: 12, right: 12, top: 12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -83,43 +79,66 @@ class _PickupLocationState extends State<PickupLocation> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).pickupLocation), Text(TranslationBase.of(context).pickupLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 15, height: 15,
), ),
InkWell( Container(
onTap: () { padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
Navigator.push( alignment: Alignment.center,
context, decoration: BoxDecoration(
FadePage( borderRadius: BorderRadius.circular(15),
page: PickupLocationFromMap( color: Colors.white,
latitude: _latitude??0, border: Border.all(
longitude: _longitude??0, color: Color(0xffefefef),
onPick: (value) { width: 1,
setState(() {
_result = value;
});
},
)),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
), ),
),
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: PickupLocationFromMap(
latitude: _latitude ?? 0,
longitude: _longitude ?? 0,
onPick: (value) {
setState(() {
_result = value;
});
},
)),
);
},
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: Texts(getSelectFromMapName(context))), Expanded(
Icon( child: Column(
FontAwesomeIcons.mapMarkerAlt, crossAxisAlignment: CrossAxisAlignment.start,
size: 24, children: [
color: Colors.black, Text(
) TranslationBase.of(context).selectMap,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getSelectFromMapName(context),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -127,7 +146,7 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).pickupSpot), Text(TranslationBase.of(context).pickupSpot, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -138,21 +157,27 @@ class _PickupLocationState extends State<PickupLocation> {
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).insideHome), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Checkbox( title: Row(
value: _isInsideHome, children: [
onChanged: (value) { Checkbox(
setState(() { value: _isInsideHome,
_isInsideHome = value; onChanged: (value) {
}); setState(() {
}, _isInsideHome = value;
});
},
),
Text(
TranslationBase.of(context).insideHome,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
@ -160,7 +185,7 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).haveAppo), Text(TranslationBase.of(context).haveAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -177,25 +202,31 @@ class _PickupLocationState extends State<PickupLocation> {
} }
}, },
child: Container( child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).yes), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: HaveAppointment.YES, children: [
groupValue: _haveAppointment, Radio(
onChanged: (value) { value: HaveAppointment.YES,
if (myAppointment == null) { groupValue: _haveAppointment,
getAppointment(); onChanged: (value) {
setState(() { if (myAppointment == null) {
_haveAppointment = value; getAppointment();
}); setState(() {
} _haveAppointment = value;
}, });
}
},
),
Text(
TranslationBase.of(context).yes,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
@ -210,23 +241,29 @@ class _PickupLocationState extends State<PickupLocation> {
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).no), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: HaveAppointment.NO, children: [
groupValue: _haveAppointment, Radio(
onChanged: (value) { value: HaveAppointment.NO,
setState(() { groupValue: _haveAppointment,
_haveAppointment = value; onChanged: (value) {
myAppointment = null; setState(() {
}); _haveAppointment = value;
}, myAppointment = null;
});
},
),
Text(
TranslationBase.of(context).no,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
@ -249,31 +286,54 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).dropoffLocation), Text(TranslationBase.of(context).dropoffLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
InkWell( Container(
onTap: () { padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals); alignment: Alignment.center,
}, decoration: BoxDecoration(
child: Container( borderRadius: BorderRadius.circular(12),
padding: EdgeInsets.all(12), color: Colors.white,
decoration: BoxDecoration( border: Border.all(
shape: BoxShape.rectangle, color: Color(0xffefefef),
borderRadius: BorderRadius.circular(8), width: 1,
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
), ),
),
child: InkWell(
onTap: () {
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals);
},
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName(TranslationBase.of(context).selectHospital)), Expanded(
Icon( child: Column(
Icons.arrow_drop_down, crossAxisAlignment: CrossAxisAlignment.start,
size: 24, children: [
color: Colors.black, Text(
) TranslationBase.of(context).selectHospital,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getHospitalName(""),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -284,26 +344,54 @@ class _PickupLocationState extends State<PickupLocation> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).pickupLocation), Text(TranslationBase.of(context).pickupLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 15, height: 15,
), ),
InkWell( Container(
onTap: () { padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals); alignment: Alignment.center,
}, decoration: BoxDecoration(
child: Container( borderRadius: BorderRadius.circular(12),
padding: EdgeInsets.all(12), color: Colors.white,
decoration: BoxDecoration( border: Border.all(
shape: BoxShape.rectangle, color: Color(0xffefefef),
borderRadius: BorderRadius.circular(8), width: 1,
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
), ),
),
child: InkWell(
onTap: () {
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals);
},
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectHospital,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getHospitalName(""),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon( Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
size: 24, size: 24,
@ -316,44 +404,67 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).dropoffLocation), Text(TranslationBase.of(context).dropoffLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
InkWell( Container(
onTap: () { padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
Navigator.push( alignment: Alignment.center,
context, decoration: BoxDecoration(
FadePage( borderRadius: BorderRadius.circular(12),
page: PickupLocationFromMap( color: Colors.white,
latitude: _latitude, border: Border.all(
longitude: _longitude, color: Color(0xffefefef),
onPick: (value) { width: 1,
setState(() {
_result = value;
});
},
),
),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
), ),
),
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
setState(() {
_result = value;
});
},
),
),
);
},
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: Texts(getSelectFromMapName(context))), Expanded(
Icon( child: Column(
FontAwesomeIcons.mapMarkerAlt, crossAxisAlignment: CrossAxisAlignment.start,
size: 24, children: [
color: Colors.black, Text(
) TranslationBase.of(context).selectMap,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getSelectFromMapName(context),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -411,7 +522,7 @@ class _PickupLocationState extends State<PickupLocation> {
widget.patientER_RC.transportationDetails.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); widget.patientER_RC.transportationDetails.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now());
widget.patientER_RC.transportationDetails.pickupLocationName = widget.patientER.direction == 0 ? _selectedHospital.name : _result.formattedAddress; widget.patientER_RC.transportationDetails.pickupLocationName = widget.patientER.direction == 0 ? _selectedHospital.name : _result.formattedAddress;
widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID; widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID;
widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID.toString(); widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID;
widget.patientER_RC.transportationDetails.requesterIsOutSA = false; widget.patientER_RC.transportationDetails.requesterIsOutSA = false;
// widget.patientER.lineItemNo = 0; // widget.patientER.lineItemNo = 0;
widget.patientER_RC.transportationDetails.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; widget.patientER_RC.transportationDetails.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber;
@ -442,16 +553,22 @@ class _PickupLocationState extends State<PickupLocation> {
); );
} }
int _selectedHospitalIndex = -1;
void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) { void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name + ' ${hospitals[i].distanceInKilometers} ' + TranslationBase.of(context).km, i),
];
showDialog( showDialog(
context: context, context: context,
child: SelectHospitalDialog( child: RadioSelectionDialog(
hospitals: hospitals, listData: list,
selectedHospital: _selectedHospital, selectedIndex: _selectedHospitalIndex,
onValueSelected: (value) { isScrollable: true,
setState(() { onValueSelected: (index) {
_selectedHospital = value; _selectedHospitalIndex = index;
}); _selectedHospital = hospitals[index];
setState(() {});
}, },
), ),
); );
@ -462,7 +579,7 @@ class _PickupLocationState extends State<PickupLocation> {
} }
String getSelectFromMapName(context) { String getSelectFromMapName(context) {
return _result != null ? _result.formattedAddress : TranslationBase.of(context).selectMap; return _result != null ? _result.formattedAddress : "";
} }
getAppointment() { getAppointment() {

@ -5,8 +5,8 @@ import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -71,56 +71,77 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).transportHeading), Text(TranslationBase.of(context).transportHeading, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
...List.generate( Container(
widget.amRequestViewModel.amRequestModeList.length, margin: EdgeInsets.only(top: 12),
(index) => InkWell( decoration: cardRadius(12),
onTap: () { child: Column(
setState(() { crossAxisAlignment: CrossAxisAlignment.start,
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList[index]; children: [
}); ...List.generate(
}, widget.amRequestViewModel.amRequestModeList.length,
child: Container( (index) => InkWell(
margin: EdgeInsets.all(5), onTap: () {
decoration: BoxDecoration( setState(() {
shape: BoxShape.rectangle, _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[index];
borderRadius: BorderRadius.circular(8), });
border: Border.all(color: Colors.grey, width: 0.5), },
color: Colors.white, child: Container(
), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
flex: 3, flex: 4,
child: ListTile( child: ListTile(
title: Texts(projectViewModel.isArabic ? widget.amRequestViewModel.amRequestModeList[index].textN : widget.amRequestViewModel.amRequestModeList[index].text), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: widget.amRequestViewModel.amRequestModeList[index], children: [
groupValue: _erTransportationMethod, Radio(
onChanged: (value) { value: widget.amRequestViewModel.amRequestModeList[index],
setState(() { groupValue: _erTransportationMethod,
_erTransportationMethod = value; onChanged: (value) {
}); setState(() {
}, _erTransportationMethod = value;
), });
},
),
Flexible(
child: Text(
projectViewModel.isArabic ? widget.amRequestViewModel.amRequestModeList[index].textN : widget.amRequestViewModel.amRequestModeList[index].text,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
),
],
),
),
),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context).sar + ' ${widget.amRequestViewModel.amRequestModeList[index].price}',
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
)
],
), ),
), ),
Expanded( ),
flex: 1,
child: Texts(TranslationBase.of(context).sar + ' ${widget.amRequestViewModel.amRequestModeList[index].price}'),
)
],
), ),
), ],
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).directionHeading), Text(TranslationBase.of(context).directionHeading, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 5,
),
Container( Container(
width: double.maxFinite, width: double.maxFinite,
child: Row( child: Row(
@ -136,22 +157,26 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
}, },
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).toHospital), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: Direction.ToHospital, children: [
groupValue: _direction, Radio(
onChanged: (value) { value: Direction.ToHospital,
setState(() { groupValue: _direction,
_direction = value; onChanged: (value) {
}); setState(() {
}, _direction = value;
});
},
),
Text(TranslationBase.of(context).toHospital,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
)),
],
), ),
), ),
), ),
@ -166,22 +191,26 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
}, },
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).fromHospital), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: Direction.FromHospital, children: [
groupValue: _direction, Radio(
onChanged: (value) { value: Direction.FromHospital,
setState(() { groupValue: _direction,
_direction = value; onChanged: (value) {
}); setState(() {
}, _direction = value;
});
},
),
Text(TranslationBase.of(context).fromHospital,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
)),
],
), ),
), ),
), ),
@ -197,7 +226,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts(TranslationBase.of(context).wayHeading), Text(TranslationBase.of(context).wayHeading, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -213,22 +242,26 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).oneDirec), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: Way.OneWay, children: [
groupValue: _way, Radio(
onChanged: (value) { value: Way.OneWay,
setState(() { groupValue: _way,
_way = value; onChanged: (value) {
}); setState(() {
}, _way = value;
});
},
),
Text(TranslationBase.of(context).oneDirec,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
)),
],
), ),
), ),
), ),
@ -242,22 +275,26 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).twoDirec), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: Way.TwoWays, children: [
groupValue: _way, Radio(
onChanged: (value) { value: Way.TwoWays,
setState(() { groupValue: _way,
_way = value; onChanged: (value) {
}); setState(() {
}, _way = value;
});
},
),
Text(TranslationBase.of(context).twoDirec,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
)),
],
), ),
), ),
), ),
@ -302,7 +339,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
widget.patientER_RC.transportationDetails.direction = _direction == Direction.ToHospital ? 1 : 0; widget.patientER_RC.transportationDetails.direction = _direction == Direction.ToHospital ? 1 : 0;
widget.patientER_RC.transportationDetails.tripType = _way == Way.TwoWays ? 0 : 1; widget.patientER_RC.transportationDetails.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER_RC.transportationDetails.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); widget.patientER_RC.transportationDetails.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER_RC.transportationDetails.transportationType = _erTransportationMethod.id.toString(); widget.patientER_RC.transportationDetails.transportationType = _erTransportationMethod.iD.toString();
widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod; widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod;
widget.patientER_RC.transportationDetails.pickupUrgency = 1; widget.patientER_RC.transportationDetails.pickupUrgency = 1;
// widget.patientER.orderServiceID = _orderService.getIdOrderService(); // widget.patientER.orderServiceID = _orderService.getIdOrderService();

@ -3,8 +3,8 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -31,91 +31,73 @@ class _SummaryState extends State<Summary> {
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(left: 12, right: 12), margin: EdgeInsets.only(left: 12, right: 12, top: 12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).RRTSummary), Text(TranslationBase.of(context).RRTSummary, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
decoration: BoxDecoration( // margin: EdgeInsets.only(top: 12),
color: Colors.white, decoration: cardRadius(12),
borderRadius: BorderRadius.circular(12),
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( _getNormalText(TranslationBase.of(context).transportMethod),
TranslationBase.of(context).transportMethod,
color: Colors.grey,
),
projectViewModel.isArabic projectViewModel.isArabic
? Texts( ? _getNormalText(
'${widget.patientER_RC.patientERTransportationMethod.textN}', '${widget.patientER_RC.patientERTransportationMethod.textN}',
bold: true, isBold: true,
) )
: Texts( : _getNormalText(
'${widget.patientER_RC.patientERTransportationMethod.text}', '${widget.patientER_RC.patientERTransportationMethod.text}',
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( _getNormalText(TranslationBase.of(context).directions),
TranslationBase.of(context).directions, _getNormalText(
color: Colors.grey,
),
Texts(
widget.patientER_RC.transportationDetails.direction == 0 ? TranslationBase.of(context).toHospital : TranslationBase.of(context).fromHospital, widget.patientER_RC.transportationDetails.direction == 0 ? TranslationBase.of(context).toHospital : TranslationBase.of(context).fromHospital,
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( _getNormalText(
TranslationBase.of(context).pickupLocation, TranslationBase.of(context).pickupLocation,
color: Colors.grey,
), ),
Texts( _getNormalText(
'${widget.patientER_RC.transportationDetails.pickupLocationName}', '${widget.patientER_RC.transportationDetails.pickupLocationName}',
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( _getNormalText(TranslationBase.of(context).dropoffLocation),
TranslationBase.of(context).dropoffLocation, _getNormalText(
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.dropoffLocationName}', '${widget.patientER_RC.transportationDetails.dropoffLocationName}',
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( _getNormalText(TranslationBase.of(context).selectAmbulate),
TranslationBase.of(context).selectAmbulate, _getNormalText(
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.ambulateTitle}', '${widget.patientER_RC.transportationDetails.ambulateTitle}',
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( _getNormalText(TranslationBase.of(context).notes),
TranslationBase.of(context).notes, _getNormalText(
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.notes ?? '---'}', '${widget.patientER_RC.transportationDetails.notes ?? '---'}',
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -126,23 +108,26 @@ class _SummaryState extends State<Summary> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Texts( Text(TranslationBase.of(context).billAmount, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
TranslationBase.of(context).billAmount,
textAlign: TextAlign.start,
),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Container( Container(
height: 55, height: 55,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), decoration: cardRadius(12),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).patientShareTotal + ':'), Texts(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}')], children: [
_getNormalText(TranslationBase.of(context).patientShareTotal + ':'),
Container(
padding: EdgeInsets.only(left: 20.0, right: 20.0),
child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}', isBold: true, isTotal: true)
),
],
), ),
), ),
SizedBox(height: 130), SizedBox(height: 50),
], ],
), ),
), ),
@ -156,4 +141,20 @@ class _SummaryState extends State<Summary> {
), ),
); );
} }
_getNormalText(text, {bool isBold = false, bool isTotal = false}) {
return Text(
text,
style: TextStyle(
fontSize: isBold
? isTotal
? 16
: 12
: 10,
letterSpacing: -0.5,
color: isBold ? Colors.black : Colors.grey[700],
fontWeight: FontWeight.w600,
),
);
}
} }

@ -9,7 +9,6 @@ import 'package:provider/provider.dart';
import '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
import 'AmbulanceReq.dart'; import 'AmbulanceReq.dart';
import 'EdOnline/DdServicesPage.dart';
import 'NearestEr.dart'; import 'NearestEr.dart';
class ErOptions extends StatefulWidget { class ErOptions extends StatefulWidget {
@ -75,26 +74,26 @@ class _ErOptionsState extends State<ErOptions> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
// Navigator.push(context, FadePage(page: DdServicesPage())); if (rrtLocked) Navigator.push(context, FadePage(page: RRTMainScreen()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: "ED", title: TranslationBase.of(context).RRTTitle,
imagePath: 'assets/images/new-design/AM.PNG', imagePath: 'assets/images/new-design/AM.PNG',
subTitle: TranslationBase.of(context).service, subTitle: TranslationBase.of(context).RRTSubTitle,
isPngImage: true, isPngImage: true,
isEnable: false, isEnable: rrtLocked,
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
if(rrtLocked) Navigator.push(context, FadePage(page: RRTMainScreen())); // Navigator.push(context, FadePage(page: DdServicesPage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).rrtService, title: "ED",
imagePath: 'assets/images/new-design/AM.PNG', imagePath: 'assets/images/new-design/AM.PNG',
subTitle: TranslationBase.of(context).service, subTitle: TranslationBase.of(context).service,
isPngImage: true, isPngImage: true,
isEnable: rrtLocked, isEnable: false,
), ),
), ),
], ],

@ -1,9 +1,18 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/AmbulanceRequestOrdersModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class OrderLogPage extends StatelessWidget { class OrderLogPage extends StatelessWidget {
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
@ -12,64 +21,232 @@ class OrderLogPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage(AmRequestViewModel model, int presOrderID, BuildContext context) {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg,
onTap: () {
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
// GifLoaderDialogUtils.showMyDialog(context);
await model.updatePressOrder(presOrderID: presOrderID);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
// GifLoaderDialogUtils.hideDialog(context);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
// GifLoaderDialogUtils.hideDialog(context);
}
});
},
));
return;
}
return Container( return Container(
margin: EdgeInsets.all(10), // margin: EdgeInsets.all(10),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: ListView.builder( child: amRequestViewModel.patientAmbulanceRequestOrdersList.length > 0
itemCount: amRequestViewModel.patientAmbulanceRequestOrdersList.length, ? ListView.builder(
itemBuilder: (context, index) => Container( padding: EdgeInsets.all(21),
margin: EdgeInsets.all(8), itemCount: amRequestViewModel.patientAmbulanceRequestOrdersList.length,
decoration: BoxDecoration( itemBuilder: (context, index) {
color: Colors.white, AmbulanceRequestOrdersModel order = amRequestViewModel.patientAmbulanceRequestOrdersList[index];
borderRadius: BorderRadius.circular(2),
), int status = order.statusId;
child: Column( String _statusDisp = order.statusText;
crossAxisAlignment: CrossAxisAlignment.start, Color _color;
children: [ if (status == 1) {
OrderLogItem( //pending
title: TranslationBase.of(context).reqId, _color = Color(0xffCC9B14);
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].id.toString(), } else if (status == 2) {
), //processing
OrderLogItem( _color = Color(0xff2E303A);
title: TranslationBase.of(context).orderStatus, } else if (status == 3) {
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].statusText, //completed
), _color = Color(0xff359846);
OrderLogItem( } else if (status == 4 || status == 6 || status == 7) {
title: TranslationBase.of(context).pickupDate, //cancel // Rejected
value: getDate(amRequestViewModel.patientAmbulanceRequestOrdersList[index].created), _color = Color(0xffD02127);
), }
OrderLogItem(
title: TranslationBase.of(context).pickupLocation, return Container(
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].pickupLocation, margin: EdgeInsets.only(bottom: 12.0),
),
OrderLogItem(
title: TranslationBase.of(context).dropoffLocation,
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].dropOffLocation,
),
if (amRequestViewModel.patientAmbulanceRequestOrdersList[index].statusId == 1)
Container(
padding: EdgeInsets.all(10),
width: double.maxFinite,
margin: EdgeInsets.only(bottom: 4, left: 4, right: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: _color,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: Container(
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 13, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12), bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: Radius.circular(12), topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
), ),
color: Colors.white), ),
child: SecondaryButton( child: Column(
color: Colors.red[900], crossAxisAlignment: CrossAxisAlignment.start,
textColor: Colors.white, children: [
label: TranslationBase.of(context).cancel, Row(
onTap: () { crossAxisAlignment: CrossAxisAlignment.start,
amRequestViewModel.updatePressOrder(presOrderID: amRequestViewModel.pendingAmbulanceRequestOrder.id); children: [
}, Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_statusDisp,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${order.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).pickupDate + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).transportMethod + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
order.serviceText,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
),
),
],
),
SizedBox(
height: 13.0,
),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
SizedBox(height: 12),
if (order.statusId == 1 || order.statusId == 2)
InkWell(
onTap: () {
showConfirmMessage(amRequestViewModel, order.iD, context);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(10),
),
child: Text(
TranslationBase.of(context).cancel_nocaps,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
],
),
],
),
Row(
children: [
Container(
margin: projectViewModel.isArabic ? EdgeInsets.only(left: 10.0) : EdgeInsets.only(right: 10.0),
width: 8,
height: 8,
decoration: containerRadius(
CustomColors.textColor,
100,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).pickupLocation + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Text(
order.pickupLocation.trim().toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
],
),
],
),
Container(
height: 20.0,
width: 1.0,
color: CustomColors.grey2,
margin: const EdgeInsets.only(left: 3.0, right: 3.0),
),
Row(
children: [
Container(
margin: projectViewModel.isArabic ? EdgeInsets.only(left: 10.0) : EdgeInsets.only(right: 10.0),
width: 8,
height: 8,
decoration: containerRadius(
CustomColors.accentColor,
100,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).dropoffLocation + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Text(
order.dropOffLocation.trim().toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
],
),
],
),
],
),
), ),
) );
], })
), : getNoDataWidget(context),
),
),
); );
} }

@ -1,15 +1,15 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class RRTLogPage extends StatefulWidget { class RRTLogPage extends StatefulWidget {
final List<GetCMCAllOrdersResponseModel> orders; final List<GetCMCAllOrdersResponseModel> orders;
@ -36,13 +36,15 @@ class RRTLogPageState extends State<RRTLogPage> {
viewModel = vm, viewModel = vm,
}, },
builder: (ctx, vm, widgetState) { builder: (ctx, vm, widgetState) {
return ListView.builder( return widget.orders.length > 0
itemCount: widget.orders.length, ? ListView.builder(
padding: EdgeInsets.all(21), itemCount: widget.orders.length,
itemBuilder: (ctx, idx) { padding: EdgeInsets.all(21),
var order = widget.orders[idx]; itemBuilder: (ctx, idx) {
return RRTLogListItem(order, onCancel: deleteOrder); var order = widget.orders[idx];
}); return RRTLogListItem(order, onCancel: deleteOrder);
})
: getNoDataWidget(context);
}); });
} }

@ -103,21 +103,21 @@ class RRTLogListItemState extends State<RRTLogListItem> {
'${TranslationBase.of(context).requestID}: ${widget.order.iD}', '${TranslationBase.of(context).requestID}: ${widget.order.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
Row( // Row(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
Text( // Text(
TranslationBase.of(context).locationa + ": ", // TranslationBase.of(context).locationa + ": ",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), // style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), // ),
Expanded( // Expanded(
child: Text( // child: Text(
widget.order.projectName.toString(), // widget.order.projectName.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), // style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), // ),
), // ),
], // ],
), // ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

@ -43,7 +43,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
static CameraPosition cameraPosition = CameraPosition( static CameraPosition cameraPosition = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962), target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746, zoom: 17,
); );
LatLng currentPostion; LatLng currentPostion;
@ -71,7 +71,6 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
_updatePosition(camera); _updatePosition(camera);
}, },
onMapCreated: () { onMapCreated: () {
// goToCurrentLocation();
_getUserLocation(); _getUserLocation();
setState(() {}); setState(() {});
}, },
@ -97,8 +96,6 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
latitude = double.parse(latLongArr[0]); latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]); longitude = double.parse(latLongArr[1]);
print("sssss1 " + latitude.toString());
print("sssss2 " + longitude.toString());
currentPostion = LatLng(latitude, longitude); currentPostion = LatLng(latitude, longitude);
setMap(); setMap();
} }
@ -108,7 +105,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
setState(() { setState(() {
cameraPosition = CameraPosition( cameraPosition = CameraPosition(
target: currentPostion, target: currentPostion,
zoom: 14.4746, zoom: 16,
); );
appMap.moveTo(cameraPostion: cameraPosition); appMap.moveTo(cameraPostion: cameraPosition);
selectedAddress.latLong = currentPostion.latitude.toString() + "," + currentPostion.longitude.toString(); selectedAddress.latLong = currentPostion.latitude.toString() + "," + currentPostion.longitude.toString();

@ -63,7 +63,7 @@ class RRTPlaceOrderPage extends StatelessWidget {
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
child: Image.network( child: Image.network(
"https://maps.googleapis.com/maps/api/staticmap?center=$lat,$lng &zoom=16&size=800x600&maptype=roadmap&markers=color:red%7C$lat,$lng&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8", "https://maps.googleapis.com/maps/api/staticmap?center=$lat,$lng &zoom=17&size=800x600&maptype=roadmap&markers=color:red%7C$lat,$lng&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8",
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),

@ -1,5 +1,4 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; import 'package:diplomaticquarterapp/models/rrt/service_price.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart';
@ -10,6 +9,7 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -65,7 +65,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
child: Text(TranslationBase.of(context).youCanPayByTheFollowingOptions, child: Text(TranslationBase.of(context).youCanPayByTheFollowingOptions,
style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2)), style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2)),
paymentOptions(), Container(margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), child: getPaymentMethods())
], ],
), ),
), ),

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -12,216 +14,331 @@ class StepsWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); return Container(
return projectViewModel.isArabic? width: double.infinity,
Stack( padding: EdgeInsets.only(left: 12, right: 12, bottom: 12),
children: [ child: Row(
Container( children: [
height: 50, Expanded(
width: MediaQuery.of(context).size.width, child: showProgress(
color: Colors.transparent, title: TranslationBase.of(context).transportation,
child: Center( status: index == 0
child: Divider( ? TranslationBase.of(context).inPrgress
color: Colors.grey, : index > 0
height: 0.75, ? TranslationBase.of(context).completed
thickness: 0.75, : TranslationBase.of(context).locked,
color: index == 0 ? CustomColors.orange : CustomColors.green,
), ),
), ),
), Expanded(
Positioned( child: showProgress(
top: 10, title: TranslationBase.of(context).locationa,
right: 0, status: index == 1
child: InkWell( ? TranslationBase.of(context).inPrgress
onTap: () => changeCurrentTab(0), : index > 1
child: Container( ? TranslationBase.of(context).completed
width: 35, : TranslationBase.of(context).locked,
height: 35, color: index == 1
decoration: BoxDecoration( ? CustomColors.orange
border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), : index > 1
shape: BoxShape.circle, ? CustomColors.green
color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, : CustomColors.grey2,
),
child: Center(
child: Texts(
'1',
color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
),
),
), ),
), ),
), Expanded(
Positioned( child: showProgress(
top: 10, title: TranslationBase.of(context).otherInfo,
right: MediaQuery.of(context).size.width * 0.3, status: index == 2
child: InkWell( ? TranslationBase.of(context).inPrgress
onTap: () => index >= 2 ? changeCurrentTab(1) : null, : index > 2
child: Container( ? TranslationBase.of(context).completed
width: 35, : TranslationBase.of(context).locked,
height: 35, color: index == 2
decoration: BoxDecoration( ? CustomColors.orange
border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), : index > 2
shape: BoxShape.circle, ? CustomColors.green
color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, : CustomColors.grey2,
),
child: Center(
child: Texts(
'2',
color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
),
),
), ),
), ),
), showProgress(
Positioned( title: TranslationBase.of(context).RRTSummary,
top: 10, status: index == 3 ? TranslationBase.of(context).inPrgress : TranslationBase.of(context).locked,
right: MediaQuery.of(context).size.width * 0.6, color: index == 3
child: InkWell( ? CustomColors.orange
onTap: () => index >= 3 ? changeCurrentTab(2) : null, : index > 4
child: Container( ? CustomColors.green
width: 35, : CustomColors.grey2,
height: 35, isNeedBorder: false,
decoration: BoxDecoration(
shape: BoxShape.circle,
border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75),
color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'3',
color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
),
),
),
), ),
), ],
Positioned( ),
top: 10, );
left: 0,
child: InkWell(
onTap: () => index == 2 ?changeCurrentTab(3):null,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle, // return projectViewModel.isArabic?
color: index == 3 ? Colors.grey[800] : Colors.white, // Stack(
), // children: [
child: Center( // Container(
child: Texts( // height: 50,
'4', // width: MediaQuery.of(context).size.width,
color: index == 3 ? Colors.white : Colors.grey[800], // color: Colors.transparent,
), // child: Center(
), // child: Divider(
), // color: Colors.grey,
), // height: 0.75,
), // thickness: 0.75,
], // ),
): // ),
Stack( // ),
// Positioned(
// top: 10,
// right: 0,
// child: InkWell(
// onTap: () => changeCurrentTab(0),
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75),
// shape: BoxShape.circle,
// color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '1',
// color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// right: MediaQuery.of(context).size.width * 0.3,
// child: InkWell(
// onTap: () => index >= 2 ? changeCurrentTab(1) : null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75),
// shape: BoxShape.circle,
// color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '2',
// color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// right: MediaQuery.of(context).size.width * 0.6,
// child: InkWell(
// onTap: () => index >= 3 ? changeCurrentTab(2) : null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75),
// color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '3',
// color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// left: 0,
// child: InkWell(
// onTap: () => index == 2 ?changeCurrentTab(3):null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: Border.all(color: Colors.black,width: 0.75),
//
// shape: BoxShape.circle,
// color: index == 3 ? Colors.grey[800] : Colors.white,
// ),
// child: Center(
// child: Texts(
// '4',
// color: index == 3 ? Colors.white : Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// ],
// ):
// Stack(
// children: [
// Container(
// height: 50,
// width: MediaQuery.of(context).size.width,
// color: Colors.transparent,
// child: Center(
// child: Divider(
// color: Colors.grey,
// height: 0.75,
// thickness: 0.75,
// ),
// ),
// ),
// Positioned(
// top: 10,
// left: 0,
// child: InkWell(
// onTap: () => changeCurrentTab(0),
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75),
// shape: BoxShape.circle,
// color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '1',
// color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// left: MediaQuery.of(context).size.width * 0.3,
// child: InkWell(
// onTap: () => index >= 2 ? changeCurrentTab(1) : null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75),
// shape: BoxShape.circle,
// color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '2',
// color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// left: MediaQuery.of(context).size.width * 0.6,
// child: InkWell(
// onTap: () => index >= 3 ? changeCurrentTab(2) : null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75),
// color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '3',
// color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// right: 0,
// child: InkWell(
// onTap: () => index == 2 ?changeCurrentTab(3):null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: Border.all(color: Colors.black,width: 0.75),
//
// shape: BoxShape.circle,
// color: index == 3 ? Colors.grey[800] : Colors.white,
// ),
// child: Center(
// child: Texts(
// '4',
// color: index == 3 ? Colors.white : Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// ],
// );
}
Widget showProgress({String title, String status, Color color, bool isNeedBorder = true}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Column(
height: 50, crossAxisAlignment: CrossAxisAlignment.start,
width: MediaQuery.of(context).size.width, children: [
color: Colors.transparent, Row(
child: Center( children: [
child: Divider( Container(
color: Colors.grey, width: 26,
height: 0.75, height: 26,
thickness: 0.75, decoration: containerRadius(color, 200),
), child: Icon(
), Icons.done,
), color: Colors.white,
Positioned( size: 16,
top: 10, ),
left: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'1',
color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
),
),
),
),
),
Positioned(
top: 10,
left: MediaQuery.of(context).size.width * 0.3,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'2',
color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
), ),
), if (isNeedBorder)
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: mDivider(Colors.grey),
)),
],
), ),
), mHeight(8),
), Text(
Positioned( title,
top: 10, style: TextStyle(
left: MediaQuery.of(context).size.width * 0.6, fontSize: 11,
child: InkWell( fontWeight: FontWeight.w600,
onTap: () => index >= 3 ? changeCurrentTab(2) : null, letterSpacing: -0.44,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
shape: BoxShape.circle,
border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75),
color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'3',
color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
),
), ),
), ),
), mHeight(2),
), Container(
Positioned( padding: EdgeInsets.all(5),
top: 10, decoration: containerRadius(color.withOpacity(0.2), 4),
right: 0, child: Text(
child: InkWell( status,
onTap: () => index == 2 ?changeCurrentTab(3):null, style: TextStyle(
child: Container( fontSize: 8,
width: 35, fontWeight: FontWeight.w600,
height: 35, letterSpacing: -0.32,
decoration: BoxDecoration( color: color,
border: Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 3 ? Colors.grey[800] : Colors.white,
),
child: Center(
child: Texts(
'4',
color: index == 3 ? Colors.white : Colors.grey[800],
), ),
), ),
), ),
), ],
), )
], ],
); );
} }

@ -1,8 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
@ -20,7 +18,10 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -40,7 +41,7 @@ class ToDo extends StatefulWidget {
bool isShowAppBar = true; bool isShowAppBar = true;
Function onBackClick; Function onBackClick;
ToDo({@required this.isShowAppBar,this.onBackClick}); ToDo({@required this.isShowAppBar, this.onBackClick});
@override @override
_ToDoState createState() => _ToDoState(); _ToDoState createState() => _ToDoState();
@ -49,11 +50,7 @@ class ToDo extends StatefulWidget {
class _ToDoState extends State<ToDo> { class _ToDoState extends State<ToDo> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
CountdownTimerController controller; CountdownTimerController controller;
@ -63,7 +60,7 @@ class _ToDoState extends State<ToDo> {
void initState() { void initState() {
widget.patientShareResponse = new PatientShareResponse(); widget.patientShareResponse = new PatientShareResponse();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (authenticatedUserObject.isLogin) getPatientData(); getPatientAppointmentHistory();
}); });
super.initState(); super.initState();
imagesInfo imagesInfo
@ -85,7 +82,7 @@ class _ToDoState extends State<ToDo> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
icon: "assets/images/new/bottom_nav/todo.svg", icon: "assets/images/new/bottom_nav/todo.svg",
description: TranslationBase.of(context).infoTodo, description: TranslationBase.of(context).infoTodo,
onTap:widget.onBackClick, onTap: widget.onBackClick,
backgroundColor: CustomColors.appBackgroudGrey2Color, backgroundColor: CustomColors.appBackgroudGrey2Color,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
@ -98,207 +95,353 @@ class _ToDoState extends State<ToDo> {
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length, itemCount: widget.appoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
print("ttt " + getNextActionImage(widget.appoList[index].nextAction));
print("ttt " + widget.appoList[index].nextAction.toString());
return Container( return Container(
margin: EdgeInsets.all(10.0), width: double.infinity,
margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0),
decoration: cardRadius(12),
padding: EdgeInsets.all(16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Row(
child: Card( mainAxisAlignment: MainAxisAlignment.spaceBetween,
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), children: [
color: Colors.white, Row(
shape: RoundedRectangleBorder( crossAxisAlignment: CrossAxisAlignment.start,
borderRadius: BorderRadius.circular(10), children: [
Padding(
padding: const EdgeInsets.only(top: 4.0),
child: widget.appoList[index].clinicID == 265
? Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/drive-thru.svg"),
)
: widget.appoList[index].isLiveCareAppointment
? SvgPicture.asset("assets/images/new/virtual.svg")
: SvgPicture.asset("assets/images/new/hospital-visit.svg"),
// SvgPicture.asset("assets/images/new/virtual.svg"),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(
widget.appoList[index].clinicID == 265
? TranslationBase.of(context).drivethruAppo
: widget.appoList[index].isLiveCareAppointment
? TranslationBase.of(context).liveCareAppo
: TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: CountdownTimer(
controller: new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) {
return time != null
? Text(
'${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' +
TranslationBase.of(context).upcomingTimeLeft,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48))
: Container();
},
),
),
],
),
],
),
Container(
child: InkWell(
onTap: () {
performNextAction(widget.appoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: getNextActionButtonColor(widget.appoList[index].nextAction),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6),
),
child: Text(
getNextActionText(widget.appoList[index].nextAction),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
),
],
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
url: widget.appoList[index].doctorImageURL,
width: 52,
height: 52,
), ),
child: Container( SizedBox(width: 11),
width: MediaQuery.of(context).size.width, Expanded(
padding: EdgeInsets.all(10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, projectViewModel.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Image.asset("assets/images/new-design/time_icon.png", width: 20.0, height: 20.0), RatingBar.readOnly(
Container( initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
width: MediaQuery.of(context).size.width * 0.4, size: 16.0,
margin: EdgeInsets.only(left: 10.0, right: 10.0), filledColor: Color(0XFFD02127),
child: Text( emptyColor: Color(0XFFD02127),
DateUtil.getWeekDayMonthDayYearDateFormatted( isHalfAllowed: true,
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") + halfFilledIcon: Icons.star_half,
" " + filledIcon: Icons.star,
widget.appoList[index].startTime.substring(0, 5), emptyIcon: Icons.star_border,
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 10.0)),
),
!widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(),
Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: widget.appoList[index].isLiveCareAppointment
? Container()
: Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-",
overflow: TextOverflow.clip, maxLines: 2, style: TextStyle(fontSize: 10.0)),
), ),
], ],
), ),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Divider(
color: Colors.grey[500],
),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
height: MediaQuery.of(context).size.height * 0.1,
margin: EdgeInsets.only(top: 5.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(widget.appoList[index].doctorImageURL, fit: BoxFit.fill),
),
),
),
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: -0.64)),
if (getDoctorSpeciality(widget.appoList[index].doctorSpeciality) != "null\n")
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(getDoctorSpeciality(widget.appoList[index].doctorSpeciality).trim(),
style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: -0.64)),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
],
),
Container(
child: CountdownTimer(
controller:
new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) {
return time != null
? Text(
'${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' +
TranslationBase.of(context).upcomingTimeLeft,
style: TextStyle(fontSize: 12.0, color: Color(0xffC5272D)))
: Container();
},
),
),
],
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => performNextAction(widget.appoList[index]),
child: Container(
margin: EdgeInsets.only(top: 20.0),
child: Column(
children: <Widget>[
Image.asset(getNextActionImage(widget.appoList[index].nextAction), width: 50.0, height: 50.0),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(getNextActionText(widget.appoList[index].nextAction), textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
)
],
),
),
),
)
],
),
Divider(
color: Colors.grey[500],
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 2,
child: Container(
child: Text(getNextActionDescription(widget.appoList[index].nextAction), style: TextStyle(fontSize: 11.0, color: Colors.grey[700])),
),
),
Expanded(
flex: 1,
child: GestureDetector(
onTap: () {
navigateToAppointmentDetails(context, widget.appoList[index]);
},
child: Container(
child: Text(TranslationBase.of(context).upcomingDetails,
textAlign: TextAlign.end, style: TextStyle(fontSize: 11.0, color: new Color(0xffC5272D), decoration: TextDecoration.underline)),
),
),
)
],
),
], ],
), ),
), ),
), ],
), ),
Container( Padding(
decoration: BoxDecoration( padding: const EdgeInsets.only(top: 12.0),
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10.0), bottomRight: Radius.circular(10.0)), child: Text(
color: Color(0xff20bc44), getNextActionDescription(widget.appoList[index].nextAction),
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
), ),
height: 30.0, ),
padding: EdgeInsets.only(right: 10, left: 10), InkWell(
margin: EdgeInsets.symmetric(horizontal: 20), onTap: () {
transform: Matrix4.translationValues(0.0, -8.0, 0.0), navigateToAppointmentDetails(context, widget.appoList[index]);
child: Row( },
mainAxisSize: MainAxisSize.min, child: Padding(
mainAxisAlignment: MainAxisAlignment.start, padding: const EdgeInsets.only(top: 0.0),
children: [ child: Text(
widget.appoList[index].clinicID == 265 TranslationBase.of(context).moreDetails,
? Container( style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48, height: 25 / 16, decoration: TextDecoration.underline),
margin: EdgeInsets.only(left: 5.0, right: 5.0), ),
child: SvgPicture.asset(
"assets/images/new/car_icon.svg",
height: 15,
width: 15,
),
)
: widget.appoList[index].isLiveCareAppointment
? Image.asset("assets/images/new-design/video.png")
: Image.asset("assets/images/new-design/walkin.png"),
widget.appoList[index].clinicID == 265
? Text(TranslationBase.of(context).drivethruAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
: widget.appoList[index].isLiveCareAppointment
? Text(TranslationBase.of(context).videoAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
: Text(TranslationBase.of(context).walkinAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
],
), ),
), ),
], ],
), ),
); );
// return Container(
// margin: EdgeInsets.all(10.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// child: Card(
// margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
// color: Colors.white,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// ),
// child: Container(
// width: MediaQuery.of(context).size.width,
// padding: EdgeInsets.all(10.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// Row(
// children: <Widget>[
// Image.asset("assets/images/new-design/time_icon.png", width: 20.0, height: 20.0),
// Container(
// width: MediaQuery.of(context).size.width * 0.4,
// margin: EdgeInsets.only(left: 10.0, right: 10.0),
// child: Text(
// DateUtil.getWeekDayMonthDayYearDateFormatted(
// DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") +
// " " +
// widget.appoList[index].startTime.substring(0, 5),
// overflow: TextOverflow.clip,
// style: TextStyle(fontSize: 10.0)),
// ),
// !widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(),
// Container(
// margin: EdgeInsets.only(left: 5.0, right: 5.0),
// child: widget.appoList[index].isLiveCareAppointment
// ? Container()
// : Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-",
// overflow: TextOverflow.clip, maxLines: 2, style: TextStyle(fontSize: 10.0)),
// ),
// ],
// ),
// Container(
// margin: EdgeInsets.only(top: 5.0),
// child: Divider(
// color: Colors.grey[500],
// ),
// ),
// Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// flex: 1,
// child: Container(
// height: MediaQuery.of(context).size.height * 0.1,
// margin: EdgeInsets.only(top: 5.0),
// child: ClipRRect(
// borderRadius: BorderRadius.circular(100.0),
// child: Image.network(widget.appoList[index].doctorImageURL, fit: BoxFit.fill),
// ),
// ),
// ),
// Expanded(
// flex: 3,
// child: Container(
// margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Text(widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
// style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: -0.64)),
// if (getDoctorSpeciality(widget.appoList[index].doctorSpeciality) != "null\n")
// Container(
// margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
// child: Text(getDoctorSpeciality(widget.appoList[index].doctorSpeciality).trim(),
// style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: -0.64)),
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// RatingBar.readOnly(
// initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
// size: 20.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
// ],
// ),
// Container(
// child: CountdownTimer(
// controller:
// new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60),
// widgetBuilder: (_, CurrentRemainingTime time) {
// return time != null
// ? Text(
// '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' +
// TranslationBase.of(context).upcomingTimeLeft,
// style: TextStyle(fontSize: 12.0, color: Color(0xffC5272D)))
// : Container();
// },
// ),
// ),
// ],
// ),
// ),
// ),
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => performNextAction(widget.appoList[index]),
// child: Container(
// margin: EdgeInsets.only(top: 20.0),
// child: Column(
// children: <Widget>[
// Image.asset(getNextActionImage(widget.appoList[index].nextAction), width: 50.0, height: 50.0),
// Container(
// margin: EdgeInsets.only(top: 5.0),
// child: Text(getNextActionText(widget.appoList[index].nextAction), textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
// )
// ],
// ),
// ),
// ),
// )
// ],
// ),
// Divider(
// color: Colors.grey[500],
// ),
// Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// flex: 2,
// child: Container(
// child: Text(getNextActionDescription(widget.appoList[index].nextAction), style: TextStyle(fontSize: 11.0, color: Colors.grey[700])),
// ),
// ),
// Expanded(
// flex: 1,
// child: GestureDetector(
// onTap: () {
// navigateToAppointmentDetails(context, widget.appoList[index]);
// },
// child: Container(
// child: Text(TranslationBase.of(context).upcomingDetails,
// textAlign: TextAlign.end, style: TextStyle(fontSize: 11.0, color: new Color(0xffC5272D), decoration: TextDecoration.underline)),
// ),
// ),
// )
// ],
// ),
// ],
// ),
// ),
// ),
// ),
// Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10.0), bottomRight: Radius.circular(10.0)),
// color: Color(0xff20bc44),
// ),
// height: 30.0,
// padding: EdgeInsets.only(right: 10, left: 10),
// margin: EdgeInsets.symmetric(horizontal: 20),
// transform: Matrix4.translationValues(0.0, -8.0, 0.0),
// child: Row(
// mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// widget.appoList[index].clinicID == 265
// ? Container(
// margin: EdgeInsets.only(left: 5.0, right: 5.0),
// child: SvgPicture.asset(
// "assets/images/new/car_icon.svg",
// height: 15,
// width: 15,
// ),
// )
// : widget.appoList[index].isLiveCareAppointment
// ? Image.asset("assets/images/new-design/video.png")
// : Image.asset("assets/images/new-design/walkin.png"),
// widget.appoList[index].clinicID == 265
// ? Text(TranslationBase.of(context).drivethruAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// : widget.appoList[index].isLiveCareAppointment
// ? Text(TranslationBase.of(context).videoAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// : Text(TranslationBase.of(context).walkinAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// ],
// ),
// ),
// ],
// ),
// );
}, },
), ),
), ),
@ -375,6 +518,48 @@ class _ToDoState extends State<ToDo> {
} }
} }
Color getNextActionButtonColor(nextAction) {
switch (nextAction) {
case 0:
return CustomColors.accentColor;
break;
case 10:
return CustomColors.green;
break;
case 15:
return CustomColors.grey2;
break;
case 20:
return CustomColors.green;
break;
case 30:
return CustomColors.accentColor;
break;
case 40:
return CustomColors.green;
break;
case 50:
return CustomColors.green;
break;
case 60:
return CustomColors.orange;
break;
case 90:
return CustomColors.accentColor;
break;
default:
return CustomColors.green;
}
}
String getNextActionText(nextAction) { String getNextActionText(nextAction) {
switch (nextAction) { switch (nextAction) {
case 0: case 0:
@ -732,35 +917,34 @@ class _ToDoState extends State<ToDo> {
}); });
} }
getPatientData() async { // getPatientData() async {
AppSharedPreferences sharedPref = AppSharedPreferences(); // AppSharedPreferences sharedPref = AppSharedPreferences();
if (await sharedPref.getObject(USER_PROFILE) != null) { // if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); // var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
setState(() { // setState(() {
print(data); // print(data);
authUser = data; // authUser = data;
}); // });
getPatientAppointmentHistory(); // getPatientAppointmentHistory();
} // }
} // }
Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { // if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); // var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
setState(() { // setState(() {
authUser = data; // authUser = data;
}); // });
} // }
Navigator.push(context, FadePage(page: PaymentMethod( Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) {
onSelectedMethod: (String metohd) {
setState(() {}); setState(() {});
}))).then((value) { }))).then((value) {
print(value); print(value);
getPatientAppointmentHistory(); getPatientAppointmentHistory();
if (value != null) { if (value != null) {
openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
} }
}); });
} }

@ -5,11 +5,13 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class PaymentMethod extends StatefulWidget { class PaymentMethod extends StatefulWidget {
Function onSelectedMethod; Function onSelectedMethod;
bool isShowInstallments;
PaymentMethod({this.onSelectedMethod}); PaymentMethod({this.onSelectedMethod, this.isShowInstallments = false});
@override @override
_PaymentMethodState createState() => _PaymentMethodState(); _PaymentMethodState createState() => _PaymentMethodState();
@ -185,55 +187,57 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
), ),
Container( if (widget.isShowInstallments)
width: double.infinity, Container(
child: InkWell( width: double.infinity,
onTap: () { child: InkWell(
updateSelectedPaymentMethod("Installment"); onTap: () {
}, updateSelectedPaymentMethod("Installment");
child: Card( },
elevation: 0.0, child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), elevation: 0.0,
color: Colors.white, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
shape: RoundedRectangleBorder( color: Colors.white,
borderRadius: BorderRadius.circular(10), shape: RoundedRectangleBorder(
side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), borderRadius: BorderRadius.circular(10),
), side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0),
child: Padding( ),
padding: const EdgeInsets.all(12.0), child: Padding(
child: Row( padding: const EdgeInsets.all(12.0),
children: [ child: Row(
Container( children: [
width: 24,
height: 24,
decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "Installment" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
),
mWidth(12),
Container(
height: 60.0,
padding: EdgeInsets.all(7.0),
width: 60,
child: Image.asset("assets/images/new/payment/installments.png"),
),
mFlex(1),
if (selectedPaymentMethod == "Installment")
Container( Container(
decoration: containerRadius(CustomColors.green, 200), width: 24,
padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), height: 24,
child: Text( decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "Installment" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
TranslationBase.of(context).paymentSelected, ),
style: TextStyle( mWidth(12),
color: Colors.white, Container(
fontSize: 11, height: 60.0,
padding: EdgeInsets.all(7.0),
width: 90,
// child: Image.asset("assets/images/new/payment/installments.png"),
child: SvgPicture.asset("assets/images/new/payment/instalmt.svg"),
),
mFlex(1),
if (selectedPaymentMethod == "Installment")
Container(
decoration: containerRadius(CustomColors.green, 200),
padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12),
child: Text(
TranslationBase.of(context).paymentSelected,
style: TextStyle(
color: Colors.white,
fontSize: 11,
),
), ),
), ),
), ],
], ),
), ),
), ),
), ),
), ),
),
Platform.isIOS Platform.isIOS
? Container( ? Container(
width: double.infinity, width: double.infinity,

@ -89,7 +89,7 @@ class _PaymentDialogState extends State<PaymentDialog> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).cancel, TranslationBase.of(context).cancel_nocaps,
() { () {
Navigator.pop(context, null); Navigator.pop(context, null);
}, },

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save