New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preselect correct time in session form #31
Comments
@rolandgeider , can I help out with this issue? |
all yours |
@rolandgeider, after upgrading my flutter version and installing all the dependencies, I am trying to run the application and getting the following:
Any idea why this is happening? It seems like something custom to your application as there is no such thing as body1. Maybe you meant bodyText1? |
for a change that's not on us, but on one of the dependencies 😅 You can use the 2.2.x version till they release an updated version |
I mean flutter 2.2.x |
Yeah, I got you. Would you like me to open an issue for this? |
Trying to run flutter downgrade to any version that is 2.2.x and getting:
It defaults to downgrade to version 2.0.2. |
that's strange, are you on the stable channel? If that doesn't work, there is a workaround to make the package work with 2.5, just don't commit that: google/charts#678 (comment) |
@rolandgeider, yes I am on the stable channel. Ran flutter doctor and this is the output:
I'll use the workaround you suggested (and won't commit it). |
BTW, you will need the backend server for this. If you don't want to setup everything with docker I can give you access to the test server, just write me an email |
Same thing happend for me, I also ended up using the workaround, but it seems like it worked when downgrading when in master channel. |
@rolandgeider, since I am using a Windows machine, I had previous problems running docker on it. I'll write you an email so I could use the test server. Thanks. |
Just sent you the login. And yeah, Docker in windows has gotten much better, but it still doesn't feel completely native. (use a day with few exercises, otherwise you'll have to click yourself to death to get to the end of the gym mode) |
@rolandgeider, now that I have everything up an running I can better understand what is desired in this issue. As stated, it uses the current time of the device. When you say it should instead use the values preset in the field, what do you mean? What would you like to be preset there? |
Yeah, that's the one. If you change the time and click to edit, the current time is selected again |
@rolandgeider. got it. I thought you want other values to show up when the screen is first shown. oATK2k7rYA.mp4Is there a specific scenario? |
I meant that if you set the time and click to edit it again the pre-selected time is always "now", regardless of what is on the field |
@rolandgeider, now I understand completely. The issue is probably because:
and
I thought about adding a ternary that does the following:
Because these two fields are initialized late, I can't just check their value (it throws an exception). What would you prefer that we do?
Each option has it's pros/cons. Let me know what you think would work best. |
I'm thinking, when is |
@rolandgeider,
The constructor leads to the session.dart class, which is a representation of a session with all the fields (which are declared late).
But (using the mock sever data), when fetching a session that does not exist on the server, I am guessing that all the fields are left uninitialized as they are marked late. As I suggested earlier, we can give certain (or all) fields a default value. |
so if we initialise the fields with the current time we won't need any more checks for the popup later on (don't have the code in front of me right now). That sounds like a much cleaner solution than checking for null or similar |
@rolandgeider, ok, just figured out the root cause of all of this. The field timeStart/end is only set on the onSaved callback, which gets called when the user presses the Save button.
The same goes for timeEnd WDYT? |
even simpler :) Go ahead with this |
@rolandgeider, I have opened a PR (after testing the solution). Would you mind adding the hacktoberfest-accepted label to this issue? |
oh yes, I meant authors.md, I'll fix the text. If the repo has the hacktoberfest tag the individual PRs don't need it as far as I know |
The session form (last page in the gym mode) always pre fills the current time when editing the start or the end time. It should of course use the values present in the field
The text was updated successfully, but these errors were encountered: