This Argument typr 'File' cant be assigned in this paameter type File

26 Views Asked by At
2

There are 2 best solutions below

0
Reza Aslejeddian On BEST ANSWER

Apparently you have imported some unrelated File types from other libraries. To fix this, remove the imports:

C:\Users\91908\Downloads\ flutter_windows 3.3.9-stable\flutter\bin\cache lpkg \sky_engine\lib\html html_dart2js.dart
C: Users\91908\Downloads\flutter windows_3.3.9-stable\flutter\bin|cache\pkg\sky_engine Vib\io\file.dart

Now click on the imageFile variable and import the appropriate class.

0
afaque ali On

This issue is because You are importing two libraries having property named as File. Just import "Dart io" which is responsible for image Files.

import 'dart:io';

It is defined at (C: Users\91908\Downloads\flutter windows_3.3.9-stable\flutter\bin|cache\pkg\sky_engine Vib\io\file.dart) in your PC.

And remove the other library which is causing issue. In your case probably it is

html_dart2js;

It is defined at (C:\Users\91908\Downloads\ flutter_windows 3.3.9-stable\flutter\bin\cache lpkg \sky_engine\lib\html html_dart2js.dart) in your PC.