skip to Main Content

enter image description here

while Image picker, I couldn’t solve this error.

2

Answers


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

    C:Users91908Downloads flutter_windows 3.3.9-stableflutterbincache lpkg sky_enginelibhtml html_dart2js.dart
    C: Users91908Downloadsflutter windows_3.3.9-stableflutterbin|cachepkgsky_engine Vibiofile.dart
    

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

    Login or Signup to reply.
  2. 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: Users91908Downloadsflutter windows_3.3.9-stableflutterbin|cachepkgsky_engine Vibiofile.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:Users91908Downloads flutter_windows 3.3.9-stableflutterbincache lpkg sky_enginelibhtml html_dart2js.dart) in your PC.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search