Merge branch 'mirza_home_page' into 'development_new_design_2.0'

Mirza home page

See merge request Cloud_Solution/diplomatic-quarter!492
merge-update-with-lab-changes
haroon amjad 4 years ago
commit e7ec613cd4

@ -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

@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -1149,7 +1149,7 @@ const Map localizedValues = {
"triglycerides": {"en": "Triglycerides", "ar": "الدهون الثلاثية"}, "triglycerides": {"en": "Triglycerides", "ar": "الدهون الثلاثية"},
"fatInBlood": {"en": "Fat in Blood", "ar": ""}, "fatInBlood": {"en": "Fat in Blood", "ar": ""},
"convertFrom": {"en": "Convert from", "ar": "تحويل من"}, "convertFrom": {"en": "Convert from", "ar": "تحويل من"},
"calculate": {"en": "calculate", "ar": "احسب"}, "calculate": {"en": "Calculate", "ar": "احسب"},
"enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"}, "enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"},
"result": {"en": "Result", "ar": "النتيجة"}, "result": {"en": "Result", "ar": "النتيجة"},
"sort": {"en": "Sort", "ar": "فرز"}, "sort": {"en": "Sort", "ar": "فرز"},
@ -1195,8 +1195,8 @@ const Map localizedValues = {
"ovulation": {"en": "Ovulation", "ar": "الإباضة"}, "ovulation": {"en": "Ovulation", "ar": "الإباضة"},
"delivery": {"en": "Delivery", "ar": "الولادة"}, "delivery": {"en": "Delivery", "ar": "الولادة"},
"bmiCalcDesc": { "bmiCalcDesc": {
"en": "'Calculate the BMI value and weight\n status to identify the healthy weight.\n Not appropriate for children and women\n who are pregnant or breastfeeding'", "en": "Calculate the BMI value and weight status to identify the healthy weight. Not appropriate for children and women who are pregnant or breastfeeding",
"ar": "حساب قيمة مؤشر كتلة الجسم وحالة الوزن لتحديد الوزن الصحي. \n وغير مناسب للأطفال والنساء الحوامل أو المرضعات" "ar": "احسب قيمة مؤشر كتلة الجسم وحالة الوزن لتحديد الوزن الصحي. غير مناسب للأطفال والنساء الحوامل أو المرضعات"
}, },
"selectUnit": {"en": "Select Unit", "ar": "اختر الوحدة"}, "selectUnit": {"en": "Select Unit", "ar": "اختر الوحدة"},
"feet": {"en": "Feet", "ar": "قدم"}, "feet": {"en": "Feet", "ar": "قدم"},
@ -1630,4 +1630,9 @@ const Map localizedValues = {
"RRTTitle": {"en": "RRT", "ar": "خدمة فريق"}, "RRTTitle": {"en": "RRT", "ar": "خدمة فريق"},
"RRTSubTitle": {"en": "Service", "ar": "الاستجابة السريع"}, "RRTSubTitle": {"en": "Service", "ar": "الاستجابة السريع"},
"transportation": {"en": "Transportation", "ar": "النقل"}, "transportation": {"en": "Transportation", "ar": "النقل"},
"neck": {"en": "Neck", "ar": "رقبه"},
"waist": {"en": "Waist", "ar": "وسط"},
"hip": {"en": "Hip", "ar": "ورك او نتوء"},
"carbsProtin": {"en": "Carbs, Protein and Fat", "ar": "الكربوهيدرات والبروتينات والدهون"},
}; };

