Merge pull request #599 from wger-project/ux-friendly-log-meals-to-diary

improve UX of logging meals to diary
This commit is contained in:
Roland Geider
2024-06-06 19:53:25 +02:00
committed by GitHub
28 changed files with 765 additions and 110 deletions

View File

@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!-- License: CC0. Made by SVG Repo: https://www.svgrepo.com/svg/150226/meal -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 512.002 512.002"
style="enable-background:new 0 0 512.002 512.002;"
xml:space="preserve"
sodipodi:docname="ingredient-add.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs8">
</defs><sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="1.7363213"
inkscape:cx="256.00101"
inkscape:cy="257.15287"
inkscape:window-width="1920"
inkscape:window-height="1155"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<g
id="g2"
transform="matrix(0.76051742,-0.76051742,0.76051742,0.76051742,-160.62472,302.94989)">
<path
class="st0"
d="m 345.114,155.163 c -13.113,-21.232 -35.755,-26.934 -50.43,-26.934 h -77.44 c -14.599,0 -37.318,5.702 -50.354,26.934 -12.022,19.752 -19.44,38.094 -23.656,54.958 -2.18,8.821 -3.507,17.252 -4.132,25.371 -3.361,40.596 10.46,71.586 15.378,93.054 1.25,5.542 3.202,12.412 5.695,20.142 2.424,7.73 5.313,16.314 8.516,25.371 12.8,36.38 29.976,79.24 37.858,97.582 15.612,36.456 35.052,40.359 49.415,40.359 14.439,0 33.879,-3.903 49.492,-40.359 11.633,-27.323 44.187,-109.292 51.993,-143.095 1.403,-6.167 3.59,-13.113 5.855,-20.843 2.264,-7.73 4.604,-16.162 6.48,-25.371 6.633,-32.553 7.181,-74.864 -24.67,-127.169 z m -57.535,127.169 c -7.021,0 -12.724,5.702 -12.724,12.724 0,6.944 5.702,12.647 12.724,12.647 h 43.18 c -1.395,4.742 -2.721,9.347 -3.735,13.814 -7.106,30.754 -38.43,110.016 -50.27,137.835 -9.179,21.422 -15.888,21.422 -20.79,21.422 -4.872,0 -11.535,0 -20.729,-21.46 -7.136,-16.62 -21.484,-52.352 -33.384,-85.255 h 18.358 c 7.029,0 12.724,-5.702 12.724,-12.647 0,-7.021 -5.695,-12.724 -12.724,-12.724 h -27.201 c -1.09,-3.294 -2.165,-6.541 -3.118,-9.582 -2.218,-6.9 -3.934,-12.922 -4.97,-17.527 -1.364,-5.954 -3.156,-12.03 -5.055,-18.456 -5.504,-18.632 -11.74,-39.75 -9.628,-65.236 0.061,-0.792 0.214,-1.6 0.29,-2.394 h 67.248 c 7.029,0 12.647,-5.702 12.647,-12.724 0,-6.945 -5.618,-12.648 -12.647,-12.648 H 175.78 c 3.957,-12.686 9.827,-25.653 17.725,-38.621 7.037,-11.466 21.011,-12.045 23.74,-12.045 h 77.44 c 3.842,0 16.917,0.877 23.763,11.946 27.94,45.887 25.76,80.055 20.736,104.702 -0.442,2.158 -0.968,4.155 -1.456,6.229 z"
id="path1"
style="fill:#000000" />
<polygon
class="st0"
points="259.501,20.515 260.545,71.822 248.836,71.822 248.836,0 210.062,3.423 213.965,36.478 224.371,75.245 216.565,78.668 197.049,31.927 169.718,42.189 194.7,110.588 315.451,110.588 336.263,50.163 305.036,47.876 298.534,87.786 288.127,85.506 292.031,25.082 "
id="polygon1"
style="fill:#000000" />
</g><circle
id="path2"
style="fill:#000000;stroke:#000000;stroke-width:0.2"
cx="521.88666"
cy="45.191727"
r="0.0043425169" /><g
id="Page-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
transform="matrix(29.995699,0,0,29.995699,241.90437,1.6845255)"><g
id="Dribbble-Light-Preview"
transform="translate(-345,-206)"
fill="#000000"><g
id="icons"
transform="translate(56,160)"><polygon
id="plus_mini-[#1523]"
points="298,49 298,51 294.625,51 294.625,54 292.375,54 292.375,51 289,51 289,49 292.375,49 292.375,46 294.625,46 294.625,49 " /></g></g></g></svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!-- License: CC0. Made by SVG Repo: https://www.svgrepo.com/svg/150226/meal -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 512.002 512.002"
style="enable-background:new 0 0 512.002 512.002;"
xml:space="preserve"
sodipodi:docname="ingredient-check.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs8">
</defs><sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="1.7363213"
inkscape:cx="274.43077"
inkscape:cy="257.15287"
inkscape:window-width="1920"
inkscape:window-height="1155"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<g
id="g2"
transform="matrix(0.76051742,-0.76051742,0.76051742,0.76051742,-160.62472,302.94989)">
<path
class="st0"
d="m 345.114,155.163 c -13.113,-21.232 -35.755,-26.934 -50.43,-26.934 h -77.44 c -14.599,0 -37.318,5.702 -50.354,26.934 -12.022,19.752 -19.44,38.094 -23.656,54.958 -2.18,8.821 -3.507,17.252 -4.132,25.371 -3.361,40.596 10.46,71.586 15.378,93.054 1.25,5.542 3.202,12.412 5.695,20.142 2.424,7.73 5.313,16.314 8.516,25.371 12.8,36.38 29.976,79.24 37.858,97.582 15.612,36.456 35.052,40.359 49.415,40.359 14.439,0 33.879,-3.903 49.492,-40.359 11.633,-27.323 44.187,-109.292 51.993,-143.095 1.403,-6.167 3.59,-13.113 5.855,-20.843 2.264,-7.73 4.604,-16.162 6.48,-25.371 6.633,-32.553 7.181,-74.864 -24.67,-127.169 z m -57.535,127.169 c -7.021,0 -12.724,5.702 -12.724,12.724 0,6.944 5.702,12.647 12.724,12.647 h 43.18 c -1.395,4.742 -2.721,9.347 -3.735,13.814 -7.106,30.754 -38.43,110.016 -50.27,137.835 -9.179,21.422 -15.888,21.422 -20.79,21.422 -4.872,0 -11.535,0 -20.729,-21.46 -7.136,-16.62 -21.484,-52.352 -33.384,-85.255 h 18.358 c 7.029,0 12.724,-5.702 12.724,-12.647 0,-7.021 -5.695,-12.724 -12.724,-12.724 h -27.201 c -1.09,-3.294 -2.165,-6.541 -3.118,-9.582 -2.218,-6.9 -3.934,-12.922 -4.97,-17.527 -1.364,-5.954 -3.156,-12.03 -5.055,-18.456 -5.504,-18.632 -11.74,-39.75 -9.628,-65.236 0.061,-0.792 0.214,-1.6 0.29,-2.394 h 67.248 c 7.029,0 12.647,-5.702 12.647,-12.724 0,-6.945 -5.618,-12.648 -12.647,-12.648 H 175.78 c 3.957,-12.686 9.827,-25.653 17.725,-38.621 7.037,-11.466 21.011,-12.045 23.74,-12.045 h 77.44 c 3.842,0 16.917,0.877 23.763,11.946 27.94,45.887 25.76,80.055 20.736,104.702 -0.442,2.158 -0.968,4.155 -1.456,6.229 z"
id="path1"
style="fill:#000000" />
<polygon
class="st0"
points="259.501,20.515 260.545,71.822 248.836,71.822 248.836,0 210.062,3.423 213.965,36.478 224.371,75.245 216.565,78.668 197.049,31.927 169.718,42.189 194.7,110.588 315.451,110.588 336.263,50.163 305.036,47.876 298.534,87.786 288.127,85.506 292.031,25.082 "
id="polygon1"
style="fill:#000000" />
</g><circle
id="path2"
style="fill:#000000;stroke:#000000;stroke-width:0.2"
cx="521.88666"
cy="45.191727"
r="0.0043425169" /><path
clip-rule="evenodd"
d="M 515.875,51.622857 349.49393,218.00373 253.80627,122.31651 303.7942,72.328499 349.49393,118.02824 465.88752,1.6348403 Z"
fill="#030708"
fill-rule="evenodd"
id="path1-3"
style="stroke-width:17.6734" /></svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!-- License: CC0. Made by SVG Repo: https://www.svgrepo.com/svg/150226/meal -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 512.002 512.002"
style="enable-background:new 0 0 512.002 512.002;"
xml:space="preserve"
sodipodi:docname="ingredient-diary.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs8">
</defs><sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="1.7363213"
inkscape:cx="256.57694"
inkscape:cy="257.15287"
inkscape:window-width="1920"
inkscape:window-height="1155"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<g
id="g2"
transform="matrix(0.76051742,-0.76051742,0.76051742,0.76051742,-160.62472,302.94989)">
<path
class="st0"
d="m 345.114,155.163 c -13.113,-21.232 -35.755,-26.934 -50.43,-26.934 h -77.44 c -14.599,0 -37.318,5.702 -50.354,26.934 -12.022,19.752 -19.44,38.094 -23.656,54.958 -2.18,8.821 -3.507,17.252 -4.132,25.371 -3.361,40.596 10.46,71.586 15.378,93.054 1.25,5.542 3.202,12.412 5.695,20.142 2.424,7.73 5.313,16.314 8.516,25.371 12.8,36.38 29.976,79.24 37.858,97.582 15.612,36.456 35.052,40.359 49.415,40.359 14.439,0 33.879,-3.903 49.492,-40.359 11.633,-27.323 44.187,-109.292 51.993,-143.095 1.403,-6.167 3.59,-13.113 5.855,-20.843 2.264,-7.73 4.604,-16.162 6.48,-25.371 6.633,-32.553 7.181,-74.864 -24.67,-127.169 z m -57.535,127.169 c -7.021,0 -12.724,5.702 -12.724,12.724 0,6.944 5.702,12.647 12.724,12.647 h 43.18 c -1.395,4.742 -2.721,9.347 -3.735,13.814 -7.106,30.754 -38.43,110.016 -50.27,137.835 -9.179,21.422 -15.888,21.422 -20.79,21.422 -4.872,0 -11.535,0 -20.729,-21.46 -7.136,-16.62 -21.484,-52.352 -33.384,-85.255 h 18.358 c 7.029,0 12.724,-5.702 12.724,-12.647 0,-7.021 -5.695,-12.724 -12.724,-12.724 h -27.201 c -1.09,-3.294 -2.165,-6.541 -3.118,-9.582 -2.218,-6.9 -3.934,-12.922 -4.97,-17.527 -1.364,-5.954 -3.156,-12.03 -5.055,-18.456 -5.504,-18.632 -11.74,-39.75 -9.628,-65.236 0.061,-0.792 0.214,-1.6 0.29,-2.394 h 67.248 c 7.029,0 12.647,-5.702 12.647,-12.724 0,-6.945 -5.618,-12.648 -12.647,-12.648 H 175.78 c 3.957,-12.686 9.827,-25.653 17.725,-38.621 7.037,-11.466 21.011,-12.045 23.74,-12.045 h 77.44 c 3.842,0 16.917,0.877 23.763,11.946 27.94,45.887 25.76,80.055 20.736,104.702 -0.442,2.158 -0.968,4.155 -1.456,6.229 z"
id="path1"
style="fill:#000000" />
<polygon
class="st0"
points="259.501,20.515 260.545,71.822 248.836,71.822 248.836,0 210.062,3.423 213.965,36.478 224.371,75.245 216.565,78.668 197.049,31.927 169.718,42.189 194.7,110.588 315.451,110.588 336.263,50.163 305.036,47.876 298.534,87.786 288.127,85.506 292.031,25.082 "
id="polygon1"
style="fill:#000000" />
</g><circle
id="path2"
style="fill:#000000;stroke:#000000;stroke-width:0.2"
cx="521.88666"
cy="45.191727"
r="0.0043425169" /><g
id="g8-6"
transform="matrix(0.4527684,0,0,0.4527684,296.76275,1.8149751)">
<g
id="g7-7">
<g
id="g6-5">
<path
d="m 380.68,372.453 c -13.938,0 -25.284,11.342 -25.284,25.301 v 54.441 l 80.034,-79.742 z"
id="path1-3" />
<path
d="m 433.745,492.197 c 23.156,0 41.912,-18.76 41.912,-41.898 V 379.285 L 362.338,492.197 Z"
id="path2-5" />
<path
d="M 433.745,0 H 100.255 C 77.537,0 59.15,18.11 58.486,40.653 h 39.691 c 9.479,-7.013 21.051,-10.876 33.139,-10.876 30.785,0 55.84,25.055 55.84,55.84 0,30.784 -25.055,55.826 -55.84,55.826 -11.992,0 -23.527,-3.863 -33.059,-10.84 H 58.355 v 70.543 h 39.822 c 9.479,-7.008 21.051,-10.871 33.139,-10.871 30.785,0 55.84,25.055 55.84,55.84 0,30.783 -25.055,55.84 -55.84,55.84 -11.992,0 -23.547,-3.859 -33.072,-10.854 H 58.355 v 70.543 h 39.822 c 9.492,-6.995 21.064,-10.857 33.139,-10.857 30.785,0 55.84,25.042 55.84,55.825 0,30.784 -25.055,55.84 -55.84,55.84 -11.992,0 -23.527,-3.861 -33.059,-10.84 h -39.77 c 0.715,22.524 19.082,40.586 41.77,40.586 h 221.904 v -94.445 c 0,-32.281 26.258,-58.537 58.52,-58.537 H 475.66 V 41.901 C 475.659,18.761 456.903,0 433.745,0 Z"
id="path3-6" />
<path
d="m 36.577,105.68 h 71.213 c 5.68,6.588 14.115,10.84 23.527,10.84 17.07,0 30.916,-13.827 30.916,-30.902 0,-17.071 -13.846,-30.912 -30.916,-30.912 -9.412,0 -17.848,4.14 -23.527,10.872 H 36.577 c -11.066,0 -20.039,8.974 -20.039,20.04 -0.001,11.101 8.972,20.062 20.039,20.062 z"
id="path4-2" />
<path
d="m 36.577,266.172 h 71.213 c 5.68,6.606 14.115,10.858 23.527,10.858 17.07,0 30.916,-13.846 30.916,-30.915 0,-17.072 -13.846,-30.916 -30.916,-30.916 -9.412,0 -17.848,4.139 -23.527,10.875 H 36.577 c -11.066,0 -20.039,8.975 -20.039,20.059 0,11.084 8.972,20.039 20.039,20.039 z"
id="path5-9" />
<path
d="m 131.316,437.523 c 17.07,0 30.916,-13.839 30.916,-30.91 0,-17.074 -13.846,-30.902 -30.916,-30.902 -9.412,0 -17.848,4.141 -23.527,10.857 H 36.577 c -11.066,0 -20.039,8.975 -20.039,20.059 0,11.084 8.973,20.06 20.039,20.06 h 71.213 c 5.679,6.584 14.115,10.836 23.526,10.836 z"
id="path6-1" />
</g>
</g>
</g></svg>

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!-- License: CC0. Made by SVG Repo: https://www.svgrepo.com/svg/150226/meal -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 512.002 512.002"
style="enable-background:new 0 0 512.002 512.002;"
xml:space="preserve"
sodipodi:docname="ingredient-write.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs8">
</defs><sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="1.7363213"
inkscape:cx="256.57694"
inkscape:cy="256.57694"
inkscape:window-width="1920"
inkscape:window-height="1155"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<g
id="g2"
transform="matrix(0.76051742,-0.76051742,0.76051742,0.76051742,-160.62472,302.94989)">
<path
class="st0"
d="m 345.114,155.163 c -13.113,-21.232 -35.755,-26.934 -50.43,-26.934 h -77.44 c -14.599,0 -37.318,5.702 -50.354,26.934 -12.022,19.752 -19.44,38.094 -23.656,54.958 -2.18,8.821 -3.507,17.252 -4.132,25.371 -3.361,40.596 10.46,71.586 15.378,93.054 1.25,5.542 3.202,12.412 5.695,20.142 2.424,7.73 5.313,16.314 8.516,25.371 12.8,36.38 29.976,79.24 37.858,97.582 15.612,36.456 35.052,40.359 49.415,40.359 14.439,0 33.879,-3.903 49.492,-40.359 11.633,-27.323 44.187,-109.292 51.993,-143.095 1.403,-6.167 3.59,-13.113 5.855,-20.843 2.264,-7.73 4.604,-16.162 6.48,-25.371 6.633,-32.553 7.181,-74.864 -24.67,-127.169 z m -57.535,127.169 c -7.021,0 -12.724,5.702 -12.724,12.724 0,6.944 5.702,12.647 12.724,12.647 h 43.18 c -1.395,4.742 -2.721,9.347 -3.735,13.814 -7.106,30.754 -38.43,110.016 -50.27,137.835 -9.179,21.422 -15.888,21.422 -20.79,21.422 -4.872,0 -11.535,0 -20.729,-21.46 -7.136,-16.62 -21.484,-52.352 -33.384,-85.255 h 18.358 c 7.029,0 12.724,-5.702 12.724,-12.647 0,-7.021 -5.695,-12.724 -12.724,-12.724 h -27.201 c -1.09,-3.294 -2.165,-6.541 -3.118,-9.582 -2.218,-6.9 -3.934,-12.922 -4.97,-17.527 -1.364,-5.954 -3.156,-12.03 -5.055,-18.456 -5.504,-18.632 -11.74,-39.75 -9.628,-65.236 0.061,-0.792 0.214,-1.6 0.29,-2.394 h 67.248 c 7.029,0 12.647,-5.702 12.647,-12.724 0,-6.945 -5.618,-12.648 -12.647,-12.648 H 175.78 c 3.957,-12.686 9.827,-25.653 17.725,-38.621 7.037,-11.466 21.011,-12.045 23.74,-12.045 h 77.44 c 3.842,0 16.917,0.877 23.763,11.946 27.94,45.887 25.76,80.055 20.736,104.702 -0.442,2.158 -0.968,4.155 -1.456,6.229 z"
id="path1"
style="fill:#000000" />
<polygon
class="st0"
points="259.501,20.515 260.545,71.822 248.836,71.822 248.836,0 210.062,3.423 213.965,36.478 224.371,75.245 216.565,78.668 197.049,31.927 169.718,42.189 194.7,110.588 315.451,110.588 336.263,50.163 305.036,47.876 298.534,87.786 288.127,85.506 292.031,25.082 "
id="polygon1"
style="fill:#000000" />
</g><circle
id="path2"
style="fill:#000000;stroke:#000000;stroke-width:0.2"
cx="521.88666"
cy="45.191727"
r="0.0043425169" /><path
d="M 576,657 H -64 c -24,0 -40,-16 -40,-40 0,-24 16,-40 40,-40 h 640 c 24,0 40,16 40,40 0,24 -16,40 -40,40 z"
id="path1-3"
style="stroke-width:40" /><g
id="g2-7"
transform="matrix(0,-3.2840933,3.2840933,0,211.59523,296.53997)">
<path
d="M 88.79,29.297 70.702,11.209 c -1.052,-1.052 -2.756,-1.052 -3.808,0 l -49.505,49.504 0.109,0.109 -0.171,-0.046 -6.772,25.272 0.004,0.001 c -0.309,0.935 -0.103,2.004 0.642,2.748 0.822,0.822 2.038,0.993 3.033,0.531 l 0.002,0.009 25.027,-6.706 -0.016,-0.059 0.038,0.038 49.505,-49.505 c 1.052,-1.052 1.052,-2.756 0,-3.808 z m -69.998,51.85 4.022,-15.009 10.988,10.988 z"
id="path1-5" />
</g></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

