pickSingle method

Future<PickerValue> pickSingle({
  1. String? dialogTitle,
  2. PickerFileType type = PickerFileType.any,
})

Pick up a single file.

It is possible to specify the title of the file dialog to be picked up with dialogTitle.

You can restrict the type of file by specifying type.

単一のファイルをピックアップします。

dialogTitleでピックアップする際のファイルダイアログのタイトルを指定することが可能です。

typeを指定するとファイルの種類を制限することができます。

Implementation

Future<PickerValue> pickSingle({
  String? dialogTitle,
  PickerFileType type = PickerFileType.any,
}) async {
  try {
    _completer = Completer();
    final res = await adapter.pickSingle(
      dialogTitle: dialogTitle,
      type: type,
    );
    notifyListeners();
    _completer?.complete();
    _completer = null;
    return res;
  } catch (e) {
    _completer?.completeError(e);
    _completer = null;
    rethrow;
  } finally {
    _completer?.complete();
    _completer = null;
  }
}