@ -1,11 +1,14 @@
import 'dart:math'; import 'dart:math';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../health_calc_desc.dart'; import '../health_calc_desc.dart';
import 'result_page.dart'; import 'result_page.dart';
@ -23,52 +26,17 @@ class _BMICalculatorState extends State<BMICalculator> {
String textResult; String textResult;
String msg; String msg;
double bmiResult; double bmiResult;
int height = 150;
int weight = 40;
Color cmCard = activeCardColor;
Color ftCard = inactiveCardColor;
Color lbCard = inactiveCardColor;
Color kgCard = activeCardColor;
void updateColor(int type) { TextEditingController _heightController = TextEditingController();
//MG/DLT card TextEditingController _weightController = TextEditingController();
if (type == 1) {
if (cmCard == inactiveCardColor) {
cmCard = activeCardColor;
ftCard = inactiveCardColor;
} else {
cmCard = inactiveCardColor;
}
}
if (type == 2) {
if (ftCard == inactiveCardColor) {
ftCard = activeCardColor;
cmCard = inactiveCardColor;
} else {
ftCard = inactiveCardColor;
}
}
}
void updateColorWeight(int type) { List<PopupMenuItem> _weightPopupList = List();
//MG/DLT card List<PopupMenuItem> _heightPopupList = List();
if (type == 1) {
if (kgCard == inactiveCardColor) { bool _isHeightCM = true;
kgCard = activeCardColor; bool _isWeightKG = true;
lbCard = inactiveCardColor; double _heightValue = 150;
} else { double _weightValue = 40;
kgCard = inactiveCardColor;
}
}
if (type == 2) {
if (lbCard == inactiveCardColor) {
lbCard = activeCardColor;
kgCard = inactiveCardColor;
} else {
lbCard = inactiveCardColor;
}
}
}
double convertToCm(double number) { double convertToCm(double number) {
return number * 30.48; return number * 30.48;
@ -79,10 +47,10 @@ class _BMICalculatorState extends State<BMICalculator> {
} }
double calculateBMI() { double calculateBMI() {
if (ftCard == activeCardColor) { if (_isHeightCM) {
convertToCm(height.toDouble()); convertToCm(_heightValue.toDouble());
} }
bmiResult = weight / pow(height / 100, 2); bmiResult = _weightValue / pow(_heightValue / 100, 2);
return bmiResult; return bmiResult;
} }
@ -115,432 +83,275 @@ class _BMICalculatorState extends State<BMICalculator> {
void initState() { void initState() {
super.initState(); super.initState();
textController.text = '0'; // Setting the initial value for the field. textController.text = '0'; // Setting the initial value for the field.
_heightValue = 100;
_weightValue = 50;
_heightController.text = _heightValue.toStringAsFixed(0);
_weightController.text = _weightValue.toStringAsFixed(0);
_isWeightKG = true;
_isHeightCM = true;
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
_weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)];
_heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)];
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
showHomeAppBarIcon: false, showHomeAppBarIcon: false,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarIcons: [ appBarIcons: [
IconButton( IconButton(
icon: Icon(Icons.info_outline), icon: Icon(Icons.info_outline),
color: Colors.white, color: Colors.black,
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => HealthDescPage( builder: (context) => HealthDescPage("${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", TranslationBase.of(context).bmiCalcDesc,
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
TranslationBase.of(context).bmiCalcDesc,
"assets/images/AlHabibMedicalService/health_calculator/bmi.png")), "assets/images/AlHabibMedicalService/health_calculator/bmi.png")),
); );
}, },
) )
], ],
appBarTitle: appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", body: Column(
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Center( Expanded(
child: Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(vertical: 15.0), padding: const EdgeInsets.all(16.0),
child: Text(
TranslationBase.of(context).bmiCalcDesc,
style: TextStyle(fontSize: 18.0),
),
),
),
),
Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.0),
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Text(
children: [ TranslationBase.of(context).bmiCalcDesc,
Padding( style: TextStyle(
padding: EdgeInsets.all(8.0), fontSize: 14.0,
child: Texts(TranslationBase.of(context).height), letterSpacing: -0.56,
), fontWeight: FontWeight.w600,
], ),
), ),
Row( mHeight(24),
children: [ _commonInputAndUnitRow(
Padding( TranslationBase.of(context).height,
padding: EdgeInsets.symmetric( _heightController,
vertical: 10.0, horizontal: 8.0), 1,
child: Center( 270,
child: Container( _heightValue,
width: 60.0, (text) {
foregroundDecoration: BoxDecoration( _heightController.text = text;
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
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++;
});
}, },
), (value) {
), _heightValue = value;
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (height > 120) height--;
});
}, },
), _isHeightCM ? TranslationBase.of(context).cm : TranslationBase.of(context).ft,
], (value) {
), if (_isHeightCM != value) {
),
],
),
),
),
),
Slider(
value: height.toDouble(),
min: 120,
max: 250,
onChanged: (double newValue) {
setState(() { setState(() {
height = newValue.round(); _isHeightCM = value;
}); });
}
}, },
activeColor: Color(0xffC5272D), _heightPopupList,
inactiveColor: Color(0xffF3C5C6), ),
), mHeight(12),
], _commonInputAndUnitRow(
), TranslationBase.of(context).weight,
Row( _weightController,
children: [ 1,
Padding( 270,
padding: EdgeInsets.all(8.0), _weightValue,
child: Texts(TranslationBase.of(context).selectUnit), (text) {
), _weightController.text = text;
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColor(1);
});
}, },
child: Container( (value) {
height: 55.0, _weightValue = value;
width: 150.0, },
decoration: BoxDecoration( _isWeightKG ? TranslationBase.of(context).kg : TranslationBase.of(context).pound,
boxShadow: [ (value) {
BoxShadow( if (_isWeightKG != value) {
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(() { setState(() {
updateColor(2); _isWeightKG = value;
}); });
}
}, },
child: Container( _weightPopupList,
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( Container(
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(12.0), padding: EdgeInsets.all(16),
), child: SecondaryButton(
child: Column( label: TranslationBase.of(context).calculate,
children: [ color: CustomColors.accentColor,
Row(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).weight),
),
],
),
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: () { onTap: () {
setState(() { setState(() {
if (weight < 250) weight++; calculateBMI();
}); showTextResult(context);
}, showMsg(context);
), {
Navigator.push(
context,
FadePage(
page: ResultPage(
finalResult: bmiResult,
textResult: textResult,
msg: msg,
), ),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
), ),
onTap: () { );
setState(() { }
if (weight > 40) weight--;
}); });
}, },
), ),
],
),
),
],
),
),
),
),
Slider(
value: weight.toDouble(),
min: 40,
max: 250,
onChanged: (double newValue) {
setState(() {
weight = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
), ),
], ],
), ),
Row( );
}
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: [ children: [
Padding( Expanded(
padding: EdgeInsets.all(8.0), flex: 3,
child: Texts(TranslationBase.of(context).selectUnit), child: Column(
), mainAxisSize: MainAxisSize.min,
], crossAxisAlignment: CrossAxisAlignment.start,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
GestureDetector( Text(
onTap: () { _title,
setState(() { style: TextStyle(
updateColorWeight(1); 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;
}
}, },
child: Container( inputFormatters: [
height: 55.0, FilteringTextInputFormatter.allow(RegExp(r'[0-9]')),
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, style: TextStyle(
borderRadius: BorderRadius.circular(3.0), color: Color(0xff575757),
), letterSpacing: -0.56,
child: Padding( ),
padding: const EdgeInsets.symmetric( decoration: InputDecoration(
vertical: 0.0, horizontal: 18.0), isDense: true,
child: Center( hintText: "0",
child: Texts(TranslationBase.of(context).kg)), 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,
), ),
), ),
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)),
),
),
), ),
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),
)
], ],
), ),
),
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(
finalResult: bmiResult,
textResult: textResult,
msg: msg,
)),
); );
} }
}) }
},
), 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,16 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:percent_indicator/percent_indicator.dart'; import 'package:percent_indicator/percent_indicator.dart';
class ResultPage extends StatelessWidget { class ResultPage extends StatelessWidget {
@ -50,67 +54,71 @@ class ResultPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: Column( body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 50), margin: EdgeInsets.only(left: 20, right: 20, top: 20, bottom: 6),
child: Center( decoration: cardRadius(12),
child: CircularPercentIndicator( child: Padding(
radius: 220.0, padding: const EdgeInsets.all(12.0),
lineWidth: 20.0, child: Column(
percent: percentInductor(), crossAxisAlignment: CrossAxisAlignment.start,
center: Column( mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(
finalResult.toStringAsFixed(1), TranslationBase.of(context).bodyMassIndex + finalResult.toString(),
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 16,
fontWeight: FontWeight.bold, letterSpacing: -0.64,
fontWeight: FontWeight.w600,
), ),
), ),
SizedBox( mHeight(20),
height: 5.0, Container(
height: MediaQuery.of(context).size.width / 2.8,
child: Row(
children: [
showMass(context, TranslationBase.of(context).underWeight, "< 18.5", finalResult <= 18.5 ? Colors.red : Colors.black, 8),
mWidth(12),
showMass(context, TranslationBase.of(context).healthy, "18.5 - 24.9", (finalResult > 18.5 && finalResult < 25) ? Colors.red : Colors.black, 6),
mWidth(12),
showMass(context, TranslationBase.of(context).overWeight, "25 - 29.9", (finalResult >= 25 && finalResult < 30) ? Colors.red : Colors.black, 4),
mWidth(12),
showMass(context, TranslationBase.of(context).obese, "30 - 34.9", (finalResult >= 30 && finalResult < 35) ? Colors.red : Colors.black, 2),
mWidth(12),
showMass(context, TranslationBase.of(context).extremeObese, "> 35", (finalResult >= 35) ? Colors.red : Colors.black, 0),
],
),
), ),
mHeight(20),
Text( Text(
textResult, textResult,
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.56,
), ),
), ),
], mHeight(4),
), Text(
progressColor: colorInductor(), msg,
backgroundColor: Colors.white, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.56, color: CustomColors.textColor),
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Texts(msg),
), ),
], ],
), ),
), ),
), ),
mFlex(1),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), color: Colors.white,
child: BorderedButton( padding: EdgeInsets.all(16),
TranslationBase.of(context).seeListOfDoctor, child: SecondaryButton(
fontSize: SizeConfig.textMultiplier * 2.1, label: TranslationBase.of(context).seeListOfDoctor,
textColor: Colors.white, color: CustomColors.accentColor,
vPadding: 8, onTap: () {
hPadding: 8,
backgroundColor: Theme.of(context).primaryColor,
radius: 8,
fontWeight: FontWeight.bold,
handler: () {
Navigator.push( Navigator.push(
context, context,
FadePage(page: BariatricsPage(1, 1, finalResult)), FadePage(page: BariatricsPage(1, 1, finalResult)),
@ -122,4 +130,57 @@ class ResultPage extends StatelessWidget {
), ),
); );
} }
Widget showMass(BuildContext context, String title, String weight, Color color, int f) {
return Expanded(
flex: 1,
child: Container(
height: double.infinity,
width: double.infinity,
child: Column(
children: [
Flexible(
child: Row(
children: [
mFlex(f),
Flexible(
flex: 10,
child: SvgPicture.asset(
"assets/images/new/mass/health_BMI.svg",
height: double.infinity,
width: double.infinity,
fit: BoxFit.fill,
color: color,
),
),
mFlex(f),
],
),
),
mHeight(20),
AutoSizeText(
title,
maxLines: 1,
minFontSize: 6,
style: TextStyle(
color: color,
fontSize: 10,
letterSpacing: -0.6,
),
),
AutoSizeText(
weight,
maxLines: 1,
minFontSize: 6,
style: TextStyle(
color: color,
fontSize: 10,
letterSpacing: -0.6,
),
)
],
),
),
);
}
} }

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

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

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

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -17,6 +18,7 @@ class Carbs extends StatefulWidget {
class _CarbsState extends State<Carbs> { class _CarbsState extends State<Carbs> {
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
final GlobalKey clinicDropdownKey = GlobalKey();
int calories; int calories;
String dropdownValue; String dropdownValue;
bool _visible = false; bool _visible = false;
@ -67,9 +69,9 @@ class _CarbsState extends State<Carbs> {
void calculate() { void calculate() {
pCal = (protein / 100.0) * int.parse(textController.text).ceil(); pCal = (protein / 100.0) * int.parse(textController.text).ceil();
cCal = (carbs / 100.0) * int.parse(textController.text); cCal = (carbs / 100.0) * int.parse(textController.text);
;
fCal = (fat / 100) * int.parse(textController.text); fCal = (fat / 100) * int.parse(textController.text);
;
pCalGram = pCal / 4.0; pCalGram = pCal / 4.0;
cCalGram = cCal / 4.0; cCalGram = cCal / 4.0;
fCalGram = fCal / 9.0; fCalGram = fCal / 9.0;
@ -95,150 +97,84 @@ class _CarbsState extends State<Carbs> {
), ),
) )
], ],
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), children: [
Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.all(21),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
'Calculates carbohydrate protein and fat\n ratio in calories and grams according to a\n pre-set ratio', 'Calculates carbohydrate protein and fat ratio in calories and grams according to a pre-set ratio',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.56,
color: CustomColors.textColor,
),
), ),
SizedBox( SizedBox(
height: 15.0, height: 15.0,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Container( inputWidget("The Calories per day", "0", textController),
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( InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () { onTap: () {
setState(() { Navigator.push(
int currentValue = int.parse( context,
textController.text); FadePage(page: CalorieCalculator()),
currentValue--; );
textController.text =
(currentValue).toString();
});
}, },
), child: Padding(
], padding: const EdgeInsets.all(12.0),
), child: Text(
), 'NOT SURE? CLICK HERE',
], style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.56, color: CustomColors.accentColor, decoration: TextDecoration.underline),
),
),
), ),
), ),
)
], ],
), ),
),
SizedBox( SizedBox(
height: 20.0, height: 12.0,
), ),
Button( InkWell(
backgroundColor: Color(0xffC5272D),
label: 'NOT SURE? CLICK HERE',
onTap: () { onTap: () {
setState(() { // dropdownKey.currentState;
{ openDropdown(clinicDropdownKey);
Navigator.push(
context,
FadePage(page: CalorieCalculator()),
);
}
});
}, },
), child: Container(
], // width: double.infinity,
), // decoration: containerRadius(Colors.white, 12),
Column( // padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Row(
children: [
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts('Select Diet Type'), Text(
"Select Diet Type",
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
Container( Container(
width: 400, height: 18,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
value: dropdownValue, value: dropdownValue,
icon: Icon(Icons.arrow_downward), icon: Icon(Icons.arrow_downward),
iconSize: 24, iconSize: 0,
elevation: 16, elevation: 16,
isExpanded: true,
style: TextStyle(color: Colors.black87), style: TextStyle(color: Colors.black87),
underline: Container( underline: Container(
height: 2, height: 2,
@ -248,19 +184,9 @@ class _CarbsState extends State<Carbs> {
setState(() { setState(() {
dropdownValue = newValue; dropdownValue = newValue;
calculateDietRatios(); calculateDietRatios();
dropdownValue == null
? _visible = false
: _visible = true;
}); });
}, },
items: <String>[ items: <String>['Very Low Carb', 'Low Carb', 'Moderate Carb', 'USDA Gudilines', 'Zone Diet'].map<DropdownMenuItem<String>>((String value) {
'Very Low Carb',
'Low Carb',
'Moderate Carb',
'USDA Gudilines',
'Zone Diet',
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value), child: Text(value),
@ -268,84 +194,32 @@ class _CarbsState extends State<Carbs> {
}).toList(), }).toList(),
), ),
), ),
Visibility(
visible: _visible,
child: Container(
height: 170.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
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),
children: [
TextSpan(
text: 'Protein ',
), ),
TextSpan(
text: '$protein%',
style: TextStyle(color: Color(0xffC5272D)),
)
], ],
), ),
), ),
RichText( Icon(Icons.keyboard_arrow_down),
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [
TextSpan(
text: 'Carbohydrate ',
),
TextSpan(
text: '$carbs%',
style: TextStyle(color: Color(0xffC5272D)),
)
], ],
), ),
).withBorderedContainer,
), ),
RichText( SizedBox(
text: TextSpan( height: 25.0,
style: TextStyle(color: Colors.black),
children: [
TextSpan(
text: 'Fat ',
),
TextSpan(
text: '$fat%',
style: TextStyle(color: Color(0xffC5272D)),
)
],
), ),
SizedBox(
height: 55.0,
), ),
], ],
), ),
), ),
)
],
), ),
SizedBox(
height: 55.0,
), ),
Container( Container(
height: 50.0, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
width: 350.0, color: Colors.white,
child: SecondaryButton( child: SecondaryButton(
label: 'CALCULATE', label: TranslationBase.of(context).calculate,
color: CustomColors.accentColor,
onTap: () { onTap: () {
setState(() { setState(() {
{ {
@ -372,9 +246,125 @@ class _CarbsState extends State<Carbs> {
), ),
], ],
), ),
);
}
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,
),
),
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/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/painting.dart'; import 'package:flutter/painting.dart';
import 'package:provider/provider.dart';
class CarbsResult extends StatelessWidget { class CarbsResult extends StatelessWidget {
double pCal; double pCal;
@ -22,18 +27,11 @@ class CarbsResult extends StatelessWidget {
double cCalMeal; double cCalMeal;
double fCalMeal; double fCalMeal;
CarbsResult( CarbsResult({this.pCal, this.cCal, this.fCal, this.pCalGram, this.cCalGram, this.fCalGram, this.fCalMeal, this.cCalMeal, this.pCalMeal});
{this.pCal,
this.cCal,
this.fCal,
this.pCalGram,
this.cCalGram,
this.fCalGram,
this.fCalMeal,
this.cCalMeal,
this.pCalMeal});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
@ -43,137 +41,98 @@ class CarbsResult extends StatelessWidget {
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Padding( Container(
padding: EdgeInsets.symmetric(vertical: 30.0, horizontal: 10.0), decoration: containerRadius(Colors.white, 12),
child: Table( padding: EdgeInsets.all(12),
border: TableBorder( margin: EdgeInsets.all(20),
verticalInside: BorderSide(width: 1, color: Colors.black54), child: Column(
bottom: BorderSide(width: 1, color: Colors.black54), crossAxisAlignment: CrossAxisAlignment.start,
left: BorderSide(width: 1, color: Colors.black54),
right: BorderSide(width: 1, color: Colors.black54),
top: BorderSide(width: 1, color: Colors.black54),
),
children: [
TableRow(
decoration: BoxDecoration(
color: Colors.white,
),
children: [ children: [
TableCell( Text(
child: Center( TranslationBase.of(context).carbsProtin,
child: Texts('Description'), style: TextStyle(
), fontSize: 19,
), fontWeight: FontWeight.bold,
TableCell( letterSpacing: -1.34,
child: Center( ),
child: Texts('Protein'), ),
), mHeight(12),
), Table(
TableCell( columnWidths: {
child: Center( 0: FlexColumnWidth(2.4),
child: Texts( 1: FlexColumnWidth(1.8),
'Carbohydrate', 2: FlexColumnWidth(2),
), 3: FlexColumnWidth(1),
), },
), children: fullData(context, projectViewModel),
TableCell(
child: Center(
child: Texts('Fat'),
),
),
]),
TableRow(children: [
Padding(
padding: EdgeInsets.all(8.0),
child: TableCell(
child: Center(
child: Texts('Calories\n Per Day'),
),
),
),
TableCell(
child: Center(
child: Texts(pCal.ceil().toString() + ' Cals'),
),
),
TableCell(
child: Center(
child: Texts(cCal.ceil().toString() + ' Cals'),
),
),
TableCell(
child: Center(
child: Texts(fCal.ceil().toString() + ' Cals'),
),
),
]),
TableRow(children: [
Padding(
padding: EdgeInsets.all(8.0),
child: TableCell(
child: Center(
child: Texts('Grams Per\n Day'),
),
),
),
TableCell(
child: Center(
child: Texts(pCalGram.ceil().toString() + ' gr'),
),
),
TableCell(
child: Center(
child: Texts(cCalGram.ceil().toString() + ' gr'),
),
),
TableCell(
child: Center(
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'),
),
), ),
]),
], ],
), ),
), ),
Container( Container(
width: 350, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
child: Button( color: Colors.white,
label: TranslationBase.of(context).viewDocList, child: SecondaryButton(
label: TranslationBase.of(context).seeListOfDoctor,
color: CustomColors.accentColor,
onTap: () { onTap: () {
getDoctorsList(context); getDoctorsList(context);
}, },
), ),
), ),
], ],
), ),
); );
} }
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
children: [
Utils.tableColumnTitle("Description"),
Utils.tableColumnTitle("Protein"),
Utils.tableColumnTitle("Carbohydrate"),
Utils.tableColumnTitle("Fat"),
],
),
);
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue("Calories Per Day", isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(pCal.ceil().toString() + ' Cals', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCal.ceil().toString() + ' Cals', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCal.ceil().toString() + ' Cals', isCapitable: false, mProjectViewModel: projectViewModel),
],
),
);
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue("Grams Per Day", isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(pCalGram.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCalGram.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(fCalGram.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel),
],
),
);
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue('Grams Per Meal', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(pCalMeal.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(cCalMeal.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(fCalMeal.ceil().toString() + ' gr', isCapitable: false, mProjectViewModel: projectViewModel),
],
),
);
return tableRow;
}
getDoctorsList(BuildContext context) { getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
BariatricsService service = new BariatricsService(); BariatricsService service = new BariatricsService();
@ -226,5 +185,4 @@ class CarbsResult extends StatelessWidget {
print(err); print(err);
}); });
} }
} }