68
assets/icons/meal-add.svg Normal file
View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!-- License: CC0. Made by SVG Repo: https://www.svgrepo.com/svg/150226/meal -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 512.002 512.002"
style="enable-background:new 0 0 512.002 512.002;"
xml:space="preserve"
sodipodi:docname="meal-add.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs8">
</defs><sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="1.7363213"
inkscape:cx="256.00101"
inkscape:cy="257.15287"
inkscape:window-width="1920"
inkscape:window-height="1155"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<circle
id="path2"
style="fill:#000000;stroke:#000000;stroke-width:0.2"
cx="521.88666"
cy="45.191727"
r="0.0043425169" /><g
id="Page-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
transform="matrix(29.995699,0,0,29.995699,241.90437,1.6845255)"><g
id="Dribbble-Light-Preview"
transform="translate(-345,-206)"
fill="#000000"><g
id="icons"
transform="translate(56,160)"><polygon
id="plus_mini-[#1523]"
points="298,49 298,51 294.625,51 294.625,54 292.375,54 292.375,51 289,51 289,49 292.375,49 292.375,46 294.625,46 294.625,49 " /></g></g></g><g
id="g3"
transform="matrix(0.95088529,0,0,0.95088529,6.6189799,110.996)">
<g
id="g2">
<path
d="M 494.434,315.678 H 463.697 C 455.367,216.327 377.063,136.575 278.357,126.001 283.158,110.85 271.813,95.459 256,95.459 c -15.83,0 -27.153,15.407 -22.357,30.542 -98.707,10.574 -177.01,90.327 -185.34,189.677 H 17.566 C 7.865,315.678 0,323.543 0,333.244 c 0,9.701 7.865,17.565 17.566,17.565 h 29.99 v 13.612 c 0,28.738 23.381,52.119 52.12,52.119 h 312.648 c 28.74,0 52.12,-23.381 52.12,-52.119 v -13.612 h 29.99 c 9.701,0 17.565,-7.865 17.565,-17.565 10e-4,-9.701 -7.864,-17.566 -17.565,-17.566 z M 112.028,273.83 c 15.615,-37.716 46.155,-68.42 83.79,-84.238 8.943,-3.761 19.24,0.444 22.999,9.387 3.759,8.944 -0.444,19.241 -9.387,23 -29.17,12.261 -52.841,36.057 -64.942,65.29 -3.706,8.953 -13.973,13.224 -22.949,9.51 -8.963,-3.712 -13.221,-13.987 -9.511,-22.949 z m 317.285,90.591 c 0,9.367 -7.621,16.988 -16.989,16.988 H 99.676 c -9.368,0 -16.989,-7.621 -16.989,-16.988 v -13.612 h 346.626 z"
id="path1" />
</g>
</g></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!-- License: CC0. Made by SVG Repo: https://www.svgrepo.com/svg/150226/meal -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 512.002 512.002"
style="enable-background:new 0 0 512.002 512.002;"
xml:space="preserve"
sodipodi:docname="meal-check.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs8">
</defs><sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="1.7363213"
inkscape:cx="274.43077"
inkscape:cy="257.7288"
inkscape:window-width="1920"
inkscape:window-height="1155"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<circle
id="path2"
style="fill:#000000;stroke:#000000;stroke-width:0.2"
cx="521.88666"
cy="45.191727"
r="0.0043425169" /><path
clip-rule="evenodd"
d="M 515.875,51.622857 349.49393,218.00373 253.80627,122.31651 303.7942,72.328499 349.49393,118.02824 465.88752,1.6348403 Z"
fill="#030708"
fill-rule="evenodd"
id="path1-3"
style="stroke-width:17.6734" /><g
id="g3"
transform="matrix(0.96951671,0,0,0.95088529,8.306314,109.89053)">
<g
id="g2">
<path
d="M 494.434,315.678 H 463.697 C 455.367,216.327 377.063,136.575 278.357,126.001 283.158,110.85 271.813,95.459 256,95.459 c -15.83,0 -27.153,15.407 -22.357,30.542 -98.707,10.574 -177.01,90.327 -185.34,189.677 H 17.566 C 7.865,315.678 0,323.543 0,333.244 c 0,9.701 7.865,17.565 17.566,17.565 h 29.99 v 13.612 c 0,28.738 23.381,52.119 52.12,52.119 h 312.648 c 28.74,0 52.12,-23.381 52.12,-52.119 v -13.612 h 29.99 c 9.701,0 17.565,-7.865 17.565,-17.565 10e-4,-9.701 -7.864,-17.566 -17.565,-17.566 z M 112.028,273.83 c 15.615,-37.716 46.155,-68.42 83.79,-84.238 8.943,-3.761 19.24,0.444 22.999,9.387 3.759,8.944 -0.444,19.241 -9.387,23 -29.17,12.261 -52.841,36.057 -64.942,65.29 -3.706,8.953 -13.973,13.224 -22.949,9.51 -8.963,-3.712 -13.221,-13.987 -9.511,-22.949 z m 317.285,90.591 c 0,9.367 -7.621,16.988 -16.989,16.988 H 99.676 c -9.368,0 -16.989,-7.621 -16.989,-16.988 v -13.612 h 346.626 z"
id="path1" />
</g>
</g></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!-- License: CC0. Made by SVG Repo: https://www.svgrepo.com/svg/150226/meal -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 512.002 512.002"
style="enable-background:new 0 0 512.002 512.002;"
xml:space="preserve"
sodipodi:docname="meal-diary.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs8">
</defs><sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="1.7363213"
inkscape:cx="257.15287"
inkscape:cy="257.7288"
inkscape:window-width="1920"
inkscape:window-height="1155"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<circle
id="path2"
style="fill:#000000;stroke:#000000;stroke-width:0.2"
cx="521.88666"
cy="45.191727"
r="0.0043425169" /><g
id="g8-6"
transform="matrix(0.4527684,0,0,0.4527684,296.76275,1.8149751)">
<g
id="g7-7">
<g
id="g6-5">
<path
d="m 380.68,372.453 c -13.938,0 -25.284,11.342 -25.284,25.301 v 54.441 l 80.034,-79.742 z"
id="path1-3" />
<path
d="m 433.745,492.197 c 23.156,0 41.912,-18.76 41.912,-41.898 V 379.285 L 362.338,492.197 Z"
id="path2-5" />
<path
d="M 433.745,0 H 100.255 C 77.537,0 59.15,18.11 58.486,40.653 h 39.691 c 9.479,-7.013 21.051,-10.876 33.139,-10.876 30.785,0 55.84,25.055 55.84,55.84 0,30.784 -25.055,55.826 -55.84,55.826 -11.992,0 -23.527,-3.863 -33.059,-10.84 H 58.355 v 70.543 h 39.822 c 9.479,-7.008 21.051,-10.871 33.139,-10.871 30.785,0 55.84,25.055 55.84,55.84 0,30.783 -25.055,55.84 -55.84,55.84 -11.992,0 -23.547,-3.859 -33.072,-10.854 H 58.355 v 70.543 h 39.822 c 9.492,-6.995 21.064,-10.857 33.139,-10.857 30.785,0 55.84,25.042 55.84,55.825 0,30.784 -25.055,55.84 -55.84,55.84 -11.992,0 -23.527,-3.861 -33.059,-10.84 h -39.77 c 0.715,22.524 19.082,40.586 41.77,40.586 h 221.904 v -94.445 c 0,-32.281 26.258,-58.537 58.52,-58.537 H 475.66 V 41.901 C 475.659,18.761 456.903,0 433.745,0 Z"
id="path3-6" />
<path
d="m 36.577,105.68 h 71.213 c 5.68,6.588 14.115,10.84 23.527,10.84 17.07,0 30.916,-13.827 30.916,-30.902 0,-17.071 -13.846,-30.912 -30.916,-30.912 -9.412,0 -17.848,4.14 -23.527,10.872 H 36.577 c -11.066,0 -20.039,8.974 -20.039,20.04 -0.001,11.101 8.972,20.062 20.039,20.062 z"
id="path4-2" />
<path
d="m 36.577,266.172 h 71.213 c 5.68,6.606 14.115,10.858 23.527,10.858 17.07,0 30.916,-13.846 30.916,-30.915 0,-17.072 -13.846,-30.916 -30.916,-30.916 -9.412,0 -17.848,4.139 -23.527,10.875 H 36.577 c -11.066,0 -20.039,8.975 -20.039,20.059 0,11.084 8.972,20.039 20.039,20.039 z"
id="path5-9" />
<path
d="m 131.316,437.523 c 17.07,0 30.916,-13.839 30.916,-30.91 0,-17.074 -13.846,-30.902 -30.916,-30.902 -9.412,0 -17.848,4.141 -23.527,10.857 H 36.577 c -11.066,0 -20.039,8.975 -20.039,20.059 0,11.084 8.973,20.06 20.039,20.06 h 71.213 c 5.679,6.584 14.115,10.836 23.526,10.836 z"
id="path6-1" />
</g>
</g>
</g><g
id="g3"
transform="matrix(0.96722928,0,0,0.95088529,9.377261,111.69164)">
<g
id="g2">
<path
d="M 494.434,315.678 H 463.697 C 455.367,216.327 377.063,136.575 278.357,126.001 283.158,110.85 271.813,95.459 256,95.459 c -15.83,0 -27.153,15.407 -22.357,30.542 -98.707,10.574 -177.01,90.327 -185.34,189.677 H 17.566 C 7.865,315.678 0,323.543 0,333.244 c 0,9.701 7.865,17.565 17.566,17.565 h 29.99 v 13.612 c 0,28.738 23.381,52.119 52.12,52.119 h 312.648 c 28.74,0 52.12,-23.381 52.12,-52.119 v -13.612 h 29.99 c 9.701,0 17.565,-7.865 17.565,-17.565 10e-4,-9.701 -7.864,-17.566 -17.565,-17.566 z M 112.028,273.83 c 15.615,-37.716 46.155,-68.42 83.79,-84.238 8.943,-3.761 19.24,0.444 22.999,9.387 3.759,8.944 -0.444,19.241 -9.387,23 -29.17,12.261 -52.841,36.057 -64.942,65.29 -3.706,8.953 -13.973,13.224 -22.949,9.51 -8.963,-3.712 -13.221,-13.987 -9.511,-22.949 z m 317.285,90.591 c 0,9.367 -7.621,16.988 -16.989,16.988 H 99.676 c -9.368,0 -16.989,-7.621 -16.989,-16.988 v -13.612 h 346.626 z"
id="path1" />
</g>
</g></svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!-- License: CC0. Made by SVG Repo: https://www.svgrepo.com/svg/150226/meal -->
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 512.002 512.002"
style="enable-background:new 0 0 512.002 512.002;"
xml:space="preserve"
sodipodi:docname="meal-edit.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs8">
</defs><sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="1.7363213"
inkscape:cx="257.15287"
inkscape:cy="257.15287"
inkscape:window-width="1920"
inkscape:window-height="1155"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<circle
id="path2"
style="fill:#000000;stroke:#000000;stroke-width:0.2"
cx="521.88666"
cy="45.191727"
r="0.0043425169" /><path
d="M 576,657 H -64 c -24,0 -40,-16 -40,-40 0,-24 16,-40 40,-40 h 640 c 24,0 40,16 40,40 0,24 -16,40 -40,40 z"
id="path1-3"
style="stroke-width:40" /><g
id="g2-7"
transform="matrix(0,-3.2840933,3.2840933,0,211.59523,296.53997)">
<path
d="M 88.79,29.297 70.702,11.209 c -1.052,-1.052 -2.756,-1.052 -3.808,0 l -49.505,49.504 0.109,0.109 -0.171,-0.046 -6.772,25.272 0.004,0.001 c -0.309,0.935 -0.103,2.004 0.642,2.748 0.822,0.822 2.038,0.993 3.033,0.531 l 0.002,0.009 25.027,-6.706 -0.016,-0.059 0.038,0.038 49.505,-49.505 c 1.052,-1.052 1.052,-2.756 0,-3.808 z m -69.998,51.85 4.022,-15.009 10.988,10.988 z"
id="path1-5" />
</g><g
id="g3"
transform="matrix(0.96951671,0,0,0.95088529,6.988638,111.33001)">
<g
id="g2">
<path
d="M 494.434,315.678 H 463.697 C 455.367,216.327 377.063,136.575 278.357,126.001 283.158,110.85 271.813,95.459 256,95.459 c -15.83,0 -27.153,15.407 -22.357,30.542 -98.707,10.574 -177.01,90.327 -185.34,189.677 H 17.566 C 7.865,315.678 0,323.543 0,333.244 c 0,9.701 7.865,17.565 17.566,17.565 h 29.99 v 13.612 c 0,28.738 23.381,52.119 52.12,52.119 h 312.648 c 28.74,0 52.12,-23.381 52.12,-52.119 v -13.612 h 29.99 c 9.701,0 17.565,-7.865 17.565,-17.565 10e-4,-9.701 -7.864,-17.566 -17.565,-17.566 z M 112.028,273.83 c 15.615,-37.716 46.155,-68.42 83.79,-84.238 8.943,-3.761 19.24,0.444 22.999,9.387 3.759,8.944 -0.444,19.241 -9.387,23 -29.17,12.261 -52.841,36.057 -64.942,65.29 -3.706,8.953 -13.973,13.224 -22.949,9.51 -8.963,-3.712 -13.221,-13.987 -9.511,-22.949 z m 317.285,90.591 c 0,9.367 -7.621,16.988 -16.989,16.988 H 99.676 c -9.368,0 -16.989,-7.621 -16.989,-16.988 v -13.612 h 346.626 z"
id="path1" />
</g>
</g></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

