segmentio / analytics_flutter

The hassle-free way to add Segment analytics to your Flutter app.
MIT License
26 stars 33 forks source link

Upgrade JS interop by removing dart:html dependency #78

Open maxlapides opened 1 month ago

maxlapides commented 1 month ago

"The Dart team recently overhauled the collection of features and APIs that allow developers access to JavaScript and browser bindings in their Dart code. This next generation of web interop not only improves user experience, but also enables Wasm support, aligning Dart with the future of the Web."

https://dart.dev/interop/js-interop

maxlapides commented 1 month ago

Looks like there are only two files using dart:html:

https://github.com/segmentio/analytics_flutter/blob/91b2322d0d2ecc8078c0c3737ceae1e523dbe134/packages/core/lib/analytics_web.dart#L2

https://github.com/segmentio/analytics_flutter/blob/91b2322d0d2ecc8078c0c3737ceae1e523dbe134/packages/core/lib/utils/store/web.dart#L3

edsonjab commented 3 weeks ago

Hi @maxlapides sorry to answer late, what version of flutter are you using?

When I try run flutter pub get on the project show me this message: image

I'm using Flutter 3.16.9

jardianoalmeida commented 2 weeks ago

boa tarde, remova esse importe e deve resolver o seu problema:

maxlapides commented 6 days ago

@edsonjab So sorry, I just saw your note! I tested this on Flutter 3.22.