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 3 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_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// const PHARMACY_BASE_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/';
// // Pharmacy Production URLs
const BASE_PHARMACY_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 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';
// Delivery Driver
const DRIVER_LOCATION = 'Services/Patients.svc/REST/PatientER_GetDriverLocation';
const DRIVER_LOCATION =
'Services/Patients.svc/REST/PatientER_GetDriverLocation';
//weather
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';
// 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
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_PRE_POST_IMAGES = 'Services/Doctors.svc/REST/GetDoctorPrePostImages';
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_PRE_POST_IMAGES =
'Services/Doctors.svc/REST/GetDoctorPrePostImages';
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';
///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = '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';
const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT =
'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
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
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_LAB_SPECIAL_RESULT =
'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT =
'Services/Patients.svc/REST/GetPatientLabResults';
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_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 SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail';
const SEND_RAD_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendRadReportEmail';
///Feedback
const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList';
const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC';
// const GET_PATIENT_AppointmentHistory = 'Services'
// '/Doctors.svc/REST/PateintHasAppoimentHistory';
const GET_PATIENT_AppointmentHistory = 'Services'
'/Doctors.svc/REST/PateintHasAppoimentHistory';
'/Doctors.svc/REST/PateintHasAppoimentHistory_Async';
///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
const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
const GET_NEAREST_HOSPITAL =
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///ED Online
const ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions";
const ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation";
const ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
const ER_GET_VISUAL_TRIAGE_QUESTIONS =
"services/Doctors.svc/REST/ER_GetVisualTriageQuestions";
const ER_SAVE_TRIAGE_INFORMATION =
"services/Doctors.svc/REST/ER_SaveTriageInformation";
const ER_GetPatientPaymentInformationForERClinic =
"services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
///Er Nearest
const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
const GET_PATIENT_ALL_PRES_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
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';
const GET_AMBULANCE_REQUEST =
'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
const GET_PATIENT_ALL_PRES_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
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
const GET_ALL_RC_TRANSPORTATION = '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_RRT_SERVICE_PRICE = 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice';
const GET_ALL_RRT_QUESTIONS =
'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';
@ -124,13 +164,15 @@ const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects';
///babyInformation
const GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID';
const GET_BABYINFORMATION_REQUEST =
'Services/Community.svc/REST/GetBabyByUserID';
///Get Baby By User ID
const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID';
///userInformation
const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New';
const GET_USERINFORMATION_REQUEST =
'Services/Community.svc/REST/GetUserInformation_New';
///Update email
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';
///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 SAVE_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
const GET_BLOOD_AGREEMENT =
'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation';
const SAVE_BLOOD_AGREEMENT =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
///Reports
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail';
const INSERT_REQUEST_FOR_MEDICAL_REPORT =
'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
const SEND_MEDICAL_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendMedicalReportEmail';
///Rate
const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
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 IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
const IS_LAST_APPOITMENT_RATED =
'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async';
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';
@ -176,7 +229,8 @@ const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//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
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";
//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
const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots";
//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
const GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
const GET_PATIENT_SHARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//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
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
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
const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment";
//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
const EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
const EMAIL_QR_APPOINTMENT =
"Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
//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
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 GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const ADD_VIDA_REQUEST = 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart';
const IS_ALLOW_ASK_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
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 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 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 CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
const GET_LIVECARE_HISTORY =
'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
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 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';
@ -293,16 +383,21 @@ var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 2;
const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails";
const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const GET_PAtIENTS_INSURANCE =
"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 GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_PATIENT_INSURANCE_DETAILS =
"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_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 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 GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount';
const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID';
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_PATIENT_AdVANCE_BALANCE_AMOUNT =
'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount';
const GET_PATIENT_INFO_BY_ID =
'Services/Doctors.svc/REST/GetPatientInfoByPatientID';
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
const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord';
const INSERT_PATIENT_HEALTH_DATA = 'Services/Patients.svc/REST/Med_InsertTransactions';
const GET_PATIENT_LAST_RECORD =
'Services/Patients.svc/REST/Med_GetPatientLastRecord';
const INSERT_PATIENT_HEALTH_DATA =
'Services/Patients.svc/REST/Med_InsertTransactions';
///My Trackers
const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult';
const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult';
const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
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_DIABETIC_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
const GET_DIABTEC_RESULT =
'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const ADD_DIABTEC_RESULT =
'Services/Patients.svc/REST/Patient_AddDiabtecResult';
const GET_BLOOD_PRESSURE_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
const GET_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
const ADD_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID =
'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
const GET_CALL_INFO_HOURS_RESULT =
'Services/Doctors.svc/REST/GetCallInfoHoursResult';
const GET_CALL_REQUEST_TYPE_LOV =
'Services/Doctors.svc/REST/GetCallRequestType_LOV';
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 UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus';
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';
// H2O
const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress";
const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity";
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";
const H2O_GET_USER_PROGRESS =
"Services/H2ORemainder.svc/REST/H2O_GetUserProgress";
const H2O_INSERT_USER_ACTIVITY =
"Services/H2ORemainder.svc/REST/H2O_InsertUserActivity";
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
const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes";
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_RELATIONSHIP_TYPES =
"Services/Patients.svc/REST/GetAllRelationshipTypes";
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 CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
// 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
// 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 GET_ORDER = "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 DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress";
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_ALL = "delete_shopping_cart_item_by_customer/";
const ORDER_SHOPPING_CART = "orders";
const GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation";
const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation";
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 GET_LACUM_ACCOUNT_INFORMATION =
"Services/Patients.svc/REST/GetLakumAccountInformation";
const GET_LACUM_GROUP_INFORMATION =
"Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const LACUM_ACCOUNT_ACTIVATE =
"Services/Patients.svc/REST/LakumAccountActivation";
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 GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
const GET_MOST_VIEWED_PRODUCTS = "mostview?";
const GET_NEW_PRODUCTS = "newproducts?";
const GET_MOST_VIEWED_PRODUCTS = "mostview";
const GET_NEW_PRODUCTS = "newproducts";
// Home Health Care
const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
const HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices";
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 HHC_GET_ALL_SERVICES =
"Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
const HHC_GET_ALL_CMC_SERVICES =
"Services/Patients.svc/REST/PatientER_CMC_GetAllServices";
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 PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = '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 PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS =
'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ =
'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 BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
const BLOOD_DONATION_REGISTER_BLOOD_TYPE =
'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
// HHC RC SERVICES
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
const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add";
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';
//Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/";
const DELETE_WISHLIST = "delete_shopping_cart_item_by_product?customer_id=";
@ -487,17 +642,21 @@ const GET_CUSTOMER_INFO = "VerifyCustomer";
//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_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_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_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=';
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 TIMER_MIN = 10;
@ -513,13 +672,17 @@ const SCAN_QR_CODE = 'productbysku/';
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 {
static var context;

@ -491,9 +491,11 @@ const Map localizedValues = {
"noLocationAvailable": {"en": "No Location Available", "ar": "لا يوجد موقع"},
"orders": {"en": "Orders", "ar": "الطلبات"},
"lakum": {"en": "Lakum", "ar": "برنامج لكم"},
"lakumMsg": {"en": "No Details of Points Are There", "ar": " لاتوجد تفاصيل عن النقاط"},
"lakumPoint": {"en": "Point", "ar": "نقطه"},
"wishlist": {"en": "Wishlist", "ar": "المفضلة"},
"products": {"en": "Products", "ar": "المنتجات"},
"reviews": {"en": "Reviews", "ar": "التقيمات"},
"reviews": {"en": "Reviews", "ar": "التقييمات"},
"brands": {"en": "Brands", "ar": "العلامات التجارية"},
"productDetails": {"en": "Product Details", "ar": "تفاصيل المنتج"},
"medicationRefill": {"en": "Medication Refill", "ar": "تعبئة الأدوية"},
@ -586,6 +588,7 @@ const Map localizedValues = {
"remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"},
"loginToUseService": {"en": "You need to login to use this service", "ar": "هذة الخدمة تتطلب تسجيل الدخول"},
"offersAndPromotions": {"en": "OFFERS & SPECIAL PROMOTIONS", "ar": "العروض والترقيات الخاصة"},
"offers": {"en": "OFFERS", "ar": "العروض"},
"myPrescriptions": {"en": "MY PRESCRIPTIONS", "ar": "وصفاتي"},
"searchAndScanMedication": {"en": "SEARCH & SCAN FOR MEDICATION", "ar": "البحث والمسح للأدوية"},
"shopByBrands": {"en": "Shop by Brands", "ar": "تسوق حسب الماركات"},
@ -606,19 +609,39 @@ const Map localizedValues = {
"gained": {"en": "GAINED", "ar": "المكتسب"},
"consumed": {"en": "Consumed", "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": "تحقق من المستفيد"},
"beneficiaryName": {"en": "Beneficiary Name", "ar": "اسم المستفيد"},
"accountActivation": {"en": "Account Activation", "ar": "تفعيل الحساب"},
"lakumTransfer": {"en": "Lakum Transfer", "ar": "تفعيل الحساب"},
"lakumTransfer": {"en": "Lakum Transfer", "ar": "تحويل نقاط لكم"},
"acceptLbl": {"en": "Accept", "ar": "موافقة"},
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
"select": {"en": "Select", "ar": "يختار"},
"select": {"en": "Select", "ar": "اختر"},
"i-am": {"en": "I am", "ar": "أنا"},
"years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {"en": "Drag point to change your age", "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": "اعادة تعيين"},
"apply": {"en": "Apply", "ar": "تطبيق"},
"viewCategorise": {"en": "View All Categories", "ar": "عرض جميع الفئات"},
@ -1031,6 +1054,7 @@ const Map localizedValues = {
"no-data": {"en": "No data found", "ar": "لاتوجد بيانات"},
"insurance-details": {"en": "Insurance Details", "ar": "تفاصيل التأمين"},
"nearest-hospital": {"en": "Nearest Hospital", "ar": "أقرب مستشفى"},
"submitReview": {"en": "Your review has been Submitted successfully", "ar": "تم إرسال التقييم بنجاح"},
"request-sent": {"en": "Request sent successfully", "ar": "تم إرسال الطلب بنجاح"},
"message-sent": {"en": "Message sent successfully", "ar": "تم إرسال الرسالة بنجاح"},
"sent-on": {"en": "Sent on", "ar": "أرسلت في"},
@ -1143,7 +1167,7 @@ const Map localizedValues = {
"triglycerides": {"en": "Triglycerides", "ar": "الدهون الثلاثية"},
"fatInBlood": {"en": "Fat in Blood", "ar": ""},
"convertFrom": {"en": "Convert from", "ar": "تحويل من"},
"calculate": {"en": "calculate", "ar": "احسب"},
"calculate": {"en": "Calculate", "ar": "احسب"},
"enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"},
"result": {"en": "Result", "ar": "النتيجة"},
"sort": {"en": "Sort", "ar": "فرز"},
@ -1189,8 +1213,8 @@ const Map localizedValues = {
"ovulation": {"en": "Ovulation", "ar": "الإباضة"},
"delivery": {"en": "Delivery", "ar": "الولادة"},
"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'",
"ar": "حساب قيمة مؤشر كتلة الجسم وحالة الوزن لتحديد الوزن الصحي. \n وغير مناسب للأطفال والنساء الحوامل أو المرضعات"
"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": "احسب قيمة مؤشر كتلة الجسم وحالة الوزن لتحديد الوزن الصحي. غير مناسب للأطفال والنساء الحوامل أو المرضعات"
},
"selectUnit": {"en": "Select Unit", "ar": "اختر الوحدة"},
"feet": {"en": "Feet", "ar": "قدم"},
@ -1619,4 +1643,88 @@ const Map localizedValues = {
"bodyFatTitle": {"en": "Body Fat", "ar": " الدهون في الجسم"},
"cholesTitle": {"en": "Blood Cholesterol", "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 {
String statusText;
int paymentStatus;
num paymentStatus;
dynamic clientRequestid;
dynamic paymentStatusText;
dynamic projectName;
String nearestProjectName;
double paymentAmount;
num paymentAmount;
WFOrder wFOrder;
String serviceText;
bool isSentForApproval;
int exaCartOrderId;
num exaCartOrderId;
String exaCartGUID;
bool isTimer;
int timeSeconds;
int totalPendingSeconds;
int timeMinute;
int timeHour;
int timeTotalSeconds;
int timeTotalMinute;
int timeTotalHour;
num timeSeconds;
num totalPendingSeconds;
num timeMinute;
num timeHour;
num timeTotalSeconds;
num timeTotalMinute;
num timeTotalHour;
dynamic approvalStatus;
bool isActive;
int clickButton;
num clickButton;
dynamic orderHistory;
String pickupLocation;
String dropOffLocation;
@ -28,22 +29,21 @@ class AmbulanceRequestOrdersModel {
String doctorName;
String branch;
String time;
dynamic notes;
int id;
String patientId;
int patientOutSa;
String notes;
num iD;
num patientId;
num patientOutSa;
bool isOutPatient;
int projectId;
int nearestProjectId;
num projectId;
num nearestProjectId;
dynamic longitude;
dynamic latitude;
dynamic appointmentNo;
dynamic dischargeId;
int statusId;
int serviceId;
int channel;
num statusId;
num serviceId;
num channel;
Orderpayment orderpayment;
dynamic orderselectedservice;
dynamic wforder;
dynamic orderapprovalobj;
String created;
@ -54,266 +54,293 @@ class AmbulanceRequestOrdersModel {
AmbulanceRequestOrdersModel(
{this.statusText,
this.paymentStatus,
this.clientRequestid,
this.paymentStatusText,
this.projectName,
this.nearestProjectName,
this.paymentAmount,
this.wFOrder,
this.serviceText,
this.isSentForApproval,
this.exaCartOrderId,
this.isTimer,
this.timeSeconds,
this.totalPendingSeconds,
this.timeMinute,
this.timeHour,
this.timeTotalSeconds,
this.timeTotalMinute,
this.timeTotalHour,
this.approvalStatus,
this.isActive,
this.clickButton,
this.orderHistory,
this.pickupLocation,
this.dropOffLocation,
this.clinicName,
this.doctorName,
this.branch,
this.time,
this.notes,
this.id,
this.patientId,
this.patientOutSa,
this.isOutPatient,
this.projectId,
this.nearestProjectId,
this.longitude,
this.latitude,
this.appointmentNo,
this.dischargeId,
this.statusId,
this.serviceId,
this.channel,
this.orderpayment,
this.orderselectedservice,
this.wforder,
this.orderapprovalobj,
this.created,
this.createdBy,
this.modified,
this.modifiedBy,
this.isDeleted});
this.paymentStatus,
this.clientRequestid,
this.paymentStatusText,
this.projectName,
this.nearestProjectName,
this.paymentAmount,
this.wFOrder,
this.serviceText,
this.isSentForApproval,
this.exaCartOrderId,
this.exaCartGUID,
this.isTimer,
this.timeSeconds,
this.totalPendingSeconds,
this.timeMinute,
this.timeHour,
this.timeTotalSeconds,
this.timeTotalMinute,
this.timeTotalHour,
this.approvalStatus,
this.isActive,
this.clickButton,
this.orderHistory,
this.pickupLocation,
this.dropOffLocation,
this.clinicName,
this.doctorName,
this.branch,
this.time,
this.notes,
this.iD,
this.patientId,
this.patientOutSa,
this.isOutPatient,
this.projectId,
this.nearestProjectId,
this.longitude,
this.latitude,
this.appointmentNo,
this.dischargeId,
this.statusId,
this.serviceId,
this.channel,
this.orderpayment,
this.wforder,
this.orderapprovalobj,
this.created,
this.createdBy,
this.modified,
this.modifiedBy,
this.isDeleted});
AmbulanceRequestOrdersModel.fromJson(Map<String, dynamic> json) {
statusText = json['statusText'];
paymentStatus = json['paymentStatus'];
clientRequestid = json['clientRequestid'];
paymentStatusText = json['paymentStatusText'];
projectName = json['projectName'];
nearestProjectName = json['nearestProjectName'];
paymentAmount = json['paymentAmount'];
wFOrder = json['wF_order'] != null ? new WFOrder.fromJson(json['wF_order']) : null;
serviceText = json['serviceText'];
statusText = json['StatusText'];
paymentStatus = json['PaymentStatus'];
clientRequestid = json['ClientRequestid'];
paymentStatusText = json['PaymentStatusText'];
projectName = json['ProjectName'];
nearestProjectName = json['NearestProjectName'];
paymentAmount = json['PaymentAmount'];
wFOrder = json['WF_order'] != null
? new WFOrder.fromJson(json['WF_order'])
: null;
serviceText = json['ServiceText'];
isSentForApproval = json['isSentForApproval'];
exaCartOrderId = json['exaCart_OrderId'];
exaCartOrderId = json['ExaCart_OrderId'];
exaCartGUID = json['ExaCart_GUID'];
isTimer = json['isTimer'];
timeSeconds = json['timeSeconds'];
totalPendingSeconds = json['totalPendingSeconds'];
timeMinute = json['timeMinute'];
timeHour = json['timeHour'];
timeTotalSeconds = json['timeTotalSeconds'];
timeTotalMinute = json['timeTotalMinute'];
timeTotalHour = json['timeTotalHour'];
approvalStatus = json['approvalStatus'];
timeSeconds = json['TimeSeconds'];
totalPendingSeconds = json['TotalPendingSeconds'];
timeMinute = json['TimeMinute'];
timeHour = json['TimeHour'];
timeTotalSeconds = json['TimeTotalSeconds'];
timeTotalMinute = json['TimeTotalMinute'];
timeTotalHour = json['TimeTotalHour'];
approvalStatus = json['ApprovalStatus'];
isActive = json['isActive'];
clickButton = json['clickButton'];
orderHistory = json['orderHistory'];
pickupLocation = json['pickupLocation'];
dropOffLocation = json['dropOffLocation'];
clickButton = json['ClickButton'];
orderHistory = json['OrderHistory'];
pickupLocation = json['PickupLocation'];
dropOffLocation = json['DropOffLocation'];
clinicName = json['clinicName'];
doctorName = json['doctorName'];
branch = json['branch'];
time = json['time'];
notes = json['notes'];
id = json['id'];
patientId = json['patientId'];
patientOutSa = json['patientOutSa'];
isOutPatient = json['isOutPatient'];
projectId = json['projectId'];
nearestProjectId = json['nearestProjectId'];
longitude = json['longitude'];
latitude = json['latitude'];
appointmentNo = json['appointmentNo'];
dischargeId = json['dischargeId'];
statusId = json['statusId'];
serviceId = json['serviceId'];
channel = json['channel'];
orderpayment = json['orderpayment'] != null ? new Orderpayment.fromJson(json['orderpayment']) : null;
orderselectedservice = json['orderselectedservice'];
doctorName = json['DoctorName'];
branch = json['Branch'];
time = json['Time'];
notes = json['Notes'];
iD = json['ID'];
patientId = json['PatientId'];
patientOutSa = json['PatientOutSa'];
isOutPatient = json['IsOutPatient'];
projectId = json['ProjectId'];
nearestProjectId = json['NearestProjectId'];
longitude = json['Longitude'];
latitude = json['Latitude'];
appointmentNo = json['AppointmentNo'];
dischargeId = json['DischargeId'];
statusId = json['StatusId'];
serviceId = json['ServiceId'];
channel = json['Channel'];
orderpayment = json['orderpayment'] != null
? new Orderpayment.fromJson(json['orderpayment'])
: null;
wforder = json['wforder'];
orderapprovalobj = json['orderapprovalobj'];
created = json['created'];
createdBy = json['createdBy'];
modified = json['modified'];
modifiedBy = json['modifiedBy'];
isDeleted = json['isDeleted'];
created = json['Created'];
createdBy = json['CreatedBy'];
modified = json['Modified'];
modifiedBy = json['ModifiedBy'];
isDeleted = json['IsDeleted'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['statusText'] = this.statusText;
data['paymentStatus'] = this.paymentStatus;
data['clientRequestid'] = this.clientRequestid;
data['paymentStatusText'] = this.paymentStatusText;
data['projectName'] = this.projectName;
data['nearestProjectName'] = this.nearestProjectName;
data['paymentAmount'] = this.paymentAmount;
data['StatusText'] = this.statusText;
data['PaymentStatus'] = this.paymentStatus;
data['ClientRequestid'] = this.clientRequestid;
data['PaymentStatusText'] = this.paymentStatusText;
data['ProjectName'] = this.projectName;
data['NearestProjectName'] = this.nearestProjectName;
data['PaymentAmount'] = this.paymentAmount;
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['exaCart_OrderId'] = this.exaCartOrderId;
data['ExaCart_OrderId'] = this.exaCartOrderId;
data['ExaCart_GUID'] = this.exaCartGUID;
data['isTimer'] = this.isTimer;
data['timeSeconds'] = this.timeSeconds;
data['totalPendingSeconds'] = this.totalPendingSeconds;
data['timeMinute'] = this.timeMinute;
data['timeHour'] = this.timeHour;
data['timeTotalSeconds'] = this.timeTotalSeconds;
data['timeTotalMinute'] = this.timeTotalMinute;
data['timeTotalHour'] = this.timeTotalHour;
data['approvalStatus'] = this.approvalStatus;
data['TimeSeconds'] = this.timeSeconds;
data['TotalPendingSeconds'] = this.totalPendingSeconds;
data['TimeMinute'] = this.timeMinute;
data['TimeHour'] = this.timeHour;
data['TimeTotalSeconds'] = this.timeTotalSeconds;
data['TimeTotalMinute'] = this.timeTotalMinute;
data['TimeTotalHour'] = this.timeTotalHour;
data['ApprovalStatus'] = this.approvalStatus;
data['isActive'] = this.isActive;
data['clickButton'] = this.clickButton;
data['orderHistory'] = this.orderHistory;
data['pickupLocation'] = this.pickupLocation;
data['dropOffLocation'] = this.dropOffLocation;
data['ClickButton'] = this.clickButton;
data['OrderHistory'] = this.orderHistory;
data['PickupLocation'] = this.pickupLocation;
data['DropOffLocation'] = this.dropOffLocation;
data['clinicName'] = this.clinicName;
data['doctorName'] = this.doctorName;
data['branch'] = this.branch;
data['time'] = this.time;
data['notes'] = this.notes;
data['id'] = this.id;
data['patientId'] = this.patientId;
data['patientOutSa'] = this.patientOutSa;
data['isOutPatient'] = this.isOutPatient;
data['projectId'] = this.projectId;
data['nearestProjectId'] = this.nearestProjectId;
data['longitude'] = this.longitude;
data['latitude'] = this.latitude;
data['appointmentNo'] = this.appointmentNo;
data['dischargeId'] = this.dischargeId;
data['statusId'] = this.statusId;
data['serviceId'] = this.serviceId;
data['channel'] = this.channel;
data['DoctorName'] = this.doctorName;
data['Branch'] = this.branch;
data['Time'] = this.time;
data['Notes'] = this.notes;
data['ID'] = this.iD;
data['PatientId'] = this.patientId;
data['PatientOutSa'] = this.patientOutSa;
data['IsOutPatient'] = this.isOutPatient;
data['ProjectId'] = this.projectId;
data['NearestProjectId'] = this.nearestProjectId;
data['Longitude'] = this.longitude;
data['Latitude'] = this.latitude;
data['AppointmentNo'] = this.appointmentNo;
data['DischargeId'] = this.dischargeId;
data['StatusId'] = this.statusId;
data['ServiceId'] = this.serviceId;
data['Channel'] = this.channel;
if (this.orderpayment != null) {
data['orderpayment'] = this.orderpayment.toJson();
}
data['orderselectedservice'] = this.orderselectedservice;
data['wforder'] = this.wforder;
data['orderapprovalobj'] = this.orderapprovalobj;
data['created'] = this.created;
data['createdBy'] = this.createdBy;
data['modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted;
data['Created'] = this.created;
data['CreatedBy'] = this.createdBy;
data['Modified'] = this.modified;
data['ModifiedBy'] = this.modifiedBy;
data['IsDeleted'] = this.isDeleted;
return data;
}
}
class WFOrder {
dynamic wfButtonsDTO;
int id;
int orderId;
int previousStep;
int nextStep;
int serviceId;
dynamic order;
Null wfButtonsDTO;
num iD;
num orderId;
num previousStep;
num nextStep;
num serviceId;
Null order;
String created;
dynamic createdBy;
dynamic modified;
dynamic modifiedBy;
Null createdBy;
Null modified;
Null modifiedBy;
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) {
wfButtonsDTO = json['wf_ButtonsDTO'];
id = json['id'];
orderId = json['orderId'];
previousStep = json['previousStep'];
nextStep = json['nextStep'];
serviceId = json['serviceId'];
order = json['order'];
created = json['created'];
createdBy = json['createdBy'];
modified = json['modified'];
modifiedBy = json['modifiedBy'];
isDeleted = json['isDeleted'];
iD = json['ID'];
orderId = json['OrderId'];
previousStep = json['PreviousStep'];
nextStep = json['NextStep'];
serviceId = json['ServiceId'];
order = json['Order'];
created = json['Created'];
createdBy = json['CreatedBy'];
modified = json['Modified'];
modifiedBy = json['ModifiedBy'];
isDeleted = json['IsDeleted'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['wf_ButtonsDTO'] = this.wfButtonsDTO;
data['id'] = this.id;
data['orderId'] = this.orderId;
data['previousStep'] = this.previousStep;
data['nextStep'] = this.nextStep;
data['serviceId'] = this.serviceId;
data['order'] = this.order;
data['created'] = this.created;
data['createdBy'] = this.createdBy;
data['modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted;
data['ID'] = this.iD;
data['OrderId'] = this.orderId;
data['PreviousStep'] = this.previousStep;
data['NextStep'] = this.nextStep;
data['ServiceId'] = this.serviceId;
data['Order'] = this.order;
data['Created'] = this.created;
data['CreatedBy'] = this.createdBy;
data['Modified'] = this.modified;
data['ModifiedBy'] = this.modifiedBy;
data['IsDeleted'] = this.isDeleted;
return data;
}
}
class Orderpayment {
int id;
int orderId;
dynamic clientRequestId;
double totalAmount;
int paymentStatus;
dynamic order;
num iD;
num orderId;
Null clientRequestId;
num totalAmount;
num paymentStatus;
Null order;
String created;
dynamic createdBy;
dynamic modified;
dynamic modifiedBy;
Null createdBy;
Null modified;
Null modifiedBy;
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) {
id = json['id'];
orderId = json['orderId'];
clientRequestId = json['clientRequestId'];
totalAmount = json['totalAmount'];
paymentStatus = json['paymentStatus'];
order = json['order'];
created = json['created'];
createdBy = json['createdBy'];
modified = json['modified'];
modifiedBy = json['modifiedBy'];
isDeleted = json['isDeleted'];
iD = json['ID'];
orderId = json['OrderId'];
clientRequestId = json['ClientRequestId'];
totalAmount = json['TotalAmount'];
paymentStatus = json['PaymentStatus'];
order = json['Order'];
created = json['Created'];
createdBy = json['CreatedBy'];
modified = json['Modified'];
modifiedBy = json['ModifiedBy'];
isDeleted = json['IsDeleted'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['orderId'] = this.orderId;
data['clientRequestId'] = this.clientRequestId;
data['totalAmount'] = this.totalAmount;
data['paymentStatus'] = this.paymentStatus;
data['order'] = this.order;
data['created'] = this.created;
data['createdBy'] = this.createdBy;
data['modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted;
data['ID'] = this.iD;
data['OrderId'] = this.orderId;
data['ClientRequestId'] = this.clientRequestId;
data['TotalAmount'] = this.totalAmount;
data['PaymentStatus'] = this.paymentStatus;
data['Order'] = this.order;
data['Created'] = this.created;
data['CreatedBy'] = this.createdBy;
data['Modified'] = this.modified;
data['ModifiedBy'] = this.modifiedBy;
data['IsDeleted'] = this.isDeleted;
return data;
}
}

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

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

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

@ -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 subtotalVatAmount;
double subtotalVatRate;
double totalAmount;
List<ShoppingCart> shoppingCarts;
ShoppingCartResponse(
@ -16,7 +17,8 @@ class ShoppingCartResponse {
this.subtotal=0.0,
this.subtotalWithVat = 0.0,
this.subtotalVatAmount = 0.0,
this.subtotalVatRate = 0.0 ,
this.subtotalVatRate = 0.0,
this.totalAmount = 0.0,
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;
// 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();
response['response'].forEach((data) {
cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data));
@ -67,7 +67,7 @@ class CMCService extends BaseService {
Future getCmcAllPresOrdersRC() async {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel();
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();
cmcAllOrderDetail.clear();
@ -122,7 +122,7 @@ class CMCService extends BaseService {
Future updateCmcPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
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;
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -133,7 +133,7 @@ class CMCService extends BaseService {
Future<String> insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async {
hasError = false;
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;
reqId = response['response'].toString();
}, onFailure: (String error, int statusCode) {

@ -38,7 +38,7 @@ class HomeHealthCareService extends BaseService {
Future getHHCAllServicesRC(HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async {
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();
response['response'].forEach((data) {
hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data));
@ -52,7 +52,7 @@ class HomeHealthCareService extends BaseService {
Future getHHCAllPresOrdersRC() async {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel();
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();
hhcAllOrderDetail.clear();
response['response'].forEach((data) {
@ -106,7 +106,7 @@ class HomeHealthCareService extends BaseService {
Future updateHHCPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
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;
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -127,7 +127,7 @@ class HomeHealthCareService extends BaseService {
Future insertHHCOrderRC({PatientERInsertPresOrderRequestModel order}) async {
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;
requestNo = response["response"];
}, onFailure: (String error, int statusCode) {

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

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

@ -28,9 +28,9 @@ class AmService extends BaseService {
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
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();
response['data']['transportationservices'].forEach((item) {
response['response']['transportationservices'].forEach((item) {
amModelList.add(PatientERTransportationMethod.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
@ -69,18 +69,18 @@ class AmService extends BaseService {
pickUpRequestPresOrder = null;
Map<String, dynamic> body = Map();
body['patientId'] = patientID.toString();
body['PatientID'] = patientID.toString();
body['patientId'] = patientID;
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();
hasPendingOrder = false;
pendingOrderID = 0;
pendingAmbulanceRequestOrder = null;
response['data'].forEach((item) {
response['response'].forEach((item) {
patientAmbulanceRequestOrdersList.add(AmbulanceRequestOrdersModel.fromJson(item));
if (item['statusId'] == 1) {
if (item['StatusId'] == 1) {
hasPendingOrder = true;
pendingOrderID = item['orderpayment']['id'];
pendingOrderStatus = item['statusText'];
@ -127,14 +127,14 @@ class AmService extends BaseService {
}, body: body);
}
Future updatePressOrderRC({@required int presOrderID, @required String patientID}) async {
Future updatePressOrderRC({@required int presOrderID, @required int patientID}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['Id'] = presOrderID;
body['StatusId'] = 6;
body['ClickButton'] = 14;
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;
super.error = error;
}, body: body);
@ -146,7 +146,7 @@ class AmService extends BaseService {
var body = patientER.toJson();
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;
super.error = error;
}, body: body);

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

@ -28,7 +28,7 @@ class MyBalanceService extends BaseService {
locator<AuthenticatedUserObject>();
MyBalanceService() {
getFamilyFiles();
// getFamilyFiles();
}
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/prescriptions/Prescriptions.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_enh.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
@ -18,6 +19,7 @@ class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List();
List<PrescriptionReportINP> prescriptionReportListINP = List();
List<GetCMCAllOrdersResponseModel> prescriptionsOrderList = List();
List<PrescriptionInfoRCModel> prescriptionsOrderListRC = List();
var isMedDeliveryAllowed;
Future getPrescriptions() async {
@ -49,6 +51,20 @@ class PrescriptionsService extends BaseService {
}, 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 {
prescriptionsOrderList.clear();
Map<String, dynamic> body = Map();
@ -162,7 +178,6 @@ class PrescriptionsService extends BaseService {
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
///This logic copy from the old app from class [order-history.component.ts] in line 45
bool isInPatient = false;
prescriptionsList.forEach((element) {
if (prescriptionsOrder.appointmentNo == "0") {
@ -184,8 +199,6 @@ class PrescriptionsService extends BaseService {
_requestPrescriptionReportEnh.setupID = element.setupID;
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
isInPatient = element.isInOutPatient;
///call inpGetPrescriptionReport
}
}
});
@ -212,6 +225,18 @@ class PrescriptionsService extends BaseService {
}, 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 {
hasError = false;
Map<String, dynamic> body = Map();

@ -4,6 +4,7 @@ import 'dart:developer';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.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/CreateCustomerRequestModel.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/tamara_payment_option.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/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
var packagesAuthHeader = <String,String>{'Authorization' : ''};
Map<String, String> packagesAuthHeader = {};
class OffersAndPackagesServices extends BaseService {
AuthenticatedUser patientUser;
List<PackagesCategoriesResponseModel> categoryList = List();
@ -31,9 +31,10 @@ class OffersAndPackagesServices extends BaseService {
List<PackagesResponseModel> bestSellerList = List();
List<PackagesResponseModel> bannersList = List();
List<PackagesCartItemsResponseModel> cartItemList = List();
List<HospitalsModel> _hospitals = List();
List<HospitalsModel> get hospitals => _hospitals;
String cartItemCount = "";
PackagesCustomerResponseModel customer;
Future<List<PackagesCategoriesResponseModel>> getAllCategories(OffersCategoriesRequestModel request) async {
@ -47,8 +48,7 @@ class OffersAndPackagesServices extends BaseService {
categoryList.add(PackagesCategoriesResponseModel().fromJson(json));
});
}
}, onFailure: (String error, int statusCode) {
}, queryParams: request.toFlatMap());
}, onFailure: (String error, int statusCode) {}, queryParams: request.toFlatMap());
return categoryList;
}
@ -57,7 +57,7 @@ class OffersAndPackagesServices extends BaseService {
Future errorThrow;
request.sinceId = (productList.isNotEmpty) ? productList.last.id : 0;
productList = List();
var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS;
await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
@ -67,15 +67,13 @@ class OffersAndPackagesServices extends BaseService {
productList.add(PackagesResponseModel().fromJson(json));
});
}
}, onFailure: (String error, int statusCode) {
}, queryParams: request.toFlatMap());
}, onFailure: (String error, int statusCode) {}, queryParams: request.toFlatMap());
return productList;
}
Future<List<TamaraPaymentOption>> getTamaraOptions({@required BuildContext context, @required bool showLoading = true}) async {
if(tamaraPaymentOptions != null && tamaraPaymentOptions.isNotEmpty)
return tamaraPaymentOptions;
if (tamaraPaymentOptions != null && tamaraPaymentOptions.isNotEmpty) return tamaraPaymentOptions;
var url = EXA_CART_API_BASE_URL + PACKAGES_TAMARA_OPT;
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 {
var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS;
await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
latestOffersList.clear();
if (statusCode == 200) {
var jsonResponse = json.decode(stringResponse);
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 {
var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS;
await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
bestSellerList.clear();
if (statusCode == 200) {
var jsonResponse = json.decode(stringResponse);
jsonResponse['products'].forEach((json) {
@ -126,7 +124,6 @@ class OffersAndPackagesServices extends BaseService {
return bestSellerList;
}
Future<List<PackagesResponseModel>> getBanners({@required OffersProductsRequestModel request, @required BuildContext context, @required bool showLoading = true}) async {
var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS;
await baseAppClient.simpleGet(url, headers: packagesAuthHeader, onSuccess: (dynamic stringResponse, int statusCode) {
@ -143,15 +140,13 @@ class OffersAndPackagesServices extends BaseService {
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 totalCalls = 3;
completedAll(){
var totalCalls = 2;
completedAll() {
finished++;
if(completion != null && finished == totalCalls) {
if (completion != null && finished == totalCalls) {
_hideLoading(context, showLoading);
completion();
}
@ -160,57 +155,56 @@ class OffersAndPackagesServices extends BaseService {
_showLoading(context, showLoading);
final auth_token = await baseAppClient.generatePackagesToken();
if(auth_token == null){
if (auth_token == null) {
throw 'Something went wrong while authentication, Please try again letter';
}
packagesAuthHeader["Authorization"] = 'Bearer $auth_token';
// Check and Create Customer
if(patientUser != null){
if (patientUser != null) {
customer = await getCurrentCustomer(context: context, showLoading: showLoading);
if(customer == null){
if (customer == null) {
createCustomer(PackagesCustomerRequestModel.fromUser(patientUser), context: context);
}
}
// Performing Parallel Request on same time
// # 1
getBestSellers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){
completedAll();
getBestSellers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value) {
completedAll();
});
// # 2
getLatestOffers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){
getLatestOffers(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value) {
completedAll();
});
// # 3
getBanners(request: OffersProductsRequestModel(), context: context, showLoading: false).then((value){
completedAll();
});
// getBanners(
// request: OffersProductsRequestModel(),
// context: context,
// showLoading: false)
// .then((value) {
// completedAll();
// });
}
// --------------------
// Create Customer
// --------------------
Future createCustomer(PackagesCustomerRequestModel request, {@required BuildContext context, bool showLoading = true, Function(bool) completion }) async{
if(customer != null)
return Future.value(customer);
Future createCustomer(PackagesCustomerRequestModel request, {@required BuildContext context, bool showLoading = true, Function(bool) completion}) async {
if (customer != null) return Future.value(customer);
customer = null;
Future errorThrow;
_showLoading(context, showLoading);
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 customerJson = jsonResponse['customers'].first;
customer = PackagesCustomerResponseModel.fromJson(customerJson);
}, onFailure: (String error, int statusCode){
}, onFailure: (String error, int statusCode) {
errorThrow = Future.error(error);
log(error);
});
@ -221,37 +215,33 @@ class OffersAndPackagesServices extends BaseService {
return errorThrow ?? customer;
}
Future<PackagesCustomerResponseModel> getCurrentCustomer({@required BuildContext context, bool showLoading = true}) async{
if(customer != null)
return Future.value(customer);
Future<PackagesCustomerResponseModel> getCurrentCustomer({@required BuildContext context, bool showLoading = true}) async {
if (customer != null) return Future.value(customer);
_showLoading(context, showLoading);
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 customerJson = jsonResponse['customers'].first;
customer = PackagesCustomerResponseModel.fromJson(customerJson);
}, onFailure: (String error, int statusCode){
}, onFailure: (String error, int statusCode) {
log(error);
});
_hideLoading(context, showLoading);
return customer;
return customer;
}
// --------------------
// 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;
cartItemList.clear();
_showLoading(context, showLoading);
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) {
_hideLoading(context, showLoading);
@ -259,17 +249,16 @@ class OffersAndPackagesServices extends BaseService {
jsonResponse['shopping_carts'].forEach((json) {
cartItemList.add(PackagesCartItemsResponseModel.fromJson(json));
});
}, onFailure: (String error, int statusCode) {
_hideLoading(context, showLoading);
log(error);
errorThrow = Future.error({"error":error, "statusCode":statusCode});
errorThrow = Future.error({"error": error, "statusCode": statusCode});
}, queryParams: null);
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;
ResponseModel<PackagesCartItemsResponseModel> response;
@ -277,15 +266,14 @@ class OffersAndPackagesServices extends BaseService {
_showLoading(context, showLoading);
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);
var jsonResponse = json.decode(stringResponse);
var jsonCartItem = jsonResponse["shopping_carts"][0];
response = ResponseModel(status: true, data: PackagesCartItemsResponseModel.fromJson(jsonCartItem), error: null);
cartItemCount = (jsonResponse['count'] ?? 0).toString();
}, onFailure: (String error, int statusCode){
}, onFailure: (String error, int statusCode) {
_hideLoading(context, showLoading);
errorThrow = Future.error(ResponseModel(status: true, data: null, error: error));
});
@ -293,39 +281,35 @@ class OffersAndPackagesServices extends BaseService {
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;
_showLoading(context, showLoading);
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);
var jsonResponse = json.decode(stringResponse);
}, onFailure: (String error, int statusCode){
}, onFailure: (String error, int statusCode) {
_hideLoading(context, showLoading);
log(error);
errorThrow = Future.error({"error":error, "statusCode":statusCode});
errorThrow = Future.error({"error": error, "statusCode": statusCode});
});
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;
_showLoading(context, showLoading);
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);
// var jsonResponse = json.decode(stringResponse);
}, onFailure: (String error, int statusCode){
}, onFailure: (String error, int statusCode) {
_hideLoading(context, showLoading);
log(error);
errorThrow = Future.error({"error":error, "statusCode":statusCode});
errorThrow = Future.error({"error": error, "statusCode": statusCode});
});
return errorThrow ?? true;
@ -334,29 +318,28 @@ class OffersAndPackagesServices extends BaseService {
// --------------------
// 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;
Map<dynamic,dynamic> jsonBody = {
"customer_id" : customer.id,
"billing_address": {
"email": patientUser.emailAddress,
"phone_number": patientUser.mobileNumber
},
Map<dynamic, dynamic> jsonBody = {
"customer_id": customer.id,
"project_id": projectID,
"billing_address": {"email": patientUser.emailAddress, "phone_number": patientUser.mobileNumber},
};
jsonBody.addAll(paymentParams);
jsonBody = {'order' : jsonBody};
jsonBody = {'order': jsonBody};
print(jsonBody);
int order_id;
_showLoading(context, showLoading);
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);
var jsonResponse = json.decode(stringResponse);
order_id = jsonResponse['orders'][0]['id'];
}, onFailure: (String error, int statusCode){
}, onFailure: (String error, int statusCode) {
_hideLoading(context, showLoading);
log(error);
errorThrow = Future.error(error);
@ -365,7 +348,7 @@ class OffersAndPackagesServices extends BaseService {
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;
ResponseModel<PackagesOrderResponseModel> response;
@ -377,23 +360,39 @@ class OffersAndPackagesServices extends BaseService {
var jsonResponse = json.decode(stringResponse);
var jsonOrder = jsonResponse['orders'][0];
response = ResponseModel(status: true, data: PackagesOrderResponseModel.fromJson(jsonOrder));
}, onFailure: (String error, int statusCode) {
_hideLoading(context, showLoading);
errorThrow = Future.error(ResponseModel(status: false,error: error));
errorThrow = Future.error(ResponseModel(status: false, error: error));
}, queryParams: null);
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){
if(flag)
GifLoaderDialogUtils.showMyDialog(context);
_showLoading(BuildContext context, bool flag) {
if (flag) GifLoaderDialogUtils.showMyDialog(context);
}
_hideLoading(BuildContext context, bool flag){
if(flag)
GifLoaderDialogUtils.hideDialog(context);
}
_hideLoading(BuildContext context, bool flag) {
if (flag) GifLoaderDialogUtils.hideDialog(context);
}

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

@ -19,14 +19,19 @@ class PharmacyModuleService extends BaseService {
List<Manufacturer> manufacturerList = List();
List<PharmacyProduct> bestSellerProducts = List();
List<PharmacyProduct> lastVisitedProducts = List();
List<PharmacyProduct> mostViewedProducts = List();
Future makeVerifyCustomer(dynamic data) async {
Map<String, String> queryParams = {'FileNumber': data['PatientID'].toString()};
Map<String, String> queryParams = {
'FileNumber': data['PatientID'].toString()
};
hasError = false;
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) {
sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
sharedPref.setString(
PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
print(response);
} else {
await createUser();
@ -52,12 +57,13 @@ class PharmacyModuleService extends BaseService {
};
hasError = false;
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']) {
} else {
customerInfo = CustomerInfo.fromJson(response);
await sharedPref.setObject(PHARMACY_CUSTOMER_ID, customerInfo.customerId);
await sharedPref.setObject(
PHARMACY_CUSTOMER_ID, customerInfo.customerId);
}
// await generatePharmacyToken();
}, onFailure: (String error, int statusCode) {
@ -77,9 +83,11 @@ class PharmacyModuleService extends BaseService {
};
hasError = false;
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) {
await sharedPref.setString(PHARMACY_AUTORZIE_TOKEN, response['token'].toString());
await sharedPref.setString(
PHARMACY_AUTORZIE_TOKEN, response['token'].toString());
}
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -93,7 +101,8 @@ class PharmacyModuleService extends BaseService {
Future getBannerListList() async {
hasError = false;
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();
response['images'].forEach((item) {
bannerItems.add(PharmacyImageObject.fromJson(item));
@ -111,7 +120,8 @@ class PharmacyModuleService extends BaseService {
if (manufacturerList.isNotEmpty) return;
Map<String, String> queryParams = {'page': '1', 'limit': '8'};
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();
response['manufacturer'].forEach((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',
};
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();
response['products'].forEach((item) {
bestSellerProducts.add(PharmacyProduct.fromJson(item));
@ -160,7 +171,9 @@ class PharmacyModuleService extends BaseService {
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
// lastVisited = "2458,4561";
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();
response['products'].forEach((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/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
class PrescriptionService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences();
@ -11,14 +10,14 @@ class PrescriptionService extends BaseService {
String errorMsg = '';
List<Prescriptions> _prescriptionsList = List();
List<Prescriptions> get prescriptionsList => _prescriptionsList;
Future getPrescription() async {
hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(PRESCRIPTION,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(PRESCRIPTION, onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((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;
_parentProductsList.clear();
if (isLoading == false) {
_parentProductsList.clear();
}
String endPoint = id != null
? GET_PARENT_PRODUCTS + "$id" + '&page=1&limit=50'
? GET_PARENT_PRODUCTS + "$id" + '&page=' + '$pageNumber' + '&limit=24'
: GET_PARENT_PRODUCTS + "";
await baseAppClient.getPharmacy(
endPoint,
@ -155,6 +158,7 @@ class PharmacyCategoriseService extends BaseService {
response['products'].forEach((item) {
_parentProductsList.add(PharmacyProduct.fromJson(item));
});
//pageNumber++;
},
onFailure: (String error, int statusCode) {
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 {
setState(ViewState.Busy);
// 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) {
error = _amService.error;
setState(ViewState.Error);

@ -62,7 +62,7 @@ class RRTViewModel extends BaseViewModel {
// body['OrderServiceID'] = 5;
var localRes;
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'];
}, onFailure: (error, statusCode) {
AppToast.showErrorToast(message: error);
@ -94,7 +94,7 @@ class RRTViewModel extends BaseViewModel {
}
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"];
rrtServiceData.completedOrders.clear();
rrtServiceData.pendingOrders.clear();
@ -159,9 +159,9 @@ class RRTViewModel extends BaseViewModel {
}
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;
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;
rrtServiceData.pendingOrders.remove(order);
}, onFailure: (error, statusCode) {

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

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.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_enh.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<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
List<PrescriptionInfoRCModel> get prescriptionsOrderListRC => _prescriptionsService.prescriptionsOrderListRC;
List<PrescriptionsList> get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
List<PrescriptionsList> prescriptionsOrderListByValue(filterValue) {
@ -131,8 +136,6 @@ class PrescriptionsViewModel extends BaseViewModel {
}
}
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
setState(ViewState.Busy);
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 {
setState(ViewState.Busy);
await _prescriptionsService.updatePressOrder(presOrderID: presOrderID);
// await _prescriptionsService.updatePressOrder(presOrderID: presOrderID);
await _prescriptionsService.updatePressOrderRC(presOrderID: presOrderID);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.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/PackagesCategoriesResponseModel.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 bannersList => service.bannersList;
List<PackagesCartItemsResponseModel> get cartItemList => service.cartItemList;
List<HospitalsModel> get hospitals => service.hospitals;
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/service/parmacyModule/order-preview-service.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 '../base_view_model.dart';
@ -19,18 +17,21 @@ class OrderPreviewViewModel extends BaseViewModel {
List<Addresses> get addresses => _orderService.addresses;
LacumAccountInformation get lacumInformation =>
_orderService.lacumInformation;
LacumAccountInformation get lacumInformation => _orderService.lacumInformation;
List<OrderDetailModel> get orderListModel => _orderService.orderList;
PharmacyModuleViewModel pharmacyModuleViewModel =
locator<PharmacyModuleViewModel>();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
ShoppingCartResponse cartResponse = ShoppingCartResponse();
PaymentCheckoutData paymentCheckoutData = PaymentCheckoutData();
double totalAdditionalShippingCharge = 0;
setShoppingCartResponse(ShoppingCartResponse cart) {
cartResponse = cart;
notifyListeners();
}
Future getOrderPreviewData() async {
setState(ViewState.Busy);
await _orderService.getAddresses();
@ -66,27 +67,27 @@ class OrderPreviewViewModel extends BaseViewModel {
}
}
Future<ShoppingCartResponse> changeProductQuantity(
ShoppingCart product) async {
setState(ViewState.Busy);
Future<ShoppingCartResponse> changeProductQuantity(ShoppingCart product) async {
setState(ViewState.BusyLocal);
var resp = await _orderService.changeProductQuantity(product.id, product);
var object = _handleGetShoppingCartResponse(resp);
if (_orderService.hasError) {
error = _orderService.error;
setState(ViewState.ErrorLocal);
} else {
var object = _handleGetShoppingCartResponse(resp);
setState(ViewState.Idle);
}
return object;
// return object;
}
Future<ShoppingCartResponse> deleteProduct(ShoppingCart product) async {
setState(ViewState.Busy);
setState(ViewState.BusyLocal);
var resp = await _orderService.deleteProduct(product.id);
var object = _handleGetShoppingCartResponse(resp);
if (_orderService.hasError) {
error = _orderService.error;
setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
@ -107,6 +108,7 @@ class OrderPreviewViewModel extends BaseViewModel {
}
ShoppingCartResponse _handleGetShoppingCartResponse(Map res) {
cartResponse.totalAmount = 0.0;
totalAdditionalShippingCharge = 0;
if (res == null) {
error = "response is null";
@ -120,12 +122,19 @@ class OrderPreviewViewModel extends BaseViewModel {
cartResponse.subtotalVatAmount = res["subtotal_vat_amount"];
cartResponse.subtotalVatRate = res["subtotal_vat_rate"];
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) {
ShoppingCart shoppingCart = ShoppingCart.fromJson(item);
cartResponse.shoppingCarts.add(shoppingCart);
totalAdditionalShippingCharge +=
shoppingCart.product.additionalShippingCharge;
totalAdditionalShippingCharge += shoppingCart.product.additionalShippingCharge;
});
if (paymentCheckoutData.shippingOption != null) cartResponse.totalAmount = (cartResponse.subtotalWithVat + totalAdditionalShippingCharge + paymentCheckoutData.shippingOption.rateVat);
return cartResponse;
}
@ -156,28 +165,27 @@ class OrderPreviewViewModel extends BaseViewModel {
return _orderService.getPaymentOptionName(paymentOption);
}
getInformationsByAddress() async {
await getLacumAccountInformation();
getInformationsByAddress(String identificationNo) async {
await getShippingOption();
await getLacumAccountInformation(identificationNo);
}
getLacumAccountInformation() async {
getLacumAccountInformation(String identificationNo) async {
setState(ViewState.Busy);
await _orderService.getLacumAccountInformation();
await _orderService.getLacumAccountInformation(identificationNo);
if (_orderService.hasError) {
error = _orderService.error;
setState(ViewState.Error);
} else {
getLacumGroupData();
if (_orderService.lacumInformation.yahalaAccountNo != 0) getLacumGroupData(identificationNo);
}
}
Future getLacumGroupData() async {
Future getLacumGroupData(String identificationNo) async {
setState(ViewState.Busy);
await _orderService.getLacumGroupInformation();
await _orderService.getLacumGroupInformation(identificationNo);
paymentCheckoutData.lacumInformation = _orderService.lacumGroupInformation;
paymentCheckoutData.usedLakumPoints = paymentCheckoutData
.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount;
paymentCheckoutData.usedLakumPoints = paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount;
if (_orderService.hasError) {
error = _orderService.error;
setState(ViewState.Error);
@ -188,9 +196,7 @@ class OrderPreviewViewModel extends BaseViewModel {
getShippingOption() async {
setState(ViewState.Busy);
await _orderService
.getShippingOption(paymentCheckoutData.address)
.then((res) {
await _orderService.getShippingOption(paymentCheckoutData.address).then((res) {
paymentCheckoutData.shippingOption = ShippingOption.fromJson(res);
setState(ViewState.Idle);
});
@ -206,8 +212,7 @@ class OrderPreviewViewModel extends BaseViewModel {
setState(ViewState.Busy);
await pharmacyModuleViewModel.generatePharmacyToken();
await _orderService.makeOrder(
paymentCheckoutData, cartResponse.shoppingCarts);
await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts);
if (_orderService.hasError) {
error = _orderService.error;
setState(ViewState.ErrorLocal);

@ -1,5 +1,5 @@
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/viewModels/base_view_model.dart';
@ -14,6 +14,7 @@ class PrescriptionViewModel extends BaseViewModel {
getPrescription() async {
await getSavedLanguage();
prescriptionsList.clear();
if(prescriptionsList.isEmpty){
setState(ViewState.Busy);
await _prescriptionService.getPrescription();

@ -1,9 +1,11 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/brands_service.dart';
import '../../../locator.dart';
class BrandsViewModel extends BaseViewModel{
@ -22,6 +24,7 @@ class BrandsViewModel extends BaseViewModel{
Future getBrandsData() async {
hasError = false;
setState(ViewState.Busy);
await _brandsService.getBrands();
if (_brandsService.hasError) {
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/order_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
@ -77,7 +78,8 @@ class OrderModelViewModel extends BaseViewModel {
dynamic res;
await _cancelOrderService.getCanceledOrder(order).then((value) {
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);
});
if (_cancelOrderService.hasError) {
@ -95,7 +97,7 @@ class OrderModelViewModel extends BaseViewModel {
return res;
}
Future makeReview(PharmacyProduct product, double rating, String reviewText) async {
Future makeReview(PharmacyProduct product, double rating, String reviewText, context) async {
setState(ViewState.Busy);
await _orderDetailsService.makeReview(product, rating, reviewText);
if (_orderDetailsService.hasError) {
@ -104,8 +106,9 @@ class OrderModelViewModel extends BaseViewModel {
AppToast.showErrorToast(message: error);
} else {
setState(ViewState.Idle);
AppToast.showSuccessToast(
message: "Your review has been Submitted successfully");
AppToast.showSuccessToast(message: TranslationBase.of(context).submitReview);
// AppToast.showSuccessToast(
// message: "Your review has been Submitted successfully");
}
}

@ -1,17 +1,20 @@
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/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.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/navigation_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/product_detail_service.dart';
import 'package:provider/provider.dart';
import '../../../locator.dart';
class ProductDetailViewModel extends BaseViewModel{
class ProductDetailViewModel extends BaseViewModel {
ProductDetailService _productDetailService = locator<ProductDetailService>();
List<ProductDetail> get productDetailService => _productDetailService.productDetailList;
@ -24,6 +27,13 @@ class ProductDetailViewModel extends BaseViewModel{
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 {
hasError = false;
@ -36,10 +46,10 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle);
}
Future getProductLocationData() async {
Future getProductLocationData(String productSKU) async {
hasError = false;
setState(ViewState.BusyLocal);
await _productDetailService.getProductAvailabiltyDetail();
await _productDetailService.getProductAvailabiltyDetail(productSKU);
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);
@ -47,10 +57,10 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle);
}
Future notifyMe(customerId, itemID) async {
Future notifyMe(customerId, itemID, context) async {
hasError = false;
setState(ViewState.BusyLocal);
await _productDetailService.notifyMe(customerId, itemID);
await _productDetailService.notifyMe(customerId, itemID, context);
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);
@ -58,25 +68,49 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle);
}
Future addToCartData(quantity, itemID) async {
Future addToCartData(quantity, itemID, context) async {
hasError = false;
setState(ViewState.BusyLocal);
await _productDetailService.addToCart(quantity, itemID);
var resp = await _productDetailService.addToCart(quantity, itemID, context);
ShoppingCartResponse object = _handleGetShoppingCartResponse(resp);
if (_productDetailService.hasError) {
error = _productDetailService.error;
setState(ViewState.ErrorLocal);
} else
} else {
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;
setState(ViewState.BusyLocal);
GifLoaderDialogUtils.showMyDialog(
locator<NavigationService>().navigatorKey.currentContext);
await _productDetailService.addToWishlist(itemID);
GifLoaderDialogUtils.hideDialog(
locator<NavigationService>().navigatorKey.currentContext);
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
await _productDetailService.addToWishlist(itemID, context);
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
if (_productDetailService.hasError) {
error = _productDetailService.error;
@ -96,15 +130,12 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle);
}
Future deleteWishlistData(itemID) async {
Future deleteWishlistData(itemID, context) async {
hasError = false;
setState(ViewState.BusyLocal);
GifLoaderDialogUtils.showMyDialog(
locator<NavigationService>().navigatorKey.currentContext);
await _productDetailService.deleteItemFromWishlist(itemID);
GifLoaderDialogUtils.hideDialog(
locator<NavigationService>().navigatorKey.currentContext);
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
await _productDetailService.deleteItemFromWishlist(itemID, context);
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
if (_productDetailService.hasError) {
error = _productDetailService.error;
@ -113,7 +144,6 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle);
}
Future productSpecificationData(itemID) async {
hasError = false;
setState(ViewState.Busy);
@ -125,10 +155,7 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle);
}
clearReview(){
clearReview() {
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/service/pharmacy_categorise_service.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';
class PharmacyCategoriseViewModel extends BaseViewModel {
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<CategoriseParentModel> get brandsList => _pharmacyCategoriseService.brandsList;
List<PharmacyProduct> get parentProducts =>
_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;
@ -81,29 +99,37 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getCategoriseParent({String i}) async {
Future getCategoriseParent(
{String i, int pageIndex, bool isLoading, BuildContext context}) async {
hasError = false;
// _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
// GifLoaderDialogUtils.showMyDialog(context);
await _pharmacyCategoriseService.getCategoriseParent(id: i);
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error;
setState(ViewState.ErrorLocal);
} 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;
// _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _pharmacyCategoriseService.getParentProducts(id: i);
setState(ViewState.BusyLocal);
//GifLoaderDialogUtils.showMyDialog(context);
await _pharmacyCategoriseService.getParentProducts(
id: i, pageNumber: pageIndex, isLoading: isLoading);
if (_pharmacyCategoriseService.hasError) {
error = _pharmacyCategoriseService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
//GifLoaderDialogUtils.hideDialog(context);
}
Future getSubCategorise({String i}) async {
@ -142,11 +168,13 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
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;
// _insuranceCardService.clearInsuranceCard();
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) {
error = _pharmacyCategoriseService.error;
setState(ViewState.ErrorLocal);
@ -154,7 +182,8 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
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;
// _insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
@ -221,4 +250,27 @@ class PharmacyCategoriseViewModel extends BaseViewModel {
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.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) {
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/child_vaccines/user_information_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/product_categories_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(() => BestSellerViewModel());
locator.registerFactory(() => LastVisitedViewModel());
locator.registerFactory(() => MostViewedViewModel());
// Offer And Packages
//----------------------
locator.registerLazySingleton(() => OffersAndPackagesServices()); // offerPackagesServices Service
locator.registerFactory(() => OfferCategoriesViewModel()); // Categories View Model
locator.registerLazySingleton(
() => OffersAndPackagesServices()); // offerPackagesServices Service
locator.registerFactory(
() => OfferCategoriesViewModel()); // Categories View Model
locator.registerFactory(() => PackagesViewModel()); // Products View Model
//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/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/routes.dart';
@ -84,6 +83,9 @@ class _MyApp extends State<MyApp> {
SizeConfig().init(constraints, orientation);
return MultiProvider(
providers: [
ChangeNotifierProvider<PharmacyPagesViewModel>(
create: (context) => PharmacyPagesViewModel(),
),
ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(),
),

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

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

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

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

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

@ -56,7 +56,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
return AppScaffold(
isShowAppBar: false,
baseViewModel: model,
body: ListView.separated(
body: model.cmcAllPresOrders.length > 0 ? ListView.separated(
padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(),
itemBuilder: (context, index) {
@ -178,7 +178,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
);
},
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,
children: [
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),
),
Column(
children: [
...List.generate(
widget.model.hhcAllOrderDetail.length,
(index) => Container(
child: Texts(
projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description.capitalize(),
fontSize: 13,
bold: false,
),
),
)
],
)
Expanded(
child: Text(
widget.model.pendingOrder.nearestProjectName.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
),
),
],
)
],

@ -1,13 +1,14 @@
import 'dart:math';
import 'package:diplomaticquarterapp/theme/colors.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../health_calc_desc.dart';
import 'result_page.dart';
const activeCardColor = Color(0xff70777A);
@ -23,52 +24,17 @@ class _BMICalculatorState extends State<BMICalculator> {
String textResult;
String msg;
double bmiResult;
int height = 150;
int weight = 40;
Color cmCard = activeCardColor;
Color ftCard = inactiveCardColor;
Color lbCard = inactiveCardColor;
Color kgCard = activeCardColor;
void updateColor(int type) {
//MG/DLT card
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;
}
}
}
TextEditingController _heightController = TextEditingController();
TextEditingController _weightController = TextEditingController();
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;
}
}
}
List<PopupMenuItem> _weightPopupList = List();
List<PopupMenuItem> _heightPopupList = List();
bool _isHeightCM = true;
bool _isWeightKG = true;
double _heightValue = 150;
double _weightValue = 40;
double convertToCm(double number) {
return number * 30.48;
@ -79,10 +45,11 @@ class _BMICalculatorState extends State<BMICalculator> {
}
double calculateBMI() {
if (ftCard == activeCardColor) {
convertToCm(height.toDouble());
}
bmiResult = weight / pow(height / 100, 2);
if (!_isHeightCM) _heightValue = convertToCm(_heightValue.toDouble());
if (!_isWeightKG) _weightValue = convertToKg(_weightValue);
bmiResult = _weightValue / pow(_heightValue / 100, 2);
return bmiResult;
}
@ -115,432 +82,261 @@ class _BMICalculatorState extends State<BMICalculator> {
void initState() {
super.initState();
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) {
_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(
isShowAppBar: true,
isShowDecPage: false,
showHomeAppBarIcon: false,
appBarIcons: [
IconButton(
icon: Icon(Icons.info_outline),
color: Colors.white,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
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),
),
showHomeAppBarIcon: true,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: Column(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).height),
),
],
),
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),
),
],
Text(
TranslationBase.of(context).bmiCalcDesc,
style: TextStyle(
fontSize: 14.0,
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(weight.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 (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),
),
],
mHeight(24),
_commonInputAndUnitRow(
TranslationBase.of(context).height,
_heightController,
1,
270,
_heightValue,
(text) {
_heightController.text = text;
},
(value) {
_heightValue = value;
},
_isHeightCM ? TranslationBase.of(context).cm : TranslationBase.of(context).ft,
(value) {
if (_isHeightCM != value) {
setState(() {
_isHeightCM = value;
});
}
},
_heightPopupList,
),
Row(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).selectUnit),
),
],
),
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(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)),
),
),
),
],
mHeight(12),
_commonInputAndUnitRow(
TranslationBase.of(context).weight,
_weightController,
1,
270,
_weightValue,
(text) {
_weightController.text = text;
},
(value) {
_weightValue = value;
},
_isWeightKG ? TranslationBase.of(context).kg : TranslationBase.of(context).pound,
(value) {
if (_isWeightKG != value) {
setState(() {
_isWeightKG = value;
});
}
},
_weightPopupList,
),
],
),
),
SizedBox(
height: 25.0,
),
Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: EdgeInsets.symmetric(vertical: 8),
child: SecondaryButton(
label: TranslationBase.of(context).calculate,
onTap: () => {
setState(() {
calculateBMI();
showTextResult(context);
showMsg(context);
{
Navigator.push(
context,
FadePage(
page: ResultPage(
),
Container(
color: Colors.white,
padding: EdgeInsets.all(16),
child: SecondaryButton(
label: TranslationBase.of(context).calculate,
color: CustomColors.accentColor,
onTap: () {
setState(() {
calculateBMI();
showTextResult(context);
showMsg(context);
{
Navigator.push(
context,
FadePage(
page: ResultPage(
finalResult: bmiResult,
textResult: textResult,
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/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/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.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 String textResult;
final String msg;
ResultPage({this.finalResult, this.textResult, this.msg});
@override
_ResultPageState createState() => _ResultPageState();
}
class _ResultPageState extends State<ResultPage> {
Color inductorColor;
double percent;
Color colorInductor() {
if (finalResult >= 30) {
if (widget.finalResult >= 30) {
inductorColor = Color(0xffC70D00);
} else if (finalResult < 30 && finalResult >= 25) {
} else if (widget.finalResult < 30 && widget.finalResult >= 25) {
inductorColor = Color(0xffC25400);
} else if (finalResult < 25 && finalResult >= 18.5) {
} else if (widget.finalResult < 25 && widget.finalResult >= 18.5) {
inductorColor = Color(0xff36D600);
} else if (finalResult < 18.5) {
} else if (widget.finalResult < 18.5) {
inductorColor = Color(0xff1BE0EE);
}
return inductorColor;
}
double percentInductor() {
if (finalResult >= 30) {
if (widget.finalResult >= 30) {
percent = 1.0;
} else if (finalResult < 30 && finalResult >= 25) {
} else if (widget.finalResult < 30 && widget.finalResult >= 25) {
percent = 0.73;
} else if (finalResult < 25 && finalResult >= 18.5) {
} else if (widget.finalResult < 25 && widget.finalResult >= 18.5) {
percent = 0.5;
} else if (finalResult < 18.5) {
} else if (widget.finalResult < 18.5) {
percent = 0.25;
}
return percent;
@ -50,71 +63,71 @@ class ResultPage extends StatelessWidget {
return AppScaffold(
isShowDecPage: false,
isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
Container(
margin: EdgeInsets.only(left: 20, right: 20, top: 20, bottom: 6),
decoration: cardRadius(12),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Container(
margin: EdgeInsets.only(top: 50),
child: Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 20.0,
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,
),
Text(
TranslationBase.of(context).bodyMassIndex + widget.finalResult.toStringAsFixed(2),
style: TextStyle(
fontSize: 16,
letterSpacing: -0.64,
fontWeight: FontWeight.w600,
),
),
mHeight(20),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Texts(msg),
height: MediaQuery.of(context).size.width / 2.8,
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(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: BorderedButton(
color: Colors.white,
padding: EdgeInsets.all(16),
child: DefaultButton(
TranslationBase.of(context).seeListOfDoctor,
fontSize: SizeConfig.textMultiplier * 2.1,
textColor: Colors.white,
vPadding: 8,
hPadding: 8,
backgroundColor: Theme.of(context).primaryColor,
radius: 8,
fontWeight: FontWeight.bold,
handler: () {
Navigator.push(
context,
FadePage(page: BariatricsPage(1, 1, finalResult)),
);
() {
callDoctorsSearchAPI();
},
),
),
@ -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/models/Appointments/DoctorListResponse.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -27,50 +30,81 @@ class BmrResultPage extends StatelessWidget {
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 20.0,
percent: ((this.bmrResult > 3500) ? 100 : this.bmrResult / 3500),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
bmrResult.toStringAsFixed(1),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).calories,
style: TextStyle(
fontSize: 19,
letterSpacing: -1.34,
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',
style: TextStyle(
fontSize: 16.0,
),
mHeight(20),
Text(
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,
),
color: CustomColors.textColor
),
],
),
progressColor: Color(0xff3C3939),
),
),
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.'),
),
],
).withBorderedContainer,
),
mFlex(1),
Container(
width: 350,
child: Button(
label: TranslationBase.of(context).viewDocList,
onTap: () {
getDoctorsList(context);
}),
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);
},
),
),
],
),
);
@ -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/models/Appointments/DoctorListResponse.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -41,49 +44,70 @@ class FatResult extends StatelessWidget {
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bodyFatTitle,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
SizedBox(
// height: 40.0,
),
Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 20.0,
percent: ((fat > 70) ? 100 : fat / 100),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
fat.toStringAsFixed(1) + '%',
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).bodyFatTitle,
style: TextStyle(
fontSize: 19,
letterSpacing: -1.34,
fontWeight: FontWeight.bold,
),
),
mHeight(20),
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,
backgroundColor: Colors.white,
),
),
Container(
height: 120,
width: 280.0,
child: Texts(textResult),
),
],
).withBorderedContainer,
),
mFlex(1),
Container(
width: 350,
child: Button(
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);
},
),
),
],
),
);
@ -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/models/Appointments/DoctorListResponse.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -24,45 +27,83 @@ class CalorieResultPage extends StatelessWidget {
showNewAppBarTitle: true,
showNewAppBar: true,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 20.0,
percent: ((this.calorie > 3500) ? 100 : this.calorie / 3500),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
calorie.toStringAsFixed(1),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).calories,
style: TextStyle(
fontSize: 19,
letterSpacing: -1.34,
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'),
],
),
progressColor: Color(0xff3C3939),
backgroundColor: Colors.white,
),
),
Container(
child: Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'),
),
],
).withBorderedContainer,
),
mFlex(1),
Container(
width: 350,
child: Button(
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);
},
),
),
],
),
);
@ -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/theme/colors.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'carbs_result_page.dart';
@ -17,6 +18,7 @@ class Carbs extends StatefulWidget {
class _CarbsState extends State<Carbs> {
TextEditingController textController = new TextEditingController();
final GlobalKey clinicDropdownKey = GlobalKey();
int calories;
String dropdownValue;
bool _visible = false;
@ -36,27 +38,27 @@ class _CarbsState extends State<Carbs> {
double fCalMeal;
void calculateDietRatios() {
if (dropdownValue == 'Very Low Carb') {
if (dropdownValue == TranslationBase.of(context).dietVeryLow) {
meals = 3;
protein = 45;
carbs = 10;
fat = 45;
} else if (dropdownValue == 'Low Carb') {
} else if (dropdownValue == TranslationBase.of(context).dietLow) {
meals = 3;
protein = 40;
carbs = 30;
fat = 30;
} else if (dropdownValue == 'Moderate Carb') {
} else if (dropdownValue == TranslationBase.of(context).dietModerate) {
meals = 3;
protein = 25;
carbs = 50;
fat = 25;
} else if (dropdownValue == 'USDA Gudilines') {
} else if (dropdownValue == TranslationBase.of(context).dietUSDA) {
meals = 3;
protein = 15;
carbs = 55;
fat = 30;
} else if (dropdownValue == 'Zone Diet') {
} else if (dropdownValue == TranslationBase.of(context).dietZone) {
meals = 3;
protein = 30;
carbs = 40;
@ -67,9 +69,9 @@ class _CarbsState extends State<Carbs> {
void calculate() {
pCal = (protein / 100.0) * int.parse(textController.text).ceil();
cCal = (carbs / 100.0) * int.parse(textController.text);
;
fCal = (fat / 100) * int.parse(textController.text);
;
pCalGram = pCal / 4.0;
cCalGram = cCal / 4.0;
fCalGram = fCal / 9.0;
@ -80,6 +82,7 @@ class _CarbsState extends State<Carbs> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
@ -95,286 +98,280 @@ class _CarbsState extends State<Carbs> {
),
)
],
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0),
child: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
'Calculates carbohydrate protein and fat\n ratio in calories and grams according to a\n pre-set ratio',
),
SizedBox(
height: 15.0,
),
Column(
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
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: 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();
});
},
),
],
),
),
],
),
),
),
),
],
Text(
TranslationBase.of(context).carbProteinDesc,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.56,
color: CustomColors.textColor,
),
),
SizedBox(
height: 20.0,
height: 15.0,
),
Button(
backgroundColor: Color(0xffC5272D),
label: 'NOT SURE? CLICK HERE',
onTap: () {
setState(() {
{
Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
inputWidget(TranslationBase.of(context).calDay, "0", textController),
InkWell(
onTap: () {
Navigator.push(
context,
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),
),
),
)
],
),
],
),
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(),
),
SizedBox(
height: 12.0,
),
Visibility(
visible: _visible,
InkWell(
onTap: () {
// dropdownKey.currentState;
openDropdown(clinicDropdownKey);
},
child: Container(
height: 170.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// width: double.infinity,
// decoration: containerRadius(Colors.white, 12),
// padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Row(
children: [
Texts(
'Ratios are divided according to the selected diet'),
RichText(
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),
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextSpan(
text: 'Protein ',
),
TextSpan(
text: '$protein%',
style: TextStyle(color: Color(0xffC5272D)),
)
],
),
),
RichText(
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [
TextSpan(
text: 'Carbohydrate ',
Text(
TranslationBase.of(context).selectDiet,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
TextSpan(
text: '$carbs%',
style: TextStyle(color: Color(0xffC5272D)),
)
],
),
),
RichText(
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [
TextSpan(
text: 'Fat ',
Container(
height: 18,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
value: dropdownValue, key: clinicDropdownKey,
icon: Icon(Icons.arrow_downward),
iconSize: 0,
elevation: 16,
isExpanded: true,
style: TextStyle(color: Colors.black87),
underline: Container(
height: 2,
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(
height: 50.0,
width: 350.0,
child: SecondaryButton(
label: 'CALCULATE',
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,
)),
);
}
});
},
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,
),
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/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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/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/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:provider/provider.dart';
class CarbsResult extends StatelessWidget {
double pCal;
@ -22,18 +27,11 @@ class CarbsResult extends StatelessWidget {
double cCalMeal;
double fCalMeal;
CarbsResult(
{this.pCal,
this.cCal,
this.fCal,
this.pCalGram,
this.cCalGram,
this.fCalGram,
this.fCalMeal,
this.cCalMeal,
this.pCalMeal});
CarbsResult({this.pCal, this.cCal, this.fCal, this.pCalGram, this.cCalGram, this.fCalGram, this.fCalMeal, this.cCalMeal, this.pCalMeal});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
@ -43,135 +41,96 @@ class CarbsResult extends StatelessWidget {
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: EdgeInsets.symmetric(vertical: 30.0, horizontal: 10.0),
child: Table(
border: TableBorder(
verticalInside: BorderSide(width: 1, color: Colors.black54),
bottom: BorderSide(width: 1, color: Colors.black54),
left: BorderSide(width: 1, color: Colors.black54),
right: BorderSide(width: 1, color: Colors.black54),
top: BorderSide(width: 1, color: Colors.black54),
),
Container(
decoration: containerRadius(Colors.white, 12),
padding: EdgeInsets.all(12),
margin: EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TableRow(
decoration: BoxDecoration(
color: Colors.white,
),
children: [
TableCell(
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'),
),
Text(
TranslationBase.of(context).carbsProtin,
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.bold,
letterSpacing: -1.34,
),
TableCell(
child: Center(
child: Texts(fCalGram.ceil().toString() + ' gr'),
),
),
]),
TableRow(children: [
Padding(
padding: EdgeInsets.all(8.0),
child: TableCell(
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'),
),
),
]),
),
mHeight(12),
Table(
columnWidths: {
0: FlexColumnWidth(2.4),
1: FlexColumnWidth(1.8),
2: FlexColumnWidth(2),
3: FlexColumnWidth(1),
},
children: fullData(context, projectViewModel),
),
],
),
),
Container(
width: 350,
child: Button(
label: TranslationBase.of(context).viewDocList,
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).seeListOfDoctor,
color: CustomColors.accentColor,
onTap: () {
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) {
@ -208,7 +167,7 @@ class CarbsResult extends StatelessWidget {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
)
.toList();
if (doctorByHospital.length != 0) {
@ -226,5 +185,4 @@ class CarbsResult extends StatelessWidget {
print(err);
});
}
}

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

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -29,78 +32,102 @@ class DeliveryDueResult extends StatelessWidget {
showNewAppBarTitle: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).pregnancyTitle,
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 12.0),
child: SingleChildScrollView(
child: Container(
height: 750.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Texts(
TranslationBase.of(context).ovulationPeriod,
fontWeight: FontWeight.w400,
),
Texts(
TranslationBase.of(context).from,
fontWeight: FontWeight.w400,
),
Texts(DateFormat.yMMMEd().format(dateFrom), fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)),
Texts(
TranslationBase.of(context).to,
fontWeight: FontWeight.w400,
),
Texts(DateFormat.yMMMEd().format(dateTo), fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)),
Texts(
TranslationBase.of(context).conceive,
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(conceivedDate),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
TranslationBase.of(context).firstTri,
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(firstTrimester),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
TranslationBase.of(context).secondTri,
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(secondTrimester),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
TranslationBase.of(context).thirdTri,
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);
},
),
),
],
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 21.0, vertical: 21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
TranslationBase.of(context).pregnancyTitle,
style: TextStyle(
fontSize: 19,
letterSpacing: -1.14,
fontWeight: FontWeight.w600,
),
),
Text(
TranslationBase.of(context).ovulationPeriod,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
fontWeight: FontWeight.w600,
color: CustomColors.textColor,
),
),
mHeight(20),
showItem(TranslationBase.of(context).from, DateFormat.yMMMEd().format(dateFrom), titleColor: CustomColors.accentColor),
mHeight(12),
showItem(TranslationBase.of(context).to, DateFormat.yMMMEd().format(dateTo), titleColor: CustomColors.accentColor),
mHeight(12),
mDivider(CustomColors.devider),
mHeight(12),
showItem(TranslationBase.of(context).conceive, DateFormat.yMMMEd().format(conceivedDate)),
mHeight(12),
mDivider(CustomColors.devider),
mHeight(12),
showItem(TranslationBase.of(context).firstTri, DateFormat.yMMMEd().format(firstTrimester)),
mHeight(12),
mDivider(CustomColors.devider),
mHeight(12),
showItem(TranslationBase.of(context).secondTri, DateFormat.yMMMEd().format(secondTrimester)),
mHeight(12),
mDivider(CustomColors.devider),
mHeight(12),
showItem(TranslationBase.of(context).thirdTri, DateFormat.yMMMEd().format(thirdTrimester)),
mHeight(12),
mDivider(CustomColors.devider),
mHeight(12),
],
).withBorderedContainer,
),
),
),
),
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) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
doctorsList: doctorsList,
patientDoctorAppointmentListHospital:
_patientDoctorAppointmentListHospital)));
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).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/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/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'ideal_body_result_page.dart';
@ -24,69 +25,44 @@ class _IdealBodyState extends State<IdealBody> {
Color lbCard = inactiveCardColor;
Color cmCard = activeCardColor;
Color ftCard = inactiveCardColor;
int age = 0;
int height = 0;
// int age = 0;
// int height = 0;
double heightInches;
double minRange;
double maxRange;
double overWeightBy;
int weight = 0;
double idealWeight = 0;
String dropdownValue = 'Medium(fingers touch)';
String dropdownValue = null;
double calories = 0;
String textResult = '';
double maxIdealWeight;
double heightFeet;
void updateColorHeight(int type) {
//MG/DLT card
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;
}
}
}
final GlobalKey clinicDropdownKey = GlobalKey();
bool _isHeightCM = true;
bool _isWeightKG = true;
double _heightValue = 0;
double _weightValue = 0;
TextEditingController _heightController = new TextEditingController();
TextEditingController _weightController = TextEditingController();
List<PopupMenuItem> _heightPopupList = List();
List<PopupMenuItem> _weightPopupList = List();
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() {
heightInches = height * .39370078740157477;
heightInches = int.parse(_heightController.text) * .39370078740157477;
heightFeet = heightInches / 12;
idealWeight = (50 + 2.3 * (heightInches - 60));
if (dropdownValue == 'Small(fingers overlap)') {
if (dropdownValue == TranslationBase.of(context).smallFinger) {
idealWeight = idealWeight - 10;
} else if (dropdownValue == 'Medium(fingers touch)') {
} else if (dropdownValue == TranslationBase.of(context).mediumFinger) {
idealWeight = idealWeight;
} else if (dropdownValue == 'Large(fingers don\'n touch)') {
} else if (dropdownValue == TranslationBase.of(context).largeFinger) {
idealWeight = idealWeight + 10;
}
@ -99,6 +75,11 @@ class _IdealBodyState extends State<IdealBody> {
@override
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(
isShowAppBar: true,
isShowDecPage: false,
@ -115,458 +96,418 @@ class _IdealBodyState extends State<IdealBody> {
),
)
],
body: Padding(
padding: EdgeInsets.symmetric(vertical: 15.0, horizontal: 25.0),
child: SingleChildScrollView(
child: Container(
height: 800.0,
child: Column(
children: [
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,
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(21),
child: Column(
children: [
Texts(
'Height',
),
Row(
children: [
Expanded(
child: Container(
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),
),
),
],
),
),
),
],
Text(
TranslationBase.of(context).idealBodyWeight,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.56,
color: CustomColors.textColor,
),
),
Texts('Select Unit'),
SizedBox(
height: 5.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColorHeight(1);
isHeightCm = true;
});
SizedBox(
height: 12.0,
),
_commonInputAndUnitRow(
TranslationBase.of(context).height,
_heightController,
1,
270,
_heightValue,
(text) {
_heightController.text = text;
},
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('CM')),
),
),
(value) {
_heightValue = value;
},
_isHeightCM ? TranslationBase.of(context).cm : TranslationBase.of(context).ft,
(value) {
if (_isHeightCM != value) {
setState(() {
_isHeightCM = value;
});
}
},
_heightPopupList,
),
GestureDetector(
onTap: () {
setState(() {
updateColorHeight(2);
isHeightCm = false;
});
SizedBox(
height: 12.0,
),
_commonInputAndUnitRow(
TranslationBase.of(context).weight,
_weightController,
1,
270,
_weightValue,
(text) {
_weightController.text = text;
},
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('Ft')),
),
),
(value) {
_weightValue = value;
},
_isWeightKG ? TranslationBase.of(context).kg : TranslationBase.of(context).pound,
(value) {
if (_isWeightKG != value) {
setState(() {
_isWeightKG = value;
});
}
},
_weightPopupList,
),
],
),
SizedBox(
height: 45.0,
),
Divider(
thickness: 2.0,
),
Texts(
'Weight',
),
SizedBox(
height: 5.0,
),
Row(
children: [
Expanded(
SizedBox(
height: 12.0,
),
InkWell(
onTap: () {
// dropdownKey.currentState;
openDropdown(clinicDropdownKey);
},
child: Container(
width: 340.0,
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
),
// width: double.infinity,
// decoration: containerRadius(Colors.white, 12),
// padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
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,
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).bodyFrameSize,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(weight.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 (weight < 250)
weight++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (weight > 0) weight--;
});
},
),
],
Container(
height: 18,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
value: dropdownValue,
icon: Icon(Icons.arrow_downward), key: clinicDropdownKey,
iconSize: 0,
elevation: 16,
isExpanded: true,
style: TextStyle(color: Colors.black87),
underline: Container(
height: 2,
color: Colors.black54,
),
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),
],
),
),
),
],
),
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')),
),
),
).withBorderedContainer,
),
],
),
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'),
Container(
width: 300,
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;
});
},
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(),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
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,
),
SizedBox(
height: 30.0,
),
Container(
height: 50.0,
width: 350.0,
child: SecondaryButton(
label: 'CALCULATE',
onTap: () {
setState(() {
// calculateBmr();
// calculateCalories();
calculateIdealWeight();
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
),
);
}
print(idealWeight);
//print(overWeightBy);
{
Navigator.push(
context,
FadePage(
page: IdealBodyResult(
idealBodyWeight: idealWeight,
minRange: minRange,
mixRange: maxRange,
overWeightBy: overWeightBy,
textResult: textResult,
)),
);
}
});
},
),
),
],
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),
)
],
),
);
}
}

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -28,139 +31,170 @@ class IdealBodyResult extends StatelessWidget {
appBarTitle: TranslationBase.of(context).idealBody,
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
'Ideal weight range is',
fontSize: 23.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
children: [
Texts(
minRange.toStringAsFixed(1),
fontSize: 30.0,
),
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),
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).idealWeightRange,
style: TextStyle(
fontSize: 19,
letterSpacing: -1.34,
fontWeight: FontWeight.bold,
),
],
),
],
),
overWeightBy >= 0 && overWeightBy <= 10
? Column(
),
mHeight(12),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Texts(
'Congratulations! The current weight is\n perfect and considered healthy',
fontSize: 20.0,
Row(
children: [
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),
),
),
],
),
],
)
: overWeightBy > 10 && overWeightBy < 17
? Column(
Icon(
Icons.arrow_forward,
color: Colors.red,
size: 55.0,
),
Row(
children: [
Texts('This means that the weight is a little bit more than ideal weight by'),
Texts(overWeightBy.toStringAsFixed(1)),
Texts('May wish to consult with the doctor for medical help. Click to view our list of Doctors'),
Texts(
mixRange.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),
),
),
],
)
: overWeightBy >= 18
? Container(
height: 250.0,
width: 350,
child: Column(
),
],
),
mHeight(12),
overWeightBy >= 0 && overWeightBy <= 10
? Column(
children: [
Texts(
TranslationBase.of(context).currentWeightPerfect,
fontSize: 20.0,
),
],
)
: overWeightBy > 10 && overWeightBy < 17
? Column(
children: [
Texts(
'Means that you suffer from excessive\n obesity by',
),
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'),
Texts(TranslationBase.of(context).littleBitWeightMore),
Texts(overWeightBy.toStringAsFixed(1)),
Texts(TranslationBase.of(context).consultWithDoctor),
],
),
)
: overWeightBy < -18
? Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
'Under Weight',
fontSize: 18.0,
),
),
SizedBox(
height: 55.0,
),
Texts(
overWeightBy.toStringAsFixed(1),
fontSize: 20.0,
)
: overWeightBy >= 18
? Container(
child: Column(
children: [
Texts(
TranslationBase.of(context).excessiveObesity,
),
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),
],
),
],
)
: Container(
height: 250.0,
width: 350.0,
child: Column(
children: [
Texts(
'under wheight',
fontSize: 20.0,
),
SizedBox(
height: 55.0,
),
Texts(
overWeightBy.toStringAsFixed(1),
fontSize: 20.0,
),
SizedBox(
height: 25.0,
)
: overWeightBy < -18
? Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).underWeight,
fontSize: 18.0,
),
),
SizedBox(
height: 12.0,
),
Text(
overWeightBy.toStringAsFixed(1),
style: TextStyle(
fontSize: 17,
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(
width: 350,
child: Button(
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);
},
@ -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/translations_delegate_base.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -20,8 +22,9 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now();
DateTime selectedDateTime = DateTime.now();
int cycleLength = 0;
int lutealPhaseLength = 0;
// int cycleLength = 0;
// int lutealPhaseLength = 0;
String selectedDate;
var dateFrom = DateTime.now();
var babyAgeWeeks;
@ -33,6 +36,9 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
var newFormat = DateFormat("yy-MM-dd");
String updatedDt;
TextEditingController cycleLengthController = new TextEditingController();
TextEditingController lutelLengthController = new TextEditingController();
String getTime() {
return " ${timeSugarDate.hour}:${timeSugarDate.minute}";
}
@ -64,286 +70,176 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
showNewAppBarTitle: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).ovulation,
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0),
child: SingleChildScrollView(
child: Container(
height: 700.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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(
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 340.0,
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
Text(
TranslationBase.of(context).ovulationDesc,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.54,
color: Colors.black,
fontWeight: FontWeight.w600,
),
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(cycleLength.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 (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,
),
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: 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,
),
SizedBox(
height: 5.0,
),
Row(
children: [
Container(
width: 340.0,
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).calculate,
color: CustomColors.accentColor,
onTap: () {
calculateBabyInformation();
Navigator.push(
context,
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(
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(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--;
});
},
),
],
),
),
],
),
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,
),
),
),
Expanded(
child: Slider(
value: lutealPhaseLength.toDouble(),
min: 0,
max: 15,
onChanged: (double newValue) {
setState(() {
lutealPhaseLength = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
],
),
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/models/Appointments/DoctorListResponse.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -26,6 +29,7 @@ class OvulationResult extends StatelessWidget {
this.babyAge,
this.babyAgeDays,
});
//var newFormat = DateFormat("yy-MM-dd");
@override
@ -35,81 +39,105 @@ class OvulationResult extends StatelessWidget {
showNewAppBarTitle: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).ovulation,
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0),
child: SingleChildScrollView(
child: Container(
height: 750.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Texts(
'The next ovulation period is estimated to be:',
fontWeight: FontWeight.w400,
),
Texts(
'From:',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(dateFrom),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'To:',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(dateTo),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'Useful Information:',
color: Color(0xffC5272D),
),
Texts(
'You have conceived on:',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(conceivedDate),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'The baby\'s age right now:',
fontWeight: FontWeight.w400,
),
Texts(
babyAge <= 0 ? "baby age is not available" : babyAge.toString() + " Weeks",
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'The delivery due date is estimated to be on the: ',
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);
},
),
),
],
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).ovulation,
style: TextStyle(
fontSize: 19,
letterSpacing: -1.14,
fontWeight: FontWeight.w600,
),
),
mHeight(20),
Text(
TranslationBase.of(context).ovulationPeriod,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
fontWeight: FontWeight.w600,
color: CustomColors.textColor,
),
),
mHeight(20),
showItem(TranslationBase.of(context).from, DateFormat.yMMMEd().format(dateFrom), titleColor: CustomColors.accentColor),
mHeight(12),
showItem(TranslationBase.of(context).to, DateFormat.yMMMEd().format(dateTo), titleColor: CustomColors.accentColor),
mHeight(12),
mDivider(CustomColors.devider),
mHeight(12),
Text(
TranslationBase.of(context).useFullInfo,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
color: CustomColors.accentColor,
fontWeight: FontWeight.w500,
),
),
mHeight(12),
showItem(TranslationBase.of(context).conceive, DateFormat.yMMMEd().format(conceivedDate)),
mHeight(12),
mDivider(CustomColors.devider),
mHeight(12),
showItem(TranslationBase.of(context).babyAge, babyAge <= 0 ? TranslationBase.of(context).babyAgeAvail : babyAge.toString() + TranslationBase.of(context).week),
mHeight(12),
mDivider(CustomColors.devider),
mHeight(12), showItem(TranslationBase.of(context).deliveryDue, DateFormat.yMMMEd().format(deliveryDue)),
],
).withBorderedContainer,
),
),
),
),
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
.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: "0", patientDoctorAppointment: element));
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
doctorsList: doctorsList,
patientDoctorAppointmentListHospital:
_patientDoctorAppointmentListHospital)));
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).catchError((err) {
@ -175,5 +194,20 @@ class OvulationResult extends StatelessWidget {
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(
margin: EdgeInsets.all(20.0),
// margin: EdgeInsets.all(20.0),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 12, right: 12),
padding: EdgeInsets.only(left: 12, right: 12, top: 20.0),
child: GridView.builder(
shrinkWrap: true,
primary: false,
@ -147,9 +147,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
),
child: MedicalProfileItem(
title: TranslationBase.of(context).bmi,
imagePath: 'assets/images/new-design/bmi_health_calculator.png',
imagePath: 'bmi.svg',
subTitle: TranslationBase.of(context).calcHealth,
isPngImage: true,
),
));
@ -160,9 +160,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
),
child: MedicalProfileItem(
title: TranslationBase.of(context).calories,
imagePath: 'assets/images/new-design/calories-calculator.png',
imagePath: 'calories_calc.svg',
subTitle: TranslationBase.of(context).calcHealth,
isPngImage: true,
),
));
@ -173,9 +173,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
),
child: MedicalProfileItem(
title: TranslationBase.of(context).bmr,
imagePath: 'assets/images/new-design/BMR_calculator.png',
imagePath: 'bmr_calc.svg',
subTitle: TranslationBase.of(context).calcHealth,
isPngImage: true,
),
));
@ -186,9 +186,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
),
child: MedicalProfileItem(
title: TranslationBase.of(context).idealBody,
imagePath: 'assets/images/new-design/body_weight.png',
imagePath: 'ideal_weight_calc.svg',
subTitle: TranslationBase.of(context).weight,
isPngImage: true,
),
));
@ -199,9 +199,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
),
child: MedicalProfileItem(
title: TranslationBase.of(context).bodyWord,
imagePath: 'assets/images/new-design/body_fat.png',
imagePath: 'bmr_calc.svg',
subTitle: TranslationBase.of(context).fat,
isPngImage: true,
),
));
@ -212,9 +212,9 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
),
child: MedicalProfileItem(
title: TranslationBase.of(context).carbohydrate,
imagePath: 'assets/images/new-design/carb_protein.png',
imagePath: 'carbs_proteitn_fat.svg',
subTitle: TranslationBase.of(context).proteinFat,
isPngImage: true,
),
));
@ -231,9 +231,8 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
),
child: MedicalProfileItem(
title: TranslationBase.of(context).ovulation,
imagePath: 'assets/images/new-design/ovulation_period_icon.png',
imagePath: 'ovulation.svg',
subTitle: TranslationBase.of(context).period,
isPngImage: true,
),
));
@ -244,9 +243,8 @@ class _HealthCalculatorsState extends State<HealthCalculators> with SingleTicker
),
child: MedicalProfileItem(
title: TranslationBase.of(context).delivery,
imagePath: 'assets/images/new-design/delivery_date_icon.png',
imagePath: 'delivery.svg',
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/blooddonation/blood_groub_details.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/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/Blood/user_agreement_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -34,28 +30,20 @@ class BloodDonationPage extends StatefulWidget {
}
class _BloodDonationPageState extends State<BloodDonationPage> {
TextEditingController _fileTextController = TextEditingController();
TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON;
// Gender gender = Gender.Male; //Gender.NON;
// Blood blood = Blood.Aminus; //Blood.NON;
//HospitalsModel _selectedHospital;
CitiesModel _selectedHospital;
int _selectedHospitalIndex = 0;
int _selectedGenderIndex = 1;
int _selectedBloodTypeIndex = 0;
String _selectedBloodType = "O+";
String amount = "";
String email;
PatientInfo _selectedPatientInfo;
AuthenticatedUser authenticatedUser;
GetAllSharedRecordsByStatusList selectedPatientFamily;
AdvanceModel advanceModel = AdvanceModel();
List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-");
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
var checkedValue = false;
List<ImagesInfo> imagesInfo = List();
@ -66,21 +54,17 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
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'),
);
WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectProvider.isLogin) authUser = projectProvider.user;
});
WidgetsBinding.instance.addPostFrameCallback((_) {});
super.initState();
}
int getSelectedCityID(MyBalanceViewModel model) {
int cityID = 1;
model.CitiesModelList.forEach((element) {
if (element.description == model.bloodModelList[0].city) {
cityID = element.iD;
}
});
return cityID;
}
@ -89,22 +73,42 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
projectProvider = Provider.of(context);
return BaseView<MyBalanceViewModel>(
onModelReady: (model) {
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;
} else {
_selectedHospital = model.CitiesModelList[0];
}
});
onModelReady: (model) => 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];
}
});
},
}),
// {
// 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(
isShowAppBar: true,
showNewAppBar: true,
@ -177,7 +181,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
);
}).withBorderedContainer,
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 = [
RadioSelectionDialogModel("O+", 0),
RadioSelectionDialogModel("O-", 1),
@ -197,6 +201,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
isScrollable: true,
onValueSelected: (index) {
_selectedBloodTypeIndex = index;
_selectedBloodType = getBlood(index);
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) {
if (_selectedHospital != null)
return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;

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

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

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

@ -342,7 +342,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Select Project",
TranslationBase.of(context).selectHospital,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
@ -354,7 +354,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
key: projectDropdownKey,
hint: new Text("Select Project"),
hint: new Text(TranslationBase.of(context).selectHospital),
value: projectDropdownValue,
iconSize: 0,
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.speciality != null)
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),
),
if (doctor.nearestFreeSlot != null)

