srawlins / timezone

Time zone database and time zone aware DateTime object for Dart.
BSD 2-Clause "Simplified" License
102 stars 53 forks source link

Error Import Not Found Can't Run the App After adding 0.8.0 version #115

Closed prithiviraj closed 2 years ago

prithiviraj commented 2 years ago

../../../Softwares/Engineering/flutter/.pub-cache/hosted/pub.dartlang.org/timezone-0.8.0/lib/browser.dart:16:8: Error: Not found: 'dart:html' import 'dart:html'; ^ ../../../Softwares/Engineering/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';

Please help me with this.

SamoilovEA commented 2 years ago

@prithiviraj Hi, have you solved this problem?

Den-Ree commented 2 years ago

Having the same issue

Den-Ree commented 2 years ago

@srawlins maybe you have ideas what it might be?

@SamoilovEA @prithiviraj hi guys, did you find a way how to fix it?

laksh97 commented 2 years ago

@srawlins Can you please look into it and help on the same?

@SamoilovEA @prithiviraj @Den-Ree Did you guys manage to fix it?

asdasdasde commented 2 years ago

If you are not targeting the browser, check that you have not accidentally imported the browser specific file:

import 'package:timezone/browser.dart' as tz;

Instead, you should use:

import 'package:timezone/data/latest.dart' as tz;

laksh97 commented 2 years ago

Thanks, @asdasdasde, this solved the issue.

srawlins commented 2 years ago

Agreed; browser.dart imports dart:html which is not available on Flutter for iOS or Flutter for Android.