saveFileDialog method

Future<String?> saveFileDialog({
  1. required String content,
  2. String? startingFileName,
})

Open the Android save file dialog. content: The content of the file to save. (String) startingFileName: The name of the file to start with (null if no name should be set). (String?) Returns: The name of the saved file, or null if no file was selected. (String?)

Implementation

Future<String?> saveFileDialog({required String content, String? startingFileName}) async {
  const String __pigeon_channelName = 'dev.flutter.pigeon.open_save_file_dialogs.OpenSaveFileDialogs.saveFileDialog';
  final BasicMessageChannel<Object?> __pigeon_channel = BasicMessageChannel<Object?>(
    __pigeon_channelName,
    pigeonChannelCodec,
    binaryMessenger: __pigeon_binaryMessenger,
  );
  final List<Object?>? __pigeon_replyList =
      await __pigeon_channel.send(<Object?>[content, startingFileName]) as List<Object?>?;
  if (__pigeon_replyList == null) {
    throw _createConnectionError(__pigeon_channelName);
  } else if (__pigeon_replyList.length > 1) {
    throw PlatformException(
      code: __pigeon_replyList[0]! as String,
      message: __pigeon_replyList[1] as String?,
      details: __pigeon_replyList[2],
    );
  } else {
    return (__pigeon_replyList[0] as String?);
  }
}