Skip to content
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

WorldClockTab: Add time in other cities #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mjarkk
Copy link
Contributor

@mjarkk mjarkk commented Mar 18, 2022

Description

This adds a button that pops up a window where you can select a city.
After chosing the city the city is added to the WorldClockTab and the
time in that spesific city is displayed.

the selected cities are currently saved in memory thus reloading the app
will cause the clock to forget what you've selected.
I'm not sure how app configs are handled in this OS yet so i've left this one un-implemented.

Screenshots (if appropriate):

Screenshot 2022-03-18 at 7 55 42 PM

Screenshot 2022-03-18 at 7 55 05 PM

Type of change

Please tick the relevant option by putting an X inside the bracket

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • All current GitHub actions pass
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings
  • I have read the CONTRIBUTING document

@mjarkk mjarkk force-pushed the show-other-timezones branch 2 times, most recently from 7e4fd57 to ecc4267 Compare March 18, 2022 22:00
@nmcain
Copy link
Member

nmcain commented Mar 19, 2022

This is awesome, is it ready to merge?

@mjarkk
Copy link
Contributor Author

mjarkk commented Mar 19, 2022

I've worked on this feature on a macos and linux machine and there are some things i'm not sure about:

  1. It adds the timezone dependency and i'm not sure if this will work everywhere.
  2. Currently the added timezones are not written to disk so restarting the app will reset the list, i'm not sure if this is oke for now and if not how the app state should be saved to disk (file format, location)

@nmcain
Copy link
Member

nmcain commented Mar 19, 2022

Ideally, i'm looking to have settings save in a standard location, I believe that [HOME]/.config/ is pretty standard and we can work from there. As for file formats, really go with whatever you are comfortable with, i'd prefer JSON but I know writing to json in dart is a bit complex.

@mjarkk mjarkk force-pushed the show-other-timezones branch from ecc4267 to 0b606ef Compare March 19, 2022 18:09
@mjarkk
Copy link
Contributor Author

mjarkk commented Mar 19, 2022

Lets see if i can add that before merging this.

@mjarkk mjarkk force-pushed the show-other-timezones branch from 36a2d73 to 43844de Compare March 20, 2022 18:33
This adds a button that pops up a window where you can select a city.
After chosing the city the city is added to the WorldClockTab and the
time in that spesific city is displayed.
@mjarkk mjarkk force-pushed the show-other-timezones branch from 43844de to 8766545 Compare March 20, 2022 18:34
@mjarkk
Copy link
Contributor Author

mjarkk commented Mar 20, 2022

I've added support for writing the selected cities timezones to disk and reading them on app start.

@bleonard252
Copy link
Member

[HOME]/.config/ is pretty standard

It's standard on Linux but on Android (another target platform for some of these system apps), among other platforms, it's very much not.

I'm finally about to dig into this, so let's see how far I get before I have to leave for work 😄

@mjarkk
Copy link
Contributor Author

mjarkk commented Mar 26, 2022

@bleonard252 That seems logical.

I have no problem trying to implement this myself but i will need some directions on what kind of methods of storing configs i should use.
Thus far i have only used flutter for desktop apps and webapps so android will be something new for me.

I'm just thinking out loud here but would it make sense to have a dart package from dahliaOS for app configs purely for dahliaOS apps?

@larsb24
Copy link
Member

larsb24 commented Jun 17, 2022

@bleonard252 That seems logical.

I have no problem trying to implement this myself but i will need some directions on what kind of methods of storing configs i should use. Thus far i have only used flutter for desktop apps and webapps so android will be something new for me.

I'm just thinking out loud here but would it make sense to have a dart package from dahliaOS for app configs purely for dahliaOS apps?

The package is an idea, but doesn't exist yet. For now, I'd suggest using some database option such as either SharedPreferences or Hive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants