openWith method

  1. @override
Future<bool> openWith(
  1. String uri,
  2. String mimeType, {
  3. String title = 'Open With',
})
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_VIEW Intent of mimeType images/*.

Implementation

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