olatunde seyi
olatunde seyi

Reputation: 1

how can i resolve import dart:html problem in flutter

Error: Not found: 'dart:html' lib/homescreen.dart:1 import 'dart:html';

enter image description here

Upvotes: 0

Views: 2056

Answers (3)

Ahmed
Ahmed

Reputation: 11

The same error occurs when I try to import this line.

import 'package:dio/browser.dart'; 

after having removed this, it works fine again

Upvotes: 0

Amimul Ihsan
Amimul Ihsan

Reputation: 156

It seems like you have tried to import Platform or some other thing from auto suggestion and you ended up importing 'dart:html' header. kindly remove the header and if you want to use Platform then you can import 'dart:io'.

Let me know the update.

Thank you.

Upvotes: 0

Priyansh jain
Priyansh jain

Reputation: 1422

  • This error occurs when we try to run the project for Android or IOS and not for web.
  • There might be imports of dart:html in some files of your project. Remove those imports from all the files and run the app again to solve this problem.

Upvotes: 1

Related Questions