@ -58,7 +58,6 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
@override
Widget build(BuildContext 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(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,

@ -55,51 +55,6 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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)),
...List.generate(
widget.proceduresList.length,
@ -144,29 +99,6 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
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/size_config.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/services/authentication/auth_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/otp/sms-popup.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/material.dart';
@ -41,6 +39,7 @@ class _AddMember extends State<AddMember> {
var familyFileProvider = FamilyFilesProvider();
var patientShareRequestID;
var patientShareResponseID;
@override
void initState() {
@ -50,67 +49,71 @@ class _AddMember extends State<AddMember> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: isLoading == true
? AppCircularProgressIndicator()
: SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: isLoading == true
? AppCircularProgressIndicator()
: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(21.0),
height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[
Expanded(
flex: 2,
child: AppText(
TranslationBase.of(context).enterNationalId,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
)),
Expanded(
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(
children: <Widget>[
Expanded(
flex: 1,
child: Text(
loginType == 1 ? TranslationBase.of(context).enterNationalId : TranslationBase.of(context).enterFile,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
)),
Expanded(
flex: 4,
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,
))
],
PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
SizedBox(
height: 12,
),
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() {
@ -158,28 +161,30 @@ class _AddMember extends State<AddMember> {
}
insertFamilyData(addMemberResult) {
var request = InsertSharePatientFileReq();
request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID'];
request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName'];
request.status = 2;
if (request.patientOutSA == 1) {
request.regionID = 2;
} else {
request.regionID = 1;
}
loading(true);
familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value));
sendActivationCode(addMemberResult);
// var request = InsertSharePatientFileReq();
// request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID'];
// request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName'];
// request.status = 2;
// if (request.patientOutSA == 1) {
// request.regionID = 2;
// } else {
// request.regionID = 1;
// }
// loading(true);
// familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)).catchError((err) {
// loading(false);
// AppToast.showErrorToast(message: err);
// });
}
sendActivationCode(result) {
// var request = this.getCommonRequest();
loading(true);
patientShareRequestID = result['PatientShareRequestID'];
familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text).then((result) => {
if (result != null && result['isSMSSent'] == true) {this.startSMSService(1, result)}
// {loading(false), this.startSMSService(type)}
// else
// {loading(false)}
patientShareResponseID = result['ShareFamilyFileObj']['ReponseID'];
familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text, patientShareResponseID).then((res) => {
patientShareRequestID = res['PatientShareRequestID'],
if (res != null && res['isSMSSent'] == true) {this.startSMSService(1, res)}
});
}
@ -204,7 +209,7 @@ class _AddMember extends State<AddMember> {
checkActivationCode(value, result) {
Navigator.pop(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);
handleFamilyRequests(this.patientShareRequestID, 3);
}).catchError((err) {
@ -216,12 +221,12 @@ class _AddMember extends State<AddMember> {
}
handleFamilyRequests(id, stauts) {
familyFileProvider.acceptAndRejectRecievedRequests(id, stauts).then((result) => {
sharedPref.remove(FAMILY_FILE),
Navigator.of(context).pushNamed(
MY_FAMILIY,
)
});
// familyFileProvider.acceptAndRejectRecievedRequests(id, stauts).then((result) => {
sharedPref.remove(FAMILY_FILE);
Navigator.of(context).pushNamed(
MY_FAMILIY,
);
// });
}
loading(flag) {

@ -26,11 +26,11 @@ class AddFamilyMemberType extends StatelessWidget {
padding: EdgeInsets.zero,
physics: BouncingScrollPhysics(),
children: [
SizedBox(height: 12),
SizedBox(height: 21),
HabibLogoWidget(),
SizedBox(height: 50),
SizedBox(height: 21),
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),
),
GridView(

@ -27,7 +27,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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_scaffold_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)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else
return ListView.separated(
itemBuilder: (context, index) {
if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3)
return Container(
margin: EdgeInsets.all(5),
decoration: cardRadius(
15,
elevation: 0,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0xffFDA4B0) : Color(0xff6EA8FF),
),
child: Container(
// height: 130,0xffFDA4B0
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
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(
return checkActive(snapshot.data.getAllSharedRecordsByStatusList) > 0
? ListView.separated(
itemBuilder: (context, index) {
if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3)
return Container(
margin: EdgeInsets.all(5),
decoration: cardRadius(
15,
elevation: 0,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0xffFDA4B0) : Color(0xff6EA8FF),
),
child: Container(
// height: 130,0xffFDA4B0
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(height: 10),
InkWell(
onTap: () {
switchUser(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/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,
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: [
SizedBox(height: 10),
InkWell(
onTap: () {
switchUser(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/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
return SizedBox(height: 0);
},
separatorBuilder: (context, index) => SizedBox(height: 0),
itemCount: snapshot.data.getAllSharedRecordsByStatusList.length);
)));
// else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0)
// return getNoDataWidget(context);
else
return SizedBox(height: 0);
},
separatorBuilder: (context, index) => SizedBox(height: 0),
itemCount: snapshot.data.getAllSharedRecordsByStatusList.length)
: getNoDataWidget(context);
}
},
),
@ -290,176 +291,98 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: Column(
children: <Widget>[
FractionallySizedBox(
widthFactor: 1.0,
child: AppExpandableNotifier(
title: TranslationBase.of(context).userViewRequest,
bodyWidget: FutureBuilder(
future: getUserViewRequest(), // async work
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return SizedBox();
widthFactor: 1.0,
child: AppExpandableNotifier(
title: TranslationBase.of(context).userViewRequest,
bodyWidget: FutureBuilder(
future: getUserViewRequest(), // async work
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return SizedBox();
default:
if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else
return ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(width: 1, color: Color(0xffEFEFEF)),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
color: Colors.white),
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)),
])),
Padding(
padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: 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: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22),
onPressed: () {
acceptRemoveRequest(result.iD, 3, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22),
color: Colors.white,
onPressed: () {
acceptRemoveRequest(result.iD, 4, context);
},
))
],
));
}).toList())
])
],
));
},
separatorBuilder: (context, index) => SizedBox(height: 14),
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())
// ])
// ],
// )));
// }
// })
// ],
// ),
// ),
default:
if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else
return ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(width: 1, color: Color(0xffEFEFEF)),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
color: Colors.white),
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)),
])),
Padding(
padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: 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: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22),
onPressed: () {
acceptRemoveRequest(result.iD, 3, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22),
color: Colors.white,
onPressed: () {
acceptRemoveRequest(result.iD, 4, context);
},
))
],
));
}).toList())
])
],
));
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: 1);
}
},
),
),
),
SizedBox(height: 15),
FractionallySizedBox(
widthFactor: 1.0,
@ -521,18 +444,21 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
fontSize: 12,
)),
Expanded(
flex: 1,
child: Card(
// shape: cardRadius(10),
color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127),
child: Padding(
padding: EdgeInsets.all(5),
child: AppText(
result.statusDescription,
color: Colors.white,
textAlign: TextAlign.center,
fontSize: 12,
)))),
flex: 1,
child: Card(
// shape: cardRadius(10),
color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127),
child: Padding(
padding: EdgeInsets.all(5),
child: AppText(
result.statusDescription != null ? result.statusDescription : "",
color: Colors.white,
textAlign: TextAlign.center,
fontSize: 12,
),
),
),
),
],
));
}).toList(),