@ -1,10 +1,11 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'ideal_body_result_page.dart'; import 'ideal_body_result_page.dart';
@ -24,8 +25,9 @@ class _IdealBodyState extends State<IdealBody> {
Color lbCard = inactiveCardColor; Color lbCard = inactiveCardColor;
Color cmCard = activeCardColor; Color cmCard = activeCardColor;
Color ftCard = inactiveCardColor; Color ftCard = inactiveCardColor;
int age = 0;
int height = 0; // int age = 0;
// int height = 0;
double heightInches; double heightInches;
double minRange; double minRange;
double maxRange; double maxRange;
@ -38,48 +40,22 @@ class _IdealBodyState extends State<IdealBody> {
double maxIdealWeight; double maxIdealWeight;
double heightFeet; double heightFeet;
void updateColorHeight(int type) { final GlobalKey clinicDropdownKey = GlobalKey();
//MG/DLT card bool _isHeightCM = true;
if (type == 1) { bool _isWeightKG = true;
if (cmCard == inactiveCardColor) { double _heightValue = 0;
cmCard = activeCardColor; double _weightValue = 0;
ftCard = inactiveCardColor;
} else { TextEditingController _heightController = new TextEditingController();
cmCard = inactiveCardColor; TextEditingController _weightController = TextEditingController();
}
} List<PopupMenuItem> _heightPopupList = List();
if (type == 2) { List<PopupMenuItem> _weightPopupList = List();
if (ftCard == inactiveCardColor) {
ftCard = activeCardColor;
cmCard = inactiveCardColor;
} else {
ftCard = inactiveCardColor;
}
}
}
void updateColorWeight(int type) {
//MG/DLT card
if (type == 1) {
if (kgCard == inactiveCardColor) {
kgCard = activeCardColor;
lbCard = inactiveCardColor;
} else {
kgCard = inactiveCardColor;
}
}
if (type == 2) {
if (lbCard == inactiveCardColor) {
lbCard = activeCardColor;
kgCard = inactiveCardColor;
} else {
lbCard = inactiveCardColor;
}
}
}
void calculateIdealWeight() { void calculateIdealWeight() {
heightInches = height * .39370078740157477; heightInches = int.parse(_heightController.text) * .39370078740157477;
heightFeet = heightInches / 12; heightFeet = heightInches / 12;
idealWeight = (50 + 2.3 * (heightInches - 60)); idealWeight = (50 + 2.3 * (heightInches - 60));
if (dropdownValue == 'Small(fingers overlap)') { if (dropdownValue == 'Small(fingers overlap)') {
@ -99,6 +75,9 @@ class _IdealBodyState extends State<IdealBody> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)];
_heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)];
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
@ -115,396 +94,114 @@ class _IdealBodyState extends State<IdealBody> {
), ),
) )
], ],
body: Padding( body: Column(
padding: EdgeInsets.symmetric(vertical: 15.0, horizontal: 25.0), children: [
Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
height: 800.0, padding: EdgeInsets.all(21),
child: Column( child: Column(
children: [ children: [
Padding( Text(
padding: EdgeInsets.all(10.0),
child: Texts(
'Calculates the ideal body weight based on height, Weight, and Body Size', 'Calculates the ideal body weight based on height, Weight, and Body Size',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.56,
color: CustomColors.textColor,
), ),
), ),
Divider(
thickness: 2.0,
),
SizedBox( SizedBox(
height: 5.0, height: 5.0,
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( SizedBox(
'Height', height: 12.0,
), ),
Row( _commonInputAndUnitRow(
children: [ TranslationBase.of(context).height,
Expanded( _heightController,
child: Container( 1,
width: 340.0, 270,
height: 60.0, _heightValue,
decoration: BoxDecoration( (text) {
color: Colors.white, _heightController.text = text;
),
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++;
});
}, },
), (value) {
), _heightValue = value;
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (height > 0) height--;
});
}, },
), _isHeightCM ? TranslationBase.of(context).cm : TranslationBase.of(context).ft,
], (value) {
), if (_isHeightCM != value) {
),
],
),
),
),
),
Expanded(
child: Slider(
value: height.toDouble(),
min: 0,
max: 250,
onChanged: (double newValue) {
setState(() { setState(() {
height = newValue.round(); _isHeightCM = value;
}); });
}
}, },
activeColor: Color(0xffC5272D), _heightPopupList,
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
),
), ),
],
),
Texts('Select Unit'),
SizedBox( SizedBox(
height: 5.0, height: 12.0,
), ),
Row( _commonInputAndUnitRow(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, TranslationBase.of(context).weight,
children: [ _weightController,
GestureDetector( 1,
onTap: () { 270,
setState(() { _weightValue,
updateColorHeight(1); (text) {
isHeightCm = true; _weightController.text = text;
});
}, },
child: Container( (value) {
height: 55.0, _weightValue = value;
width: 150.0, },
decoration: BoxDecoration( _isWeightKG ? TranslationBase.of(context).kg : TranslationBase.of(context).pound,
boxShadow: [ (value) {
BoxShadow( if (_isWeightKG != value) {
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')),
),
),
),
GestureDetector(
onTap: () {
setState(() { setState(() {
updateColorHeight(2); _isWeightKG = value;
isHeightCm = false;
}); });
}
}, },
child: Container( _weightPopupList,
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')),
),
),
),
],
), ),
SizedBox( SizedBox(
height: 45.0, height: 12.0,
),
Divider(
thickness: 2.0,
),
Texts(
'Weight',
), ),
SizedBox( InkWell(
height: 5.0, onTap: () {
), // dropdownKey.currentState;
Row( openDropdown(clinicDropdownKey);
children: [ },
Expanded(
child: Container( child: Container(
width: 340.0, // width: double.infinity,
height: 60.0, // decoration: containerRadius(Colors.white, 12),
decoration: BoxDecoration( // padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
color: Colors.white,
),
child: Row( child: Row(
children: [ children: [
Padding( Flexible(
padding: EdgeInsets.symmetric(
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( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
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--;
});
},
),
],
),
),
],
),
),
),
),
Expanded(
child: Slider(
value: weight.toDouble(),
min: 0,
max: 250,
onChanged: (double newValue) {
setState(() {
weight = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
),
),
],
),
Texts('Select Unit'),
SizedBox(
height: 5.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
GestureDetector( Text(
onTap: () { "Body Frame Size",
setState(() { style: TextStyle(
updateColorWeight(1); fontSize: 11,
}); letterSpacing: -0.44,
}, fontWeight: FontWeight.w600,
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
],
color: kgCard,
borderRadius: BorderRadius.circular(3.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('KG')),
),
), ),
), ),
GestureDetector(
onTap: () {
setState(() {
updateColorWeight(2);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
color: lbCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
],
),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('LB')),
),
),
),
],
),
SizedBox(
height: 45.0,
),
Divider(
thickness: 2.0,
),
SizedBox(
height: 5.0,
),
Texts('Body Frame Size'),
Container( Container(
width: 300, height: 18,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
value: dropdownValue, value: dropdownValue,
icon: Icon(Icons.arrow_downward), icon: Icon(Icons.arrow_downward),
iconSize: 24, iconSize: 0,
elevation: 16, elevation: 16,
isExpanded: true,
style: TextStyle(color: Colors.black87), style: TextStyle(color: Colors.black87),
underline: Container( underline: Container(
height: 2, height: 2,
@ -527,14 +224,28 @@ class _IdealBodyState extends State<IdealBody> {
}).toList(), }).toList(),
), ),
), ),
SizedBox( ),
height: 30.0, ],
),
),
Icon(Icons.keyboard_arrow_down),
],
),
).withBorderedContainer,
),
],
),
],
),
),
),
), ),
Container( Container(
height: 50.0, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
width: 350.0, color: Colors.white,
child: SecondaryButton( child: SecondaryButton(
label: 'CALCULATE', label: TranslationBase.of(context).calculate,
color: CustomColors.accentColor,
onTap: () { onTap: () {
setState(() { setState(() {
// calculateBmr(); // calculateBmr();
@ -542,6 +253,10 @@ class _IdealBodyState extends State<IdealBody> {
calculateIdealWeight(); calculateIdealWeight();
print(idealWeight); print(idealWeight);
print(minRange);
print(maxRange);
print(overWeightBy);
print(textResult);
//print(overWeightBy); //print(overWeightBy);
{ {
Navigator.push( Navigator.push(
@ -562,11 +277,235 @@ class _IdealBodyState extends State<IdealBody> {
), ),
], ],
), ),
);
}
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,
),
),
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),
],
), ),
), ),
); );
} }
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/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -28,12 +31,23 @@ class IdealBodyResult extends StatelessWidget {
appBarTitle: TranslationBase.of(context).idealBody, appBarTitle: TranslationBase.of(context).idealBody,
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(
Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Ideal weight range is', 'Ideal weight range is',
fontSize: 23.0, style: TextStyle(
fontSize: 19,
letterSpacing: -1.34,
fontWeight: FontWeight.bold,
),
), ),
mHeight(12),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
@ -74,11 +88,12 @@ class IdealBodyResult extends StatelessWidget {
), ),
], ],
), ),
mHeight(12),
overWeightBy >= 0 && overWeightBy <= 10 overWeightBy >= 0 && overWeightBy <= 10
? Column( ? Column(
children: [ children: [
Texts( Texts(
'Congratulations! The current weight is\n perfect and considered healthy', 'Congratulations! The current weight is perfect and considered healthy',
fontSize: 20.0, fontSize: 20.0,
), ),
], ],
@ -93,24 +108,27 @@ class IdealBodyResult extends StatelessWidget {
) )
: overWeightBy >= 18 : overWeightBy >= 18
? Container( ? Container(
height: 250.0,
width: 350,
child: Column( child: Column(
children: [ children: [
Texts( Texts(
'Means that you suffer from excessive\n obesity by', 'Means that you suffer from excessive obesity by',
), ),
SizedBox( SizedBox(
height: 55.0, height: 12.0,
), ),
Texts( Text(
overWeightBy.toStringAsFixed(1), overWeightBy.toStringAsFixed(1),
fontSize: 40.0, style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.bold,
letterSpacing: -1.34,
),
), ),
SizedBox( SizedBox(
height: 25.0, height: 12.0,
), ),
Texts('May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'), Texts('May wish to consult with the doctor for medical help. Click to view our list of\n Doctors'),
], ],
), ),
) )
@ -126,41 +144,57 @@ class IdealBodyResult extends StatelessWidget {
), ),
), ),
SizedBox( SizedBox(
height: 55.0, height: 12.0,
), ),
Texts( Text(
overWeightBy.toStringAsFixed(1), overWeightBy.toStringAsFixed(1),
fontSize: 20.0, style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.bold,
letterSpacing: -1.34,
),
), ),
], ],
) )
: Container( : Container(
height: 250.0,
width: 350.0,
child: Column( child: Column(
children: [ children: [
Texts( Text(
'under wheight', 'under wheight',
fontSize: 20.0, style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.bold,
letterSpacing: -1.34,
),
), ),
SizedBox( SizedBox(
height: 55.0, height: 12.0,
), ),
Texts( Text(
overWeightBy.toStringAsFixed(1), overWeightBy.toStringAsFixed(1),
fontSize: 20.0, style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.bold,
letterSpacing: -1.34,
),
), ),
SizedBox( SizedBox(
height: 25.0, height: 12.0,
), ),
Texts('May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'), Texts('May wish to consult with the doctor for medical help. Click to view our list of Doctors'),
], ],
), ),
), ),
],
).withBorderedContainer,
),
Container( Container(
width: 350, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
child: Button( color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).viewDocList, label: TranslationBase.of(context).viewDocList,
color: CustomColors.accentColor,
onTap: () { onTap: () {
getDoctorsList(context); getDoctorsList(context);
}, },
@ -224,3 +258,19 @@ class IdealBodyResult extends StatelessWidget {
}); });
} }
} }
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
}

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

@ -2618,6 +2618,10 @@ class TranslationBase {
String get RRTSubTitle => localizedValues["RRTSubTitle"][locale.languageCode]; String get RRTSubTitle => localizedValues["RRTSubTitle"][locale.languageCode];
String get transportation => localizedValues["transportation"][locale.languageCode]; String get transportation => localizedValues["transportation"][locale.languageCode];
String get neck => localizedValues["neck"][locale.languageCode];
String get waist => localizedValues["waist"][locale.languageCode];
String get hip => localizedValues["hip"][locale.languageCode];
String get carbsProtin => localizedValues["carbsProtin"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -168,6 +168,7 @@ dependencies:
in_app_review: ^1.0.4 in_app_review: ^1.0.4
badges: ^1.1.4 badges: ^1.1.4
syncfusion_flutter_sliders: ^18.4.49-beta
# Dep by Zohaib # Dep by Zohaib
shimmer: ^1.1.2 shimmer: ^1.1.2

Loading…
Cancel
Save