0

When i add intl: ^0.17.0 to pubspec.yaml

i get the following errors:

../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.17.0/lib/intl_browser.dart:12:8: Error: Not found: 'dart:html'
import 'dart:html';
       ^
../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.17.0/lib/intl_browser.dart:24:48: Error: Undefined name 'window'.
  Intl.systemLocale = Intl.canonicalizedLocale(window.navigator.language);
                                               ^^^^^^

This only happens when the intl package is added.

How can i fix this?

1 Answers1

1

The problem was that i had imported: package:intl/intl_browser.dart

instead of: package:intl/intl.dart