mzimmerm / flutter_charts

Charts Library for Flutter, written in Dart with Flutter.
Other
250 stars 42 forks source link

Trouble with flutter_charts dependent on google_fonts 2.2.0... #37

Closed RoarGronmo closed 1 year ago

RoarGronmo commented 1 year ago

When compiling my app using this library (I want to change from a deprecated library from another vendor: charts_flutter), I ran into this trouble:

C:\Flutter\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in m_work_admin...
Resolving dependencies...
Because m_work_admin depends on flutter_charts ^0.5.0 which depends on google_fonts ^2.2.0, google_fonts ^2.2.0 is required.
So, because m_work_admin depends on google_fonts ^4.0.1, version solving failed.
pub get failed
command: "C:\Flutter\flutter\bin\cache\dart-sdk\bin\dart __deprecated_pub --directory . get --example"
pub env: {
  "FLUTTER_ROOT": "C:\Flutter\flutter",
  "PUB_ENVIRONMENT": "flutter_cli:get",
  "PUB_CACHE": "C:\Users\RoarGronmo\AppData\Local\Pub\Cache",
}
exit code: 1

Process finished with exit code 1

Is there any hope that this library can use google_fonts ^4.0.1 in the future, or even in next release?

mzimmerm commented 1 year ago

Hi,

Thanks for reporting this.

I will definitely look into it and make a change for this (allowing dependence on newer google_fonts) - hoping this weekend.

Although, this is a result of an issue I had earlier with higher versions of google_fonts, so hopefully I will not run into something hard. For the record, this is the change I had to make back in February last year:

2022-02-05 : Fix issue Error: No named parameter with the name 'displayLarge'. google_fonts: ^2.2.0

google_fonts: 2.2.0

With a new release, the API would change though, but I assume you do not mind as you probably were not able to use flutter_charts in your situation.

Milan

RoarGronmo commented 1 year ago

I actually rolled back to v2.2.0 on google_fonts an did some intermediate changes, just to test your libraries.

Rather interesting though, and I even managed to "trick" the code so I could get separate colored bars.

Looking forward to the new version with font updates.

image

mzimmerm commented 1 year ago

Hi Roar (I hope I am parsing your name from the ID correctly),

Thanks for sharing your result, and helping out.

I should also share a few things about development of this library.

So first, I'd like to make a release (this weekend-ish) with the issues you found. But I have failed (purely a self-inflicted omission) to make a tag on the last release, so I will have to find the commit ID by date etc. Releasing from that commit ID would technically mean 'no api changes', but the semantic versioning does not cover things like: if I increase the google_font version dependency, some people's code may break anyway. I would also want to increase some other package dependencies for a later version anyway.

Second, in the last 6 months, I have been taking the code in another direction, where charts are created using only 'automatic' layouters (Row, Column, etc, etc). This is by far (like another 2-4 months by far) not ready though. I do maintain, in the same code, the switch to use the existing 'manual chart layouter' that still works. So I may release from this line of work (currently using branch flutter_charts_v4_2023-01-26_convert_Presenters_to_BoxContainers), but that would include actual API code changes - although I feel it would be very easy to convert the client API to the new version.

If you have a preference, please let me know. Either way, I will keep you informed here.

Milan

mzimmerm commented 1 year ago

Hi Roar,

I published an updated version 0.5.1. No API changes.

The main change are dependency changes to the latest packages, which includes google_fonts: ^4.0.3

All current tests are working, so I hope this will fix the issue you are having.

Please let me know, and/or go ahead and close this if it works for you

Thanks, Milan

RoarGronmo commented 1 year ago
Thanx Milan, will check it out at my first upportunity ! Sendt fra E-post for Windows Fra: Milan ZimmermannSendt: mandag 20. februar 2023 kl. 09:11Til: mzimmerm/flutter_chartsKopi: Roar Grønmo; AuthorEmne: Re: [mzimmerm/flutter_charts] Trouble with flutter_charts dependent on google_fonts 2.2.0... (Issue #37) Hi Roar,I published an updated version 0.5.1. No API changes.The main change are dependency changes to the latest packages, which includes google_fonts: ^4.0.3All current tests are working, so I hope this will fix the issue you are having.Please let me know, and/or go ahead and close this if it works for youThanks,Milan—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***> 
mzimmerm commented 1 year ago

@RoarGronmo : Hi Roar, were you able to validate the google_fonts dependency now working for you? If you did not have time or no longer need it that is fine, just checking if to close it. Thanks

RoarGronmo commented 1 year ago

It seems to work correctly now.

fre. 24. mar. 2023, 07:01 skrev Milan Zimmermann @.***>:

@RoarGronmo https://github.com/RoarGronmo : Hi Roar, were you able to validate the google_fonts dependency now working for you? If you did not have time or no longer need it that is fine, just checking if to close it. Thanks

— Reply to this email directly, view it on GitHub https://github.com/mzimmerm/flutter_charts/issues/37#issuecomment-1482297092, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVSTEHTC3REZZW4S4TXLELW5U2D3ANCNFSM6AAAAAAU3VR77E . You are receiving this because you were mentioned.Message ID: @.***>

mzimmerm commented 1 year ago

Thanks, I will go ahead and close.