I am wondering how to share a file in a flutter app?
I saw some old references to using Intents with mojo, but that no longer seems to be present. This seems like a sta
You can use the EsysFlutterShare Plugin. In version 1.0.0 you can share any file you like and its working on both, iOS and Android.
Just put that in yout pubspec.yaml:
dependencies:
esys_flutter_share: ^1.0.0
Import the lib:
import 'package:esys_flutter_share/esys_flutter_share.dart';
Share a file:
final ByteData bytes = await rootBundle.load('assets/image1.png');
await Share.file('esys image', 'esys.png', bytes.buffer.asUint8List(), 'image/png');
You need to privide a title, a file name, the file-bytes and a mime type.