@ -34,7 +34,6 @@ class NotificationsDetailsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
@ -59,44 +58,45 @@ class NotificationsDetailsPage extends StatelessWidget {
fontSize: 18.0,
color: Colors.black,
fontWeight: FontWeight.w600
),
),
),
),
),
SizedBox(
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(
height: 15,
),
SizedBox(
height: 15,
),
Row(
children: [
Expanded(
child: Center(
child: Text(notification.message),
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(
height: 15,
),
Row(
children: [
Expanded(
child: Center(
child: Text(notification.message),
),
),
),
],
),
],
],
),
],
),
),
),
),

@ -78,7 +78,7 @@ class _AmbulanceReqState extends State<AmbulanceReq> with SingleTickerProviderSt
),
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
physics: NeverScrollableScrollPhysics(),
controller: _tabController,
children: <Widget>[
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_RC.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/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/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart';
import 'package:diplomaticquarterapp/uitl/utils.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'BillAmount.dart';
import 'PickupLocation.dart';
@ -20,8 +29,7 @@ class AmbulanceRequestIndexPage extends StatefulWidget {
AmbulanceRequestIndexPage({Key key, this.amRequestViewModel});
@override
_AmbulanceRequestIndexPageState createState() =>
_AmbulanceRequestIndexPageState();
_AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState();
}
class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@ -33,12 +41,15 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
TransportationDetails transportationDetails = new TransportationDetails();
int status;
String _statusDisp;
Color _color;
_changeCurrentTab(int tab) {
setState(() {
currentIndex = tab;
});
pageController.animateToPage(tab,
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
}
@override
@ -50,79 +61,268 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@override
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(
body: widget.amRequestViewModel.pendingAmbulanceRequestOrder != null
body: widget.amRequestViewModel.pendingAmbulanceRequestOrder != null && order != null
? SingleChildScrollView(
child: Column(
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 18, right: 18),
margin: EdgeInsets.all(21),
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: 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,
color: _color,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
OrderLogItem(
title: TranslationBase.of(context).transportMethod,
value: widget
.amRequestViewModel.pendingAmbulanceRequestOrder.serviceText,
],
),
child: Container(
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),
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),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
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: 20.0,
),
],
),
),
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
SizedBox(height: 12),
if (order.statusId == 1 || order.statusId == 2)
InkWell(
onTap: () {
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(
children: [
SizedBox(
@ -173,8 +373,25 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
);
}
String getDate(String date) {
return date.split("T")[0];
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;
}
}

@ -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_RC.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/utils_new.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -45,269 +44,222 @@ class _BillAmountState extends State<BillAmount> {
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
margin: EdgeInsets.only(left: 12, right: 12, top: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).billAmount),
Text(TranslationBase.of(context).billAmount, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 10,
),
Table(
border: TableBorder.symmetric(inside: BorderSide(width: 1.0, color: Colors.grey[300]), outside: BorderSide(width: 1.0, color: Colors.grey[300])),
children: [
TableRow(
Container(
decoration: cardRadius(12),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).patientShareB,
textAlign: TextAlign.start,
color: Colors.black,
fontSize: 15,
),
width: double.infinity,
padding: EdgeInsets.only(top: 10, bottom: 3),
child: Row(
children: [
Expanded(
child: _getNormalText(TranslationBase.of(context).patientShareToDo),
),
Expanded(
child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.price}', isBold: true),
)
],
),
),
mDivider(Colors.grey[200]),
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.price}',
color: Colors.black,
textAlign: TextAlign.start,
fontSize: 15,
),
width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3),
child: Row(
children: [
Expanded(
child: _getNormalText(TranslationBase.of(context).patientTaxToDo),
),
Expanded(
child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceVAT}', isBold: true),
)
],
),
),
],
),
TableRow(
children: [
mDivider(Colors.grey[200]),
Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.09,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).patientShareTax,
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
),
),
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,
),
width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3),
child: Row(
children: [
Expanded(
child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo),
),
Expanded(
child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}', isBold: true, isTotal: true),
)
],
),
),
],
),
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(
height: 10,
),
Texts(
TranslationBase.of(context).selectAmbulate,
bold: false,
),
Text(TranslationBase.of(context).selectAmbulate, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 5,
),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Wheelchair;
});
},
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(
title: Text(TranslationBase.of(context).wheelchair, style: TextStyle(
fontSize: 14.0
)),
leading: Radio(
value: Ambulate.Wheelchair,
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Wheelchair;
});
},
child: Container(
width: MediaQuery.of(context).size.width * 0.9,
child: ListTile(
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Radio(
value: Ambulate.Wheelchair,
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
Text(
TranslationBase.of(context).wheelchair,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Walker;
});
},
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(
title: Text(TranslationBase.of(context).walker, style: TextStyle(
fontSize: 14.0
)),
leading: Radio(
value: Ambulate.Walker,
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
],
),
Row(
children: [
InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Walker;
});
},
child: Container(
width: MediaQuery.of(context).size.width * 0.9,
child: ListTile(
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Radio(
value: Ambulate.Walker,
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
Text(
TranslationBase.of(context).walker,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
),
),
),
),
],
),
SizedBox(
height: 5,
),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Stretcher;
});
},
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(
title: Text(TranslationBase.of(context).stretcher, style: TextStyle(
fontSize: 14.0
)),
leading: Radio(
value: Ambulate.Stretcher,
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Stretcher;
});
},
child: Container(
width: MediaQuery.of(context).size.width * 0.9,
child: ListTile(
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Radio(
value: Ambulate.Stretcher,
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
Text(
TranslationBase.of(context).stretcher,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.None;
});
},
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(
title: Text(TranslationBase.of(context).none, style: TextStyle(
fontSize: 14.0
)),
leading: Radio(
value: Ambulate.None,
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
],
),
Row(
children: [
InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.None;
});
},
child: Container(
width: MediaQuery.of(context).size.width * 0.9,
child: ListTile(
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Radio(
value: Ambulate.None,
groupValue: _ambulate,
onChanged: (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(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context).notes,
initialValue: note,
onChanged: (value) {
setState(() {
note = value;
});
},
Container(
decoration: cardRadius(10),
child: Padding(
padding: EdgeInsets.all(8.0),
child: TextField(
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(
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/viewModels/er/am_request_view_model.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/uitl/ProgressDialog.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/widgets/buttons/defaultButton.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/pickupLocation/PickupLocationFromMap.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
@ -51,9 +50,7 @@ class _PickupLocationState extends State<PickupLocation> {
void initState() {
super.initState();
_getCurrentLocation();
setState(() {
});
setState(() {});
}
_getCurrentLocation() async {
@ -64,7 +61,6 @@ class _PickupLocationState extends State<PickupLocation> {
_longitude = 0;
_latitude = 0;
});
}
@override
@ -75,7 +71,7 @@ class _PickupLocationState extends State<PickupLocation> {
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
margin: EdgeInsets.only(left: 12, right: 12, top: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -83,43 +79,66 @@ class _PickupLocationState extends State<PickupLocation> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).pickupLocation),
Text(TranslationBase.of(context).pickupLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 15,
),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: PickupLocationFromMap(
latitude: _latitude??0,
longitude: _longitude??0,
onPick: (value) {
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,
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: () {
Navigator.push(
context,
FadePage(
page: PickupLocationFromMap(
latitude: _latitude ?? 0,
longitude: _longitude ?? 0,
onPick: (value) {
setState(() {
_result = value;
});
},
)),
);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getSelectFromMapName(context))),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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(
height: 12,
),
Texts(TranslationBase.of(context).pickupSpot),
Text(TranslationBase.of(context).pickupSpot, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 5,
),
@ -138,21 +157,27 @@ class _PickupLocationState extends State<PickupLocation> {
});
},
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(
title: Texts(TranslationBase.of(context).insideHome),
leading: Checkbox(
value: _isInsideHome,
onChanged: (value) {
setState(() {
_isInsideHome = value;
});
},
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Checkbox(
value: _isInsideHome,
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(
height: 12,
),
Texts(TranslationBase.of(context).haveAppo),
Text(TranslationBase.of(context).haveAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 5,
),
@ -177,25 +202,31 @@ class _PickupLocationState extends State<PickupLocation> {
}
},
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(
title: Texts(TranslationBase.of(context).yes),
leading: Radio(
value: HaveAppointment.YES,
groupValue: _haveAppointment,
onChanged: (value) {
if (myAppointment == null) {
getAppointment();
setState(() {
_haveAppointment = value;
});
}
},
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Radio(
value: HaveAppointment.YES,
groupValue: _haveAppointment,
onChanged: (value) {
if (myAppointment == null) {
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(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).no),
leading: Radio(
value: HaveAppointment.NO,
groupValue: _haveAppointment,
onChanged: (value) {
setState(() {
_haveAppointment = value;
myAppointment = null;
});
},
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Radio(
value: HaveAppointment.NO,
groupValue: _haveAppointment,
onChanged: (value) {
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(
height: 12,
),
Texts(TranslationBase.of(context).dropoffLocation),
Text(TranslationBase.of(context).dropoffLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals);
},
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,
Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: () {
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getHospitalName(TranslationBase.of(context).selectHospital)),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
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(Icons.arrow_drop_down),
],
),
),
@ -284,26 +344,54 @@ class _PickupLocationState extends State<PickupLocation> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).pickupLocation),
Text(TranslationBase.of(context).pickupLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 15,
),
InkWell(
onTap: () {
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals);
},
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,
Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: () {
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
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(
Icons.arrow_drop_down,
size: 24,
@ -316,44 +404,67 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).dropoffLocation),
Text(TranslationBase.of(context).dropoffLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
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,
Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
setState(() {
_result = value;
});
},
),
),
);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getSelectFromMapName(context))),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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.pickupLocationName = widget.patientER.direction == 0 ? _selectedHospital.name : _result.formattedAddress;
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.lineItemNo = 0;
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) {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name + ' ${hospitals[i].distanceInKilometers} ' + TranslationBase.of(context).km, i),
];
showDialog(
context: context,
child: SelectHospitalDialog(
hospitals: hospitals,
selectedHospital: _selectedHospital,
onValueSelected: (value) {
setState(() {
_selectedHospital = value;
});
child: RadioSelectionDialog(
listData: list,
selectedIndex: _selectedHospitalIndex,
isScrollable: true,
onValueSelected: (index) {
_selectedHospitalIndex = index;
_selectedHospital = hospitals[index];
setState(() {});
},
),
);
@ -462,7 +579,7 @@ class _PickupLocationState extends State<PickupLocation> {
}
String getSelectFromMapName(context) {
return _result != null ? _result.formattedAddress : TranslationBase.of(context).selectMap;
return _result != null ? _result.formattedAddress : "";
}
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/project_view_model.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -71,56 +71,77 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).transportHeading),
...List.generate(
widget.amRequestViewModel.amRequestModeList.length,
(index) => InkWell(
onTap: () {
setState(() {
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList[index];
});
},
child: Container(
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
children: [
Expanded(
flex: 3,
child: ListTile(
title: Texts(projectViewModel.isArabic ? widget.amRequestViewModel.amRequestModeList[index].textN : widget.amRequestViewModel.amRequestModeList[index].text),
leading: Radio(
value: widget.amRequestViewModel.amRequestModeList[index],
groupValue: _erTransportationMethod,
onChanged: (value) {
setState(() {
_erTransportationMethod = value;
});
},
),
Text(TranslationBase.of(context).transportHeading, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
Container(
margin: EdgeInsets.only(top: 12),
decoration: cardRadius(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
widget.amRequestViewModel.amRequestModeList.length,
(index) => InkWell(
onTap: () {
setState(() {
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList[index];
});
},
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 4,
child: ListTile(
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Radio(
value: widget.amRequestViewModel.amRequestModeList[index],
groupValue: _erTransportationMethod,
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(
height: 12,
),
Texts(TranslationBase.of(context).directionHeading),
SizedBox(
height: 5,
),
Text(TranslationBase.of(context).directionHeading, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
Container(
width: double.maxFinite,
child: Row(
@ -136,22 +157,26 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
},
child: Container(
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(
title: Texts(TranslationBase.of(context).toHospital),
leading: Radio(
value: Direction.ToHospital,
groupValue: _direction,
onChanged: (value) {
setState(() {
_direction = value;
});
},
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Radio(
value: Direction.ToHospital,
groupValue: _direction,
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(
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(
title: Texts(TranslationBase.of(context).fromHospital),
leading: Radio(
value: Direction.FromHospital,
groupValue: _direction,
onChanged: (value) {
setState(() {
_direction = value;
});
},
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Radio(
value: Direction.FromHospital,
groupValue: _direction,
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(
height: 8,
),
Texts(TranslationBase.of(context).wayHeading),
Text(TranslationBase.of(context).wayHeading, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 5,
),
@ -213,22 +242,26 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
});
},
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(
title: Texts(TranslationBase.of(context).oneDirec),
leading: Radio(
value: Way.OneWay,
groupValue: _way,
onChanged: (value) {
setState(() {
_way = value;
});
},
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Radio(
value: Way.OneWay,
groupValue: _way,
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(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).twoDirec),
leading: Radio(
value: Way.TwoWays,
groupValue: _way,
onChanged: (value) {
setState(() {
_way = value;
});
},
contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
title: Row(
children: [
Radio(
value: Way.TwoWays,
groupValue: _way,
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.tripType = _way == Way.TwoWays ? 0 : 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.transportationDetails.pickupUrgency = 1;
// 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/project_view_model.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -31,91 +31,73 @@ class _SummaryState extends State<Summary> {
isShowAppBar: false,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
margin: EdgeInsets.only(left: 12, right: 12, top: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).RRTSummary),
Text(TranslationBase.of(context).RRTSummary, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 5,
),
Container(
width: double.infinity,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
),
// margin: EdgeInsets.only(top: 12),
decoration: cardRadius(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).transportMethod,
color: Colors.grey,
),
_getNormalText(TranslationBase.of(context).transportMethod),
projectViewModel.isArabic
? Texts(
? _getNormalText(
'${widget.patientER_RC.patientERTransportationMethod.textN}',
bold: true,
isBold: true,
)
: Texts(
: _getNormalText(
'${widget.patientER_RC.patientERTransportationMethod.text}',
bold: true,
isBold: true,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).directions,
color: Colors.grey,
),
Texts(
_getNormalText(TranslationBase.of(context).directions),
_getNormalText(
widget.patientER_RC.transportationDetails.direction == 0 ? TranslationBase.of(context).toHospital : TranslationBase.of(context).fromHospital,
bold: true,
isBold: true,
),
SizedBox(
height: 8,
),
Texts(
_getNormalText(
TranslationBase.of(context).pickupLocation,
color: Colors.grey,
),
Texts(
_getNormalText(
'${widget.patientER_RC.transportationDetails.pickupLocationName}',
bold: true,
isBold: true,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).dropoffLocation,
color: Colors.grey,
),
Texts(
_getNormalText(TranslationBase.of(context).dropoffLocation),
_getNormalText(
'${widget.patientER_RC.transportationDetails.dropoffLocationName}',
bold: true,
isBold: true,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).selectAmbulate,
color: Colors.grey,
),
Texts(
_getNormalText(TranslationBase.of(context).selectAmbulate),
_getNormalText(
'${widget.patientER_RC.transportationDetails.ambulateTitle}',
bold: true,
isBold: true,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).notes,
color: Colors.grey,
),
Texts(
_getNormalText(TranslationBase.of(context).notes),
_getNormalText(
'${widget.patientER_RC.transportationDetails.notes ?? '---'}',
bold: true,
isBold: true,
),
SizedBox(
height: 8,
@ -126,23 +108,26 @@ class _SummaryState extends State<Summary> {
SizedBox(
height: 20,
),
Texts(
TranslationBase.of(context).billAmount,
textAlign: TextAlign.start,
),
Text(TranslationBase.of(context).billAmount, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 5,
),
Container(
height: 55,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
decoration: cardRadius(12),
child: Row(
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 'AmbulanceReq.dart';
import 'EdOnline/DdServicesPage.dart';
import 'NearestEr.dart';
class ErOptions extends StatefulWidget {
@ -75,26 +74,26 @@ class _ErOptionsState extends State<ErOptions> {
),
InkWell(
onTap: () {
// Navigator.push(context, FadePage(page: DdServicesPage()));
if (rrtLocked) Navigator.push(context, FadePage(page: RRTMainScreen()));
},
child: MedicalProfileItem(
title: "ED",
title: TranslationBase.of(context).RRTTitle,
imagePath: 'assets/images/new-design/AM.PNG',
subTitle: TranslationBase.of(context).service,
subTitle: TranslationBase.of(context).RRTSubTitle,
isPngImage: true,
isEnable: false,
isEnable: rrtLocked,
),
),
InkWell(
onTap: () {
if(rrtLocked) Navigator.push(context, FadePage(page: RRTMainScreen()));
// Navigator.push(context, FadePage(page: DdServicesPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).rrtService,
title: "ED",
imagePath: 'assets/images/new-design/AM.PNG',
subTitle: TranslationBase.of(context).service,
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/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/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class OrderLogPage extends StatelessWidget {
final AmRequestViewModel amRequestViewModel;
@ -12,64 +21,232 @@ class OrderLogPage extends StatelessWidget {
@override
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(
margin: EdgeInsets.all(10),
// margin: EdgeInsets.all(10),
padding: EdgeInsets.all(8),
child: ListView.builder(
itemCount: amRequestViewModel.patientAmbulanceRequestOrdersList.length,
itemBuilder: (context, index) => Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(2),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
OrderLogItem(
title: TranslationBase.of(context).reqId,
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].id.toString(),
),
OrderLogItem(
title: TranslationBase.of(context).orderStatus,
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].statusText,
),
OrderLogItem(
title: TranslationBase.of(context).pickupDate,
value: getDate(amRequestViewModel.patientAmbulanceRequestOrdersList[index].created),
),
OrderLogItem(
title: TranslationBase.of(context).pickupLocation,
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].pickupLocation,
),
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),
child: amRequestViewModel.patientAmbulanceRequestOrdersList.length > 0
? ListView.builder(
padding: EdgeInsets.all(21),
itemCount: amRequestViewModel.patientAmbulanceRequestOrdersList.length,
itemBuilder: (context, index) {
AmbulanceRequestOrdersModel order = amRequestViewModel.patientAmbulanceRequestOrdersList[index];
int status = order.statusId;
String _statusDisp = order.statusText;
Color _color;
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 Container(
margin: EdgeInsets.only(bottom: 12.0),
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(
bottomRight: Radius.circular(12),
bottomLeft: Radius.circular(12),
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),
),
color: Colors.white),
child: SecondaryButton(
color: Colors.red[900],
textColor: Colors.white,
label: TranslationBase.of(context).cancel,
onTap: () {
amRequestViewModel.updatePressOrder(presOrderID: amRequestViewModel.pendingAmbulanceRequestOrder.id);
},
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
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/prescriptions/prescriptions_order.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/base/base_view.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/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 {
final List<GetCMCAllOrdersResponseModel> orders;
@ -36,13 +36,15 @@ class RRTLogPageState extends State<RRTLogPage> {
viewModel = vm,
},
builder: (ctx, vm, widgetState) {
return ListView.builder(
itemCount: widget.orders.length,
padding: EdgeInsets.all(21),
itemBuilder: (ctx, idx) {
var order = widget.orders[idx];
return RRTLogListItem(order, onCancel: deleteOrder);
});
return widget.orders.length > 0
? ListView.builder(
itemCount: widget.orders.length,
padding: EdgeInsets.all(21),
itemBuilder: (ctx, idx) {
var order = widget.orders[idx];
return RRTLogListItem(order, onCancel: deleteOrder);
})
: getNoDataWidget(context);
});
}
@ -58,4 +60,4 @@ class RRTLogPageState extends State<RRTLogPage> {
Navigator.push(context, FadePage(page: RRTMainScreen()));
}
}
}
}

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

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

@ -63,7 +63,7 @@ class RRTPlaceOrderPage extends StatelessWidget {
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(10),
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,
),
),

@ -1,5 +1,4 @@
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/models/rrt/service_price.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/gif_loader_dialog_utils.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/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
@ -65,7 +65,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
child: Text(TranslationBase.of(context).youCanPayByTheFollowingOptions,
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/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/material.dart';
import 'package:provider/provider.dart';
@ -12,216 +14,331 @@ class StepsWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return projectViewModel.isArabic?
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,
return Container(
width: double.infinity,
padding: EdgeInsets.only(left: 12, right: 12, bottom: 12),
child: Row(
children: [
Expanded(
child: showProgress(
title: TranslationBase.of(context).transportation,
status: index == 0
? TranslationBase.of(context).inPrgress
: index > 0
? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
color: index == 0 ? CustomColors.orange : CustomColors.green,
),
),
),
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],
),
),
Expanded(
child: showProgress(
title: TranslationBase.of(context).locationa,
status: index == 1
? TranslationBase.of(context).inPrgress
: index > 1
? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
color: index == 1
? CustomColors.orange
: index > 1
? CustomColors.green
: CustomColors.grey2,
),
),
),
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],
),
),
Expanded(
child: showProgress(
title: TranslationBase.of(context).otherInfo,
status: index == 2
? TranslationBase.of(context).inPrgress
: index > 2
? TranslationBase.of(context).completed
: TranslationBase.of(context).locked,
color: index == 2
? CustomColors.orange
: index > 2
? CustomColors.green
: CustomColors.grey2,
),
),
),
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],
),
),
),
showProgress(
title: TranslationBase.of(context).RRTSummary,
status: index == 3 ? TranslationBase.of(context).inPrgress : TranslationBase.of(context).locked,
color: index == 3
? CustomColors.orange
: index > 4
? CustomColors.green
: CustomColors.grey2,
isNeedBorder: false,
),
),
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(
// return projectViewModel.isArabic?
// 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,
// 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: [
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],
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
width: 26,
height: 26,
decoration: containerRadius(color, 200),
child: Icon(
Icons.done,
color: Colors.white,
size: 16,
),
),
),
if (isNeedBorder)
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: mDivider(Colors.grey),
)),
],
),
),
),
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],
),
mHeight(8),
Text(
title,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
letterSpacing: -0.44,
),
),
),
),
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],
mHeight(2),
Container(
padding: EdgeInsets.all(5),
decoration: containerRadius(color.withOpacity(0.2), 4),
child: Text(
status,
style: TextStyle(
fontSize: 8,
fontWeight: FontWeight.w600,
letterSpacing: -0.32,
color: color,
),
),
),
),
),
],
)
],
);
}

@ -1,8 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.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/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.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/translations_delegate_base.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/my_rich_text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
@ -40,7 +41,7 @@ class ToDo extends StatefulWidget {
bool isShowAppBar = true;
Function onBackClick;
ToDo({@required this.isShowAppBar,this.onBackClick});
ToDo({@required this.isShowAppBar, this.onBackClick});
@override
_ToDoState createState() => _ToDoState();
@ -49,11 +50,7 @@ class ToDo extends StatefulWidget {
class _ToDoState extends State<ToDo> {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
List<ImagesInfo> imagesInfo = List();
ToDoCountProviderModel toDoProvider;
CountdownTimerController controller;
@ -63,7 +60,7 @@ class _ToDoState extends State<ToDo> {
void initState() {
widget.patientShareResponse = new PatientShareResponse();
WidgetsBinding.instance.addPostFrameCallback((_) {
if (authenticatedUserObject.isLogin) getPatientData();
getPatientAppointmentHistory();
});
super.initState();
imagesInfo
@ -85,7 +82,7 @@ class _ToDoState extends State<ToDo> {
showNewAppBarTitle: true,
icon: "assets/images/new/bottom_nav/todo.svg",
description: TranslationBase.of(context).infoTodo,
onTap:widget.onBackClick,
onTap: widget.onBackClick,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: SingleChildScrollView(
child: Column(
@ -98,207 +95,353 @@ class _ToDoState extends State<ToDo> {
padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length,
itemBuilder: (context, index) {
print("ttt " + getNextActionImage(widget.appoList[index].nextAction));
print("ttt " + widget.appoList[index].nextAction.toString());
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(
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),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
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(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.min,
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
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)),
RatingBar.readOnly(
initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
],
),
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),
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Text(
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),
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))
],
),
InkWell(
onTap: () {
navigateToAppointmentDetails(context, widget.appoList[index]);
},
child: Padding(
padding: const EdgeInsets.only(top: 0.0),
child: Text(
TranslationBase.of(context).moreDetails,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48, height: 25 / 16, decoration: TextDecoration.underline),
),
),
),
],
),
);
// 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) {
switch (nextAction) {
case 0:
@ -732,35 +917,34 @@ class _ToDoState extends State<ToDo> {
});
}
getPatientData() async {
AppSharedPreferences sharedPref = AppSharedPreferences();
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
setState(() {
print(data);
authUser = data;
});
getPatientAppointmentHistory();
}
}
// getPatientData() async {
// AppSharedPreferences sharedPref = AppSharedPreferences();
// if (await sharedPref.getObject(USER_PROFILE) != null) {
// var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
// setState(() {
// print(data);
// authUser = data;
// });
// getPatientAppointmentHistory();
// }
// }
Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
setState(() {
authUser = data;
});
}
Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd) {
// if (await this.sharedPref.getObject(USER_PROFILE) != null) {
// var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
// setState(() {
// authUser = data;
// });
// }
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) {
setState(() {});
}))).then((value) {
print(value);
getPatientAppointmentHistory();
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/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class PaymentMethod extends StatefulWidget {
Function onSelectedMethod;
bool isShowInstallments;
PaymentMethod({this.onSelectedMethod});
PaymentMethod({this.onSelectedMethod, this.isShowInstallments = false});
@override
_PaymentMethodState createState() => _PaymentMethodState();
@ -185,55 +187,57 @@ class _PaymentMethodState extends State<PaymentMethod> {
),
),
),
Container(
width: double.infinity,
child: InkWell(
onTap: () {
updateSelectedPaymentMethod("Installment");
},
child: Card(
elevation: 0.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
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: Row(
children: [
Container(
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")
if (widget.isShowInstallments)
Container(
width: double.infinity,
child: InkWell(
onTap: () {
updateSelectedPaymentMethod("Installment");
},
child: Card(
elevation: 0.0,
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
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: Row(
children: [
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,
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: 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
? Container(
width: double.infinity,

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

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

Loading…
Cancel
Save