launch method

  1. @override
Future<CommunicationResponse> launch([
  1. Email? input
])
override

Launches this app, and returns the appropriate launch response

Implementation

@override
Future<CommunicationResponse> launch([Email? input]) async {
  try {
    final result =
        await _channel.invokeMethod<String>('send', input!.toJson());
    return emailSendResult(result);
  } catch (e) {
    final error = e;
    if (error is PlatformException && error.code == 'not_available') {
      return CommunicationResponse.ofStatus(
          LaunchResult.unsupported, SendResult.failed);
    } else {
      return CommunicationResponse.failed(e);
    }
  }
}