segmentio/analytics_flutter

Upgrade JS interop by removing dart:html dependency

Closed this issue · 4 comments

"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

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

import 'dart:html' as html show window;

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

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

  • import 'package:segment_analytics/analytics_web.dart';

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