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

Unsupported operation: Platform._environment #1565

Closed
Rexios80 opened this issue Jan 23, 2024 · 9 comments · Fixed by #1568
Closed

Unsupported operation: Platform._environment #1565

Rexios80 opened this issue Jan 23, 2024 · 9 comments · Fixed by #1568

Comments

@Rexios80
Copy link

https://github.com/imaNNeo/fl_chart/blame/4b144a03d14b750aea76001f763442eff8044c69/lib/src/chart/line_chart/line_chart_data.dart#L13

@Rexios80 Rexios80 changed the title This line throws an exception on web Unsupported operation: Platform._environment Jan 23, 2024
@Rexios80
Copy link
Author

This line throws an exception on web

@Rexios80
Copy link
Author

Should probably retract that version

@Sernrbia
Copy link

I have the same issue, on mobile it works perfectly but it fails on Chrome. Tested on latest Windows 10 and latest MacOS

@uberchilly
Copy link

uberchilly commented Jan 23, 2024

From another flutter issue

image

@MODE83-PROJET-DEV
Copy link

MODE83-PROJET-DEV commented Jan 23, 2024

same problem, switch back to fl_chart version: ^0.65.0 fixed the problem or removed variable the final _isTest = Platform.environment.containsKey('FLUTTER_TEST'); and dart.io in bar_chart_data.dart

@ebutterfly
Copy link

I'm getting the same "Unsupported operation: Platform._environment" exception on Web with 0.66.1, making the latest version unusable on Web. If I downgrade back to 0.65.0, then fl_chart works again on Web.

@igornast
Copy link

+1

julianscheel added a commit to jusst-engineering/fl_chart that referenced this issue Jan 25, 2024
The Platform.environment can not be be accessed in flutter web. Remove
the check when running on web to prevent an exception.

Fixes imaNNeo#1565.
imaNNeo pushed a commit that referenced this issue Feb 6, 2024
The Platform.environment can not be be accessed in flutter web. Remove
the check when running on web to prevent an exception.

Fixes #1565.
@imaNNeo
Copy link
Owner

imaNNeo commented Feb 6, 2024

Yes, that was my mistake.
Thanks for letting me know and sorry for the delay.
It is already merged. We will have a new version soon

@MODE83-PROJET-DEV
Copy link

Thanks :) 👍

OlehSv pushed a commit to Oleh-Sv/fl_chart that referenced this issue May 14, 2024
The Platform.environment can not be be accessed in flutter web. Remove
the check when running on web to prevent an exception.

Fixes imaNNeo#1565.
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 a pull request may close this issue.

7 participants