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

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
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x