setAs method

  1. @override
Future<bool> setAs(
  1. String uri,
  2. String mimeType, {
  3. String title = 'Set as',
})
override

This Method sends the selected Image's uri to the native thread. from the Flutter thread to send results to apps which can handle ACTION_ATTACH_DATA Intent of mimeType images/*.

Implementation

@override
Future<bool> setAs(String uri, String mimeType,
    {String title = 'Set as'}) async {
  try {
    final result =
        await methodChannel.invokeMethod('setAs', <String, dynamic>{
      'uri': uri,
      'mimeType': mimeType,
      'title': title,
    });
    if (result != null) return result as bool;
  } on PlatformException catch (e) {
    debugPrint(e.message);
  }
  return false;
}