Easily share content like text, image or any file to other apps.
Both Android and iOS platforms are supported, no additional changes are required in native code or projects. Except, the Specific permissions (like Storage Access permission), you'll need to add that in your project manually.
Visit https://pub.dev/packages/flutter_share_plugin#-installing-tab-
import 'package:flutter_share_plugin/flutter_share_plugin.dart';
That's it. Now, you are ready to go.
String text = "Check out this plugin: https://pub.dev/packages/flutter_share_plugin ";
FlutterShare.shareText(text);
String filePath = bohemianRhapsodySong.absolute.path;
// pass the string as `filePath` parameter
FlutterShare.shareFile(filePath: filePath);
Uint8List bytes = bohemianRhapsodySong.readAsBytes();
// pass the Uint8List data as `bytes` parameter
FlutterShare.shareFile(bytes: bytes);
// use preferred method here to get URI string of the file
String uri = screenshot.absolute.path;
String text = "Transaction Screenshot";
FlutterShare.shareFileWithText(
textContent: text, filePath: uri);
// use preferred method here to get bytes of the files
Uint8List bytes = screenshot.readAsBytes();
String text = "Transaction Screenshot";
FlutterShare.shareFileWithText(
textContent: text, bytes: bytes);