“[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type ‘Future‘ is not a subtype of type ‘File?’ in type cast” Error

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Error:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Unexpected character (at character 1)
E/flutter ( 3050): <!DOCTYPE html>
E/flutter ( 3050): ^
E/flutter ( 3050):
E/flutter ( 3050): #0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
E/flutter ( 3050): #1      _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1250:9)
E/flutter ( 3050): #2      _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:915:22)
E/flutter ( 3050): #3      _parseJson (dart:convert-patch/convert_patch.dart:35:10)
E/flutter ( 3050): #4      JsonDecoder.convert (dart:convert/json.dart:612:36)
E/flutter ( 3050): #5      JsonCodec.decode (dart:convert/json.dart:216:41)
E/flutter ( 3050): #6      _MedicalRegistrationState.fetch_council
medical_registration_edit.dart:26
E/flutter ( 3050): <asynchronous suspension>
E/flutter ( 3050):


Solution:

change the code to this

Use await change code from

TO

Check documentation https://pub.dev/packages/image_picker

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x