tguizelini / flutter-camera

A Flutter example using Camera and Gallery to pick images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependencies

  • Add to pubspec.yaml the dependencies below, afeter "cupertino_icons":
path_provider: ^1.3.0
image_picker: ^0.6.1+4

Setup the iOS configuration to use Camera permission

  • Open the file Info.plist file, located in /ios/Runner/Info.plist, and include:
<key>NSPhotoLibraryUsageDescription</key>
<string>Message asking permission</string>

<key>NSCameraUsageDescription</key>
<string>Message asking permission</string>

<key>NSMicrophoneUsageDescription</key>
<string>Message asking permission</string>

How to use ?

The return default type is base64, but you can change the flag "getBase64" to false if you preferer the "File" type.

1 - Future<dynamic> openCamera: 
Open the Camera and return the image 

2 - Future<dynamic> openGallery: 
Open the Gallery and return the image 

About

A Flutter example using Camera and Gallery to pick images


Languages

Language:Dart 56.1%Language:Ruby 33.6%Language:Swift 5.3%Language:Kotlin 4.5%Language:Objective-C 0.5%