capture_and_share

A Flutter plugin to take a screenshot using native code and share it via the platform's share image dialog. You can specify width, height and x, y position of the cropped screenshot. For now this plugin only works on ios.

Example

You can check example code in example folder.


import 'package:capture_and_share/capture_and_share.dart';

body: Center(
  child: RaisedButton(
    onPressed: () {
      CaptureAndShare.shareIt(
        sizeWidth: 300,
        sizeHeight: 300,
        xMode: 'center',
        yMode: 'center',
      );
    },
    child: Text('Click'),
  )

Usage

It's only works on IOS only for now. I will come back to implement Android code soon.

iOS

PropertyDescriptionType
sizeWidthdesired cropped area width. if set this to 0 means whole screen width. Default is 0.double
sizeHeightdesired cropped area height. if set this to 0 means whole screen height. Default is 0.double
xModeHorizontal cropped mode. You can choose left, center or right for xMode. Default is center.String
yModeVertical cropped mode. You can choose top, center or bottom for yMode. Default is center.String

Credits

thanks you screenshot_share_image (https://pub.dev/packages/screenshot_share_image) for inspiring me.

Libraries

capture_and_share