Closed tudosxxx closed 1 year ago
Just tested it on android and it works fine. As argument to the filePath
you should give String(yourImage.path
), so code should look like this
`
ElevatedButton(
onPressed: () async {
var image = await ImagesPicker.pick(
count: 1,
pickType: PickType.image,
);
path = image?[0].path;
await appinioSocialShare.shareToTwitter(
'This is message',
filePath: path,
);
},
child: Text('Pick and Twit Image'),
),
`
NOTE: I'm using ImagesPicker
package, but it should work with ImagePicker
as well.
If the file field is added, an error will be reported
final ImagePicker picker = ImagePicker(); XFile? image = await picker.pickImage(source: ImageSource.gallery); if (image != null) { File file = File(image.path); appinioSocialShare.shareToTwitter('aaaaaaa').then((value) { print('===================$value'); });