Commit 62008733 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 @@ ...@@ -43,5 +43,7 @@
<false/> <false/>
<key>NSPhotoLibraryAddUsageDescription</key> <key>NSPhotoLibraryAddUsageDescription</key>
<string>App needs photo library permission for saving images</string> <string>App needs photo library permission for saving images</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
</dict> </dict>
</plist> </plist>
...@@ -39,7 +39,9 @@ class _MyAppState extends State<MyApp> { ...@@ -39,7 +39,9 @@ class _MyAppState extends State<MyApp> {
onPressed: () async { onPressed: () async {
File f = await ImagePicker.pickImage( File f = await ImagePicker.pickImage(
source: ImageSource.gallery); source: ImageSource.gallery);
ShareExtend.share(f.path, "image"); if (f != null) {
ShareExtend.share(f.path, "image");
}
}, },
child: new Text("share image"), child: new Text("share image"),
), ),
...@@ -47,7 +49,9 @@ class _MyAppState extends State<MyApp> { ...@@ -47,7 +49,9 @@ class _MyAppState extends State<MyApp> {
onPressed: () async { onPressed: () async {
File f = await ImagePicker.pickVideo( File f = await ImagePicker.pickVideo(
source: ImageSource.gallery); source: ImageSource.gallery);
ShareExtend.share(f.path, "video"); if (f != null) {
ShareExtend.share(f.path, "video");
}
}, },
child: new Text("share 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