Giter Site home page Giter Site logo

Comments (25)

TomerPacific avatar TomerPacific commented on June 13, 2024 2

@rolandgeider, yes I am on the stable channel. Ran flutter doctor and this is the output:

[√] Flutter (Channel stable, 2.5.2, on Microsoft Windows [Version 10.0.19043.1237], locale he-IL)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Android Studio (version 4.0)
[√] IntelliJ IDEA Community Edition (version 2019.3)
[√] VS Code (version 1.60.2)
[√] Connected device (3 available)

I'll use the workaround you suggested (and won't commit it).

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024 1

all yours

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024 1

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)

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024 1

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

from flutter.

TomerPacific avatar TomerPacific commented on June 13, 2024

@rolandgeider , can I help out with this issue?

from flutter.

TomerPacific avatar TomerPacific commented on June 13, 2024

@rolandgeider, after upgrading my flutter version and installing all the dependencies, I am trying to run the application and getting the following:

../../Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/charts_flutter-0.11.0/lib/src/behaviors/legend/legend_entry_layout.dart:134:45: Error: The getter 'body1' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../Flutter%20SDK/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'body1'.
      color ??= Theme.of(context).textTheme.body1!.color;
                                            ^^^^^

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?

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024

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

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024

I mean flutter 2.2.x

from flutter.

TomerPacific avatar TomerPacific commented on June 13, 2024

Yeah, I got you. Would you like me to open an issue for this?

from flutter.

TomerPacific avatar TomerPacific commented on June 13, 2024

Trying to run flutter downgrade to any version that is 2.2.x and getting:

C:\Users\Tomer\Documents\Projects\flutter>flutter downgrade v2.2.1
Downgrade flutter to version 2.0.2

It defaults to downgrade to version 2.0.2.

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024

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)

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024

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

from flutter.

M123-dev avatar M123-dev commented on June 13, 2024

Trying to run flutter downgrade to any version that is 2.2.x and getting:

C:\Users\Tomer\Documents\Projects\flutter>flutter downgrade v2.2.1
Downgrade flutter to version 2.0.2

It defaults to downgrade to version 2.0.2.

Same thing happend for me, I also ended up using the workaround, but it seems like it worked when downgrading when in master channel.

from flutter.

TomerPacific avatar TomerPacific commented on June 13, 2024

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

from flutter.

TomerPacific avatar TomerPacific commented on June 13, 2024

@rolandgeider, now that I have everything up an running I can better understand what is desired in this issue.
When talking about the session form, I am guessing you are referring to this page:

qemu-system-x86_64_JTLOKv57eC

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?

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024

Yeah, that's the one. If you change the time and click to edit, the current time is selected again

from flutter.

TomerPacific avatar TomerPacific commented on June 13, 2024

@rolandgeider. got it. I thought you want other values to show up when the screen is first shown.
Testing this out on an emulator device, I am getting mixed results.
It does seem to be working.

oATK2k7rYA.mp4

Is there a specific scenario?

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024

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

from flutter.

TomerPacific avatar TomerPacific commented on June 13, 2024

@rolandgeider, now I understand completely. The issue is probably because:

// Open time picker
                            final pickedTime = await showTimePicker(
                              context: context,
                              initialTime: widget._start,  /// <-----------
                            );

and

 final pickedTime = await showTimePicker(
                            context: context,
                            initialTime: TimeOfDay.now(),  /// <------------
                          );

I thought about adding a ternary that does the following:

initialTime: _session.timeStart != null ? _session.timeStart : widget._start

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?

  • We can give these fields a null starting value and check for that
  • Wrap the check for these fields with try/catch
  • Add boolean fields to check the status of these fields (initialized or not)

Each option has it's pros/cons. Let me know what you think would work best.

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024

I'm thinking, when is _session created anyway? Can't we just make sure it always have a start and end time?

from flutter.

TomerPacific avatar TomerPacific commented on June 13, 2024

@rolandgeider,
Session is initialized here (inside gym_mode.dart):

class _SessionPageState extends State<SessionPage> {
  final _form = GlobalKey<FormState>();
  final impressionController = TextEditingController();
  final notesController = TextEditingController();
  final timeStartController = TextEditingController();
  final timeEndController = TextEditingController();

  final _session = WorkoutSession();

The constructor leads to the session.dart class, which is a representation of a session with all the fields (which are declared late).
The session data itself is being fetched from workout_plans.dart:

  Future<dynamic> fetchSessionData() async {
    final data = await fetch(
      makeUrl(_sessionUrlPath),
    );
    return data;
  }

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.

from flutter.

TomerPacific avatar TomerPacific commented on June 13, 2024

@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.
So, to fix it, all you need to do is:

                           // Open time picker
                            final pickedTime = await showTimePicker(
                              context: context,
                              initialTime: _session.timeStart,  /// <---------
                            );

                            if (pickedTime != null) {
                              timeStartController.text = timeToString(pickedTime)!;
                              _session.timeStart = pickedTime;  /// <-----------------
                            }

The same goes for timeEnd

WDYT?

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024

even simpler :) Go ahead with this

from flutter.

TomerPacific avatar TomerPacific commented on June 13, 2024

@rolandgeider, I have opened a PR (after testing the solution). Would you mind adding the hacktoberfest-accepted label to this issue?
Also, in the PR template it says to add myself to the authors.rst file? I found the authors.md file and didn't know if I should add myself to it.

from flutter.

rolandgeider avatar rolandgeider commented on June 13, 2024

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

from flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.