Merge branch 'mirza_home_page' into 'development_new_design_2.0'

Mirza home page

See merge request Cloud_Solution/diplomatic-quarter!492
merge-requests/489/merge
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_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

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

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

@ -1,12 +1,16 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/size_config.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/utils_new.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:percent_indicator/percent_indicator.dart';
class ResultPage extends StatelessWidget {
@ -50,67 +54,71 @@ class ResultPage extends StatelessWidget {
return AppScaffold(
isShowDecPage: false,
isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
Container(
margin: EdgeInsets.only(left: 20, right: 20, top: 20, bottom: 6),
decoration: cardRadius(12),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Container(
margin: EdgeInsets.only(top: 50),
child: Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 20.0,
percent: percentInductor(),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
finalResult.toStringAsFixed(1),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 5.0,
),
Text(
textResult,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
),
),
],
),
progressColor: colorInductor(),
backgroundColor: Colors.white,
),
Text(
TranslationBase.of(context).bodyMassIndex + finalResult.toString(),
style: TextStyle(
fontSize: 16,
letterSpacing: -0.64,
fontWeight: FontWeight.w600,
),
),
mHeight(20),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Texts(msg),
height: MediaQuery.of(context).size.width / 2.8,
child: Row(
children: [
showMass(context, TranslationBase.of(context).underWeight, "< 18.5", 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(
textResult,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
letterSpacing: -0.56,
),
),
mHeight(4),
Text(
msg,
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.56, color: CustomColors.textColor),
),
],
),
),
),
mFlex(1),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: BorderedButton(
TranslationBase.of(context).seeListOfDoctor,
fontSize: SizeConfig.textMultiplier * 2.1,
textColor: Colors.white,
vPadding: 8,
hPadding: 8,
backgroundColor: Theme.of(context).primaryColor,
radius: 8,
fontWeight: FontWeight.bold,
handler: () {
color: Colors.white,
padding: EdgeInsets.all(16),
child: SecondaryButton(
label: TranslationBase.of(context).seeListOfDoctor,
color: CustomColors.accentColor,
onTap: () {
Navigator.push(
context,
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/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -27,50 +30,81 @@ class BmrResultPage extends StatelessWidget {
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 20.0,
percent: ((this.bmrResult > 3500) ? 100 : this.bmrResult / 3500),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
bmrResult.toStringAsFixed(1),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Calories",
style: TextStyle(
fontSize: 19,
letterSpacing: -1.34,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5.0,
),
mHeight(20),
Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 3.0,
percent: ((this.bmrResult > 3500) ? 100 : this.bmrResult / 3500),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
bmrResult.toStringAsFixed(1),
style: TextStyle(
fontSize: 17,
letterSpacing: -1.02,
fontWeight: FontWeight.w600,
),
),
SizedBox(
height: 5.0,
),
Text(
'Calories',
style: TextStyle(
fontSize: 18,
letterSpacing: -1.08,
fontWeight: FontWeight.w600,
),
),
],
),
progressColor: CustomColors.accentColor,
backgroundColor: Colors.white,
),
Text(
'Calories/Day',
style: TextStyle(
fontSize: 16.0,
),
mHeight(20),
Text(
'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.',
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
fontWeight: FontWeight.w600,
),
color: CustomColors.textColor
),
],
),
progressColor: Color(0xff3C3939),
),
),
Container(
height: 120,
width: 280.0,
child: Texts(
'This means the body will burn ( ${bmrResult.toStringAsFixed(1)} ) calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is ( ${calories.toStringAsFixed(1)} ) calories, to maintain the current weight.'),
),
],
).withBorderedContainer,
),
mFlex(1),
Container(
width: 350,
child: Button(
label: TranslationBase.of(context).viewDocList,
onTap: () {
getDoctorsList(context);
}),
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).viewDocList,
color: CustomColors.accentColor,
onTap: () {
getDoctorsList(context);
},
),
),
],
),
);
@ -129,3 +163,18 @@ class BmrResultPage extends StatelessWidget {
});
}
}
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
}

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

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

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

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

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

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

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

@ -2618,6 +2618,10 @@ class TranslationBase {
String get RRTSubTitle => localizedValues["RRTSubTitle"][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> {

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

Loading…
Cancel
Save