dartflutter

using import 'dart:html' in flutter - Do I need additional dependencies?


I came across a websocket example that I would like to use. However it uses import 'dart:html';. When I introduce that in my Flutter project seems like its not being picked up. Do I need to add additional dependencies to the pubspec.yaml?


Solution

  • dart:html can't be used in Flutter. It is for browser applications only.

    dart:html also only comes with the regular Dart SDK, not with the Dart SDK shipped with Flutter.