pickApp method

  1. @override
Future<MailApp?> pickApp({
  1. String? title,
  2. String? cancelLabel,
  3. String? emptyMessage,
  4. String? okLabel,
  5. String? otherAppsLabel,
  6. bool showEmptyAlert = true,
  7. bool showOtherApps = true,
})
override

Shows the OS dialog listing installed mail apps and returns the pick, or null when dismissed or when nothing is installed.

Implementation

@override
Future<MailApp?> pickApp({
  String? title,
  String? cancelLabel,
  String? emptyMessage,
  String? okLabel,
  String? otherAppsLabel,
  bool showEmptyAlert = true,
  bool showOtherApps = true,
}) async {
  final picked = await methodChannel.invokeMapMethod<Object?, Object?>(
    'pickApp',
    {
      'title': title,
      'cancelLabel': cancelLabel,
      'emptyMessage': emptyMessage,
      'okLabel': okLabel,
      'otherAppsLabel': otherAppsLabel,
      'showEmptyAlert': showEmptyAlert,
      'showOtherApps': showOtherApps,
    },
  );

  return picked == null ? null : MailApp.fromMap(picked);
}