openMailApp method

Future openMailApp()

Implementation

Future openMailApp() async {
  var result = await OpenMailApp.openMailApp();

  // If no mail apps found, show error
  if (!result.didOpen && !result.canOpen) {
    _dialogService.showDialog(BasicDialog(
        title: "No email apps found",
        description: "Please check your emails"));

    // iOS: if multiple mail apps found, show dialog to select.
    // There is no native intent/default app system in iOS so
    // you have to do it yourself.
  } else if (!result.didOpen && result.canOpen) {
    _dialogService.showDialog(EmailAppPickerDialog(result.options));
  }
}