pickSingle method
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;
}
}