View File

@@ -1,3 +0,0 @@
https://thenounproject.com/photo/tomatoes-chilies-and-dill-leaves-on-table-0JoGn5/
Tomatoes, chilies and dill leaves on table by Jacob Lund from Noun Project

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

View File

@@ -1,3 +0,0 @@
https://thenounproject.com/photo/athlete-working-out-with-battle-ropes-outdoors-on-grass-field-0LrJR4/
Athlete working out with battle ropes outdoors on grass field by Jacob Lund from Noun Project

View File

@@ -256,11 +256,12 @@
"@addMeal": {},
"mealLogged": "Meal logged to diary",
"@mealLogged": {},
"logMeal": "Log this meal",
"ingredientLogged": "Ingredient logged to diary",
"logMeal": "Log meal to nutrition diary",
"@logMeal": {},
"addIngredient": "Add ingredient",
"@addIngredient": {},
"logIngredient": "Save to nutrition diary",
"logIngredient": "Log ingredient to nutrition diary",
"@logIngredient": {},
"searchIngredient": "Search ingredient",
"@searchIngredient": {
@@ -282,6 +283,7 @@
"@goalMacro": {
"description": "The goal for macronutrients"
},
"selectMealToLog": "Select a meal to log to diary",
"goalEnergy": "Energy goal",
"goalProtein": "Protein goal",
"goalCarbohydrates": "Carbohydrates goal",

View File

@@ -39,6 +39,7 @@ import 'package:wger/screens/gallery_screen.dart';
import 'package:wger/screens/gym_mode.dart';
import 'package:wger/screens/home_tabs_screen.dart';
import 'package:wger/screens/log_meal_screen.dart';
import 'package:wger/screens/log_meals_screen.dart';
import 'package:wger/screens/measurement_categories_screen.dart';
import 'package:wger/screens/measurement_entries_screen.dart';
import 'package:wger/screens/nutritional_diary_screen.dart';
@@ -159,6 +160,7 @@ class MyApp extends StatelessWidget {
NutritionalPlansScreen.routeName: (ctx) => NutritionalPlansScreen(),
NutritionalDiaryScreen.routeName: (ctx) => NutritionalDiaryScreen(),
NutritionalPlanScreen.routeName: (ctx) => NutritionalPlanScreen(),
LogMealsScreen.routeName: (ctx) => LogMealsScreen(),
LogMealScreen.routeName: (ctx) => LogMealScreen(),
WeightScreen.routeName: (ctx) => WeightScreen(),
WorkoutPlanScreen.routeName: (ctx) => WorkoutPlanScreen(),

View File

@@ -26,8 +26,9 @@ import 'package:wger/widgets/nutrition/widgets.dart';
class LogMealArguments {
final Meal meal;
final bool popTwice;
LogMealArguments(this.meal);
LogMealArguments(this.meal, this.popTwice);
}
class LogMealScreen extends StatefulWidget {
@@ -104,6 +105,9 @@ class _LogMealScreenState extends State<LogMealScreen> {
),
);
Navigator.of(context).pop();
if (args.popTwice) {
Navigator.of(context).pop();
}
},
),
TextButton(

View File

@@ -0,0 +1,52 @@
/*
* This file is part of wger Workout Manager <https://github.com/wger-project>.
* Copyright (C) 2020, 2021 wger Team
*
* wger Workout Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* wger Workout Manager is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:wger/models/nutrition/nutritional_plan.dart';
import 'package:wger/widgets/nutrition/meal.dart';
class LogMealsScreen extends StatefulWidget {
static const routeName = '/log-meals';
@override
State<LogMealsScreen> createState() => _LogMealsScreenState();
}
class _LogMealsScreenState extends State<LogMealsScreen> {
double portionPct = 100;
@override
Widget build(BuildContext context) {
final nutritionalPlan = ModalRoute.of(context)!.settings.arguments as NutritionalPlan;
return Scaffold(
appBar: AppBar(
title: Text(AppLocalizations.of(context).selectMealToLog),
),
body: ListView.builder(
itemCount: nutritionalPlan.meals.length,
itemBuilder: (context, index) => MealWidget(
nutritionalPlan.meals[index],
nutritionalPlan.dedupMealItems,
true,
true,
)),
);
}
}

View File

@@ -18,17 +18,18 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_svg_icons/flutter_svg_icons.dart';
import 'package:provider/provider.dart';
import 'package:wger/models/nutrition/nutritional_plan.dart';
import 'package:wger/providers/nutrition.dart';
import 'package:wger/screens/form_screen.dart';
import 'package:wger/screens/log_meals_screen.dart';
import 'package:wger/widgets/nutrition/forms.dart';
import 'package:wger/widgets/nutrition/nutritional_plan_detail.dart';
enum NutritionalPlanOptions {
edit,
delete,
toggleMode,
}
class NutritionalPlanScreen extends StatelessWidget {
@@ -45,35 +46,70 @@ class NutritionalPlanScreen extends StatelessWidget {
return Scaffold(
//appBar: getAppBar(nutritionalPlan),
floatingActionButton: FloatingActionButton(
child: const Icon(
Icons.history_edu,
color: Colors.white,
),
onPressed: () {
Navigator.pushNamed(
context,
FormScreen.routeName,
arguments: FormScreenArguments(
AppLocalizations.of(context).logIngredient,
IngredientLogForm(nutritionalPlan),
hasListView: true,
floatingActionButton: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
FloatingActionButton(
heroTag: null,
tooltip: AppLocalizations.of(context).logIngredient,
onPressed: () {
Navigator.pushNamed(
context,
FormScreen.routeName,
arguments: FormScreenArguments(
AppLocalizations.of(context).logIngredient,
IngredientLogForm(nutritionalPlan),
hasListView: true,
),
);
},
child: const SvgIcon(
icon: SvgIconData('assets/icons/ingredient-diary.svg'),
color: Colors.white,
),
);
},
),
const SizedBox(
width: 8,
),
FloatingActionButton(
heroTag: null,
tooltip: AppLocalizations.of(context).logMeal,
onPressed: () {
Navigator.of(context).pushNamed(LogMealsScreen.routeName, arguments: nutritionalPlan);
},
child: const SvgIcon(
icon: SvgIconData('assets/icons/meal-diary.svg'),
color: Colors.white,
),
),
],
),
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
foregroundColor: appBarForeground,
expandedHeight: 250,
pinned: true,
iconTheme: const IconThemeData(color: appBarForeground),
actions: [
if (!nutritionalPlan.onlyLogging)
IconButton(
icon: const SvgIcon(
icon: SvgIconData('assets/icons/meal-add.svg'),
),
onPressed: () {
Navigator.pushNamed(
context,
FormScreen.routeName,
arguments: FormScreenArguments(
AppLocalizations.of(context).addMeal,
MealForm(nutritionalPlan.id!),
),
);
},
),
PopupMenuButton<NutritionalPlanOptions>(
icon: const Icon(Icons.more_vert, color: appBarForeground),
onSelected: (value) {
// Edit
if (value == NutritionalPlanOptions.edit) {
Navigator.pushNamed(
context,
@@ -84,8 +120,6 @@ class NutritionalPlanScreen extends StatelessWidget {
hasListView: true,
),
);
// Delete
} else if (value == NutritionalPlanOptions.delete) {
Provider.of<NutritionPlansProvider>(context, listen: false)
.deletePlan(nutritionalPlan.id!);
@@ -96,12 +130,16 @@ class NutritionalPlanScreen extends StatelessWidget {
return [
PopupMenuItem<NutritionalPlanOptions>(
value: NutritionalPlanOptions.edit,
child: Text(AppLocalizations.of(context).edit),
child: ListTile(
leading: const Icon(Icons.edit),
title: Text(AppLocalizations.of(context).edit)),
),
const PopupMenuDivider(),
PopupMenuItem<NutritionalPlanOptions>(
value: NutritionalPlanOptions.delete,
child: Text(AppLocalizations.of(context).delete),
child: ListTile(
leading: const Icon(Icons.delete),
title: Text(AppLocalizations.of(context).delete)),
),
];
},
@@ -113,10 +151,6 @@ class NutritionalPlanScreen extends StatelessWidget {
nutritionalPlan.getLabel(context),
style: Theme.of(context).textTheme.titleLarge?.copyWith(color: appBarForeground),
),
background: const Image(
image: AssetImage('assets/images/backgrounds/nutritional_plans.jpg'),
fit: BoxFit.cover,
),
),
),
FutureBuilder(

View File

@@ -77,7 +77,6 @@ class _WorkoutPlanScreenState extends State<WorkoutPlanScreen> {
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
expandedHeight: 250,
pinned: true,
iconTheme: const IconThemeData(color: appBarForeground),
backgroundColor: wgerPrimaryColor,
@@ -87,10 +86,6 @@ class _WorkoutPlanScreenState extends State<WorkoutPlanScreen> {
workoutPlan.name,
style: Theme.of(context).textTheme.titleLarge?.copyWith(color: appBarForeground),
),
background: const Image(
image: AssetImage('assets/images/backgrounds/workout_plans.jpg'),
fit: BoxFit.cover,
),
),
actions: [
PopupMenuButton<WorkoutOptions>(

View File

@@ -19,6 +19,7 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_svg_icons/flutter_svg_icons.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
@@ -31,6 +32,8 @@ import 'package:wger/providers/user.dart';
import 'package:wger/providers/workout_plans.dart';
import 'package:wger/screens/form_screen.dart';
import 'package:wger/screens/gym_mode.dart';
import 'package:wger/screens/log_meal_screen.dart';
import 'package:wger/screens/log_meals_screen.dart';
import 'package:wger/screens/measurement_categories_screen.dart';
import 'package:wger/screens/nutritional_plan_screen.dart';
import 'package:wger/screens/weight_screen.dart';
@@ -86,20 +89,17 @@ class _DashboardNutritionWidgetState extends State<DashboardNutritionWidget> {
),
MutedText(getShortNutritionValues(meal.plannedNutritionalValues, context)),
IconButton(
icon: const Icon(Icons.history_edu),
icon: const SvgIcon(
icon: SvgIconData('assets/icons/meal-diary.svg'),
),
color: wgerPrimaryButtonColor,
onPressed: () {
Provider.of<NutritionPlansProvider>(context, listen: false).logMealToDiary(meal);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
AppLocalizations.of(context).mealLogged,
textAlign: TextAlign.center,
),
),
Navigator.of(context).pushNamed(
LogMealScreen.routeName,
arguments: LogMealArguments(meal, false),
);
},
),
)
],
),
);
@@ -195,7 +195,7 @@ class _DashboardNutritionWidgetState extends State<DashboardNutritionWidget> {
),
if (_hasContent)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
TextButton(
child: Text(AppLocalizations.of(context).goToDetailPage),
@@ -204,10 +204,9 @@ class _DashboardNutritionWidgetState extends State<DashboardNutritionWidget> {
.pushNamed(NutritionalPlanScreen.routeName, arguments: _plan);
},
),
Expanded(child: Container()),
IconButton(
icon: const Icon(
Icons.history_edu,
),
icon: const SvgIcon(icon: SvgIconData('assets/icons/ingredient-diary.svg')),
tooltip: AppLocalizations.of(context).logIngredient,
onPressed: () {
Navigator.pushNamed(
@@ -221,6 +220,13 @@ class _DashboardNutritionWidgetState extends State<DashboardNutritionWidget> {
);
},
),
IconButton(
icon: const SvgIcon(icon: SvgIconData('assets/icons/meal-diary.svg')),
tooltip: AppLocalizations.of(context).logMeal,
onPressed: () {
Navigator.of(context).pushNamed(LogMealsScreen.routeName, arguments: _plan);
},
),
],
),
],

View File

@@ -135,6 +135,14 @@ Widget IngredientLogForm(NutritionalPlan plan) {
onSave: (BuildContext context, MealItem mealItem, DateTime? dt) {
Provider.of<NutritionPlansProvider>(context, listen: false)
.logIngredientToDiary(mealItem, plan.id!, dt);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
AppLocalizations.of(context).ingredientLogged,
textAlign: TextAlign.center,
),
),
);
},
withDate: true);
}

View File

@@ -18,6 +18,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_svg_icons/flutter_svg_icons.dart';
import 'package:provider/provider.dart';
import 'package:wger/helpers/consts.dart';
import 'package:wger/models/nutrition/log.dart';
@@ -40,10 +41,14 @@ enum viewMode {
class MealWidget extends StatefulWidget {
final Meal _meal;
final List<MealItem> _recentMealItems;
final bool popTwice;
final bool readOnly;
const MealWidget(
this._meal,
this._recentMealItems,
this.popTwice,
this.readOnly,
);
@override
@@ -89,6 +94,8 @@ class _MealWidgetState extends State<MealWidget> {
MealHeader(
editing: _editing,
toggleEditing: _toggleEditing,
popTwice: widget.popTwice,
readOnly: widget.readOnly,
viewMode: _viewMode,
toggleViewMode: _toggleDetails,
meal: widget._meal,
@@ -278,6 +285,8 @@ class LogDiaryItemWidget extends StatelessWidget {
class MealHeader extends StatelessWidget {
final Meal _meal;
final bool _editing;
final bool popTwice;
final bool readOnly;
final viewMode _viewMode;
final Function _toggleEditing;
final Function _toggleViewMode;
@@ -285,6 +294,8 @@ class MealHeader extends StatelessWidget {
const MealHeader({
required Meal meal,
required bool editing,
this.popTwice = false,
this.readOnly = false,
required viewMode viewMode,
required Function toggleEditing,
required Function toggleViewMode,
@@ -303,36 +314,20 @@ class MealHeader extends StatelessWidget {
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
title: Row(children: [
Expanded(
child: (_meal.name != '')
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_meal.name,
style: Theme.of(context).textTheme.titleMedium,
),
if (_meal.time != null)
Text(
_meal.time!.format(context),
style: Theme.of(context).textTheme.headlineSmall,
)
],
)
: Text(
_meal.time != null ? _meal.time!.format(context) : '',
style: Theme.of(context).textTheme.headlineSmall,
),
),
if (_meal.isRealMeal)
Text(
AppLocalizations.of(context).log,
style: Theme.of(context)
.textTheme
.labelLarge
?.copyWith(color: Theme.of(context).colorScheme.primary),
),
const SizedBox(width: 26),
const SizedBox(height: 40, width: 1, child: VerticalDivider()),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
((_meal.time != null) ? '${_meal.time!.format(context)} ' : '') + _meal.name,
style: Theme.of(context).textTheme.titleMedium,
),
if (_meal.isRealMeal)
Text(
getShortNutritionValues(_meal.plannedNutritionalValues, context),
style: Theme.of(context).textTheme.titleSmall,
),
],
)),
]),
trailing: Row(
mainAxisSize: MainAxisSize.min,
@@ -348,8 +343,8 @@ class MealHeader extends StatelessWidget {
},
tooltip: AppLocalizations.of(context).toggleDetails,
),
const SizedBox(width: 5),
if (_meal.isRealMeal)
if (_meal.isRealMeal && !readOnly) const SizedBox(width: 5),
if (_meal.isRealMeal && !readOnly)
IconButton(
icon: _editing ? const Icon(Icons.done) : const Icon(Icons.edit),
tooltip: _editing
@@ -358,14 +353,16 @@ class MealHeader extends StatelessWidget {
onPressed: () {
_toggleEditing();
},
)
),
if (_meal.isRealMeal) const SizedBox(width: 5),
if (_meal.isRealMeal) const SvgIcon(icon: SvgIconData('assets/icons/meal-diary.svg')),
],
),
onTap: _meal.isRealMeal
? () {
Navigator.of(context).pushNamed(
LogMealScreen.routeName,
arguments: LogMealArguments(_meal),
arguments: LogMealArguments(_meal, popTwice),
);
}
: null,

View File

@@ -21,9 +21,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
import 'package:wger/models/nutrition/nutritional_plan.dart';
import 'package:wger/providers/body_weight.dart';
import 'package:wger/screens/form_screen.dart';
import 'package:wger/widgets/nutrition/charts.dart';
import 'package:wger/widgets/nutrition/forms.dart';
import 'package:wger/widgets/nutrition/macro_nutrients_table.dart';
import 'package:wger/widgets/nutrition/meal.dart';
import 'package:wger/widgets/nutrition/nutritional_diary_table.dart';
@@ -57,28 +55,15 @@ class NutritionalPlanDetailWidget extends StatelessWidget {
..._nutritionalPlan.meals.map((meal) => MealWidget(
meal,
_nutritionalPlan.dedupMealItems,
false,
false,
)),
MealWidget(
_nutritionalPlan.pseudoMealOthers('Other logs'),
_nutritionalPlan.dedupMealItems,
false,
true,
),
if (!_nutritionalPlan.onlyLogging)
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
child: Text(AppLocalizations.of(context).addMeal),
onPressed: () {
Navigator.pushNamed(
context,
FormScreen.routeName,
arguments: FormScreenArguments(
AppLocalizations.of(context).addMeal,
MealForm(_nutritionalPlan.id!),
),
);
},
),
),
if (nutritionalGoals.isComplete())
Container(
padding: const EdgeInsets.all(15),

View File

@@ -528,6 +528,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.10+1"
flutter_svg_icons:
dependency: "direct main"
description:
name: flutter_svg_icons
sha256: a8c91c48a0c6e36eb4c7bfd87f493e3be89249c61150c9909fd16f2c2d5daad0
url: "https://pub.dev"
source: hosted
version: "0.0.1+4"
flutter_test:
dependency: "direct dev"
description: flutter

View File

@@ -69,6 +69,8 @@ dependencies:
flex_color_scheme: ^7.3.1
freezed_annotation: ^2.4.1
clock: ^1.1.1
flutter_svg_icons: ^0.0.1
dev_dependencies:
flutter_test:
@@ -99,10 +101,10 @@ flutter:
assets:
- assets/animations/
- assets/images/
- assets/images/backgrounds/
- assets/images/muscles/
- assets/images/muscles/main/
- assets/images/muscles/secondary/
- assets/icons/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

@@ -134,7 +134,7 @@ void main() {
await tester.tap(find.byType(TextButton));
await tester.pumpAndSettle();
expect(find.text('5:00 PM'), findsOneWidget);
expect(find.textContaining('5:00 PM'), findsOneWidget);
});
testWidgets('Tests the localization of times - DE', (WidgetTester tester) async {
@@ -142,6 +142,6 @@ void main() {
await tester.tap(find.byType(TextButton));
await tester.pumpAndSettle();
expect(find.text('17:00'), findsOneWidget);
expect(find.textContaining('17:00'), findsOneWidget);
});
}