flutter image_picker使用照相机

dependencies:
  image_picker: ^0.4.12+1
最新的^0.5+9编译无法通过
import 'dart:io';
import 'dart:async';
import 'package:image_picker/image_picker.dart';
 
 
List pages = List();
File _image;

Future getImage() async {
var image = await ImagePicker.pickImage(source: ImageSource.camera);

setState(() {
  _image = image;
  });
}
 

转载于:https://www.cnblogs.com/ckAng/p/10640969.html

你可能感兴趣的