Answers for "flutter upload image from camera"

4

flutter capture image from camera

import 'package:image_picker/image_picker.dart';

final _imagePicker = ImagePicker();
 
var _pickedFile = await _imagePicker.getImage(source: ImageSource.camera);
File _imageFilePicked = File(_pickedFile.path);
Posted by: Guest on March-29-2021
0

dart http image upload

var postUri = Uri.parse("apiUrl");

http.MultipartRequest request = new http.MultipartRequest("POST", postUri);

http.MultipartFile multipartFile = await http.MultipartFile.fromPath(
    'file', filePath); 

request.files.add(multipartFile);

http.StreamedResponse response = await request.send();


print(response.statusCode);
Posted by: Guest on July-03-2021

Code answers related to "flutter upload image from camera"

Code answers related to "Dart"

Browse Popular Code Answers by Language