mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-08-23 05:56:20 +08:00
15 lines
280 B
Dart
15 lines
280 B
Dart
import 'package:image_picker/image_picker.dart';
|
|
import 'dart:io';
|
|
|
|
|
|
GetiImg(_image)async{
|
|
var pickedFile=await ImagePicker().getImage(source: ImageSource.gallery);
|
|
if(pickedFile!=null){
|
|
_image=File(pickedFile.path);
|
|
return _image;
|
|
}
|
|
else{
|
|
return null;
|
|
}
|
|
|
|
} |