Last updated:
0 purchases
native screenshot and share
Flutter Native Screenshot and share image #
Works both on Android & iOS.
Dependencies #
flutter_native_screenshot: ^1.1.2 from https://pub.dev/packages/flutter_native_screenshot.
share_plus: 4.5.0 from https://pub.dev/packages/share_plus.
path_provider: 2.0.5 from https://pub.dev/packages/path_provider.
permission_handler: 8.3.0 from https://pub.dev/packages/permission_handler.
How to Install #
Open the pubspec.yaml file and add the following lines of code inside your dependencies.
native_screenshot_and_share: ^<latest_version>
copied to clipboard
Note: Please replace <latest_version> with the value of the latest version of this plugin.
Android
For the Android platform, you must add the following permissions to the AndroidManifest.xml file.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
copied to clipboard
And don't forget to add the following properties to the tags application in the AndroidManifest.xml file.
android:requestLegacyExternalStorage="true"
copied to clipboard
iOS
For iOS platforms, you must add the following permissions to the Info.plist file.
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Take pretty screenshots and save it to the PhotoLibrary.</string>
copied to clipboard
How to use #
Import the package.
import 'package:native_screenshot_and_share/native_screenshot_and_share.dart';
copied to clipboard
Call the function that will take the screenshot and share it. This is usually in button press.
await Screenshot(context).shareScreenShot();
copied to clipboard
Usage Example #
For examples of usage, please see in the example project.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.