Search code examples
javaandroidflutterdartnew-operator

lib/Pages/ChattingPage.dart:15:8: Error: Not found: 'dart:html' import 'dart:html' as html;


I got this error when I was launching my app in the emulator does anybody know whats wrong sorry I am kind of new to android studio

lib/Pages/ChattingPage.dart:15:8: Error: Not found: 'dart:html'
import 'dart:html' as html;

But I did everything correctly it's RIGHT THERE

import 'dart:async';
import 'dart:io' as io;
import 'package:file/file.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:telegramchatapp/Widgets/FullImageWidget.dart';
import 'package:telegramchatapp/Widgets/ProgressWidget.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'dart:html' as html;

Solution

  • You can not import dart:html in app for mobile (android or iOS). Remove it. If you want use it for web application, you can use conditional import explained here.