how to convert pickedfile to file in flutter code example
Example 1: image picker
dependencies:
image_picker: ^0.6.7+12
Example 2: how to convert pickedfile to file in flutter
storedImage = File(imageFile.path); //imagefile is of type pickedfile /* imagefile = picker.getImage() */
//File is available after imporing dart:io library
//to use 'path' you might want to add 'path' plugin from pub.dev
Example 3: info: 'pickImage' is deprecated and shouldn't be used. Use imagePicker.getImage() method instead.. (deprecated_member_use at [totem_service_app] lib/ui_screens/Work Order Report Screen.dart:274)
Expanded( child: Container( decoration: BoxDecoration( image: DecorationImage( image: imageFile == null ? AssetImage('assets/illustrations/name_contact.png') : FileImage(File(imageFile.path)), fit: BoxFit.cover)), ),),