“[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!
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