getFiles method
Injects a file input with the specified accept+capture attributes, and returns a list of XFile that the user selected locally.
capture
is only supported in mobile browsers.
multiple
can be passed to allow for multiple selection of files. Defaults
to false.
Implementation
@visibleForTesting
Future<List<XFile>> getFiles({
String? accept,
String? capture,
bool multiple = false,
}) {
html.FileUploadInputElement input = createInputElement(
accept,
capture,
multiple: multiple,
) as html.FileUploadInputElement;
_injectAndActivate(input);
return _getSelectedXFiles(input);
}