Commit 67f7ba7f authored by zhouteng's avatar zhouteng

update the example and add NSPhotoLibraryUsageDescription for image picker plugin to info.plist

parent eb5c7500
......@@ -43,5 +43,7 @@
<false/>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>App needs photo library permission for saving images</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
</dict>
</plist>
......@@ -39,7 +39,9 @@ class _MyAppState extends State<MyApp> {
onPressed: () async {
File f = await ImagePicker.pickImage(
source: ImageSource.gallery);
ShareExtend.share(f.path, "image");
if (f != null) {
ShareExtend.share(f.path, "image");
}
},
child: new Text("share image"),
),
......@@ -47,7 +49,9 @@ class _MyAppState extends State<MyApp> {
onPressed: () async {
File f = await ImagePicker.pickVideo(
source: ImageSource.gallery);
ShareExtend.share(f.path, "video");
if (f != null) {
ShareExtend.share(f.path, "video");
}
},
child: new Text("share video"),
),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment