chore: Follow up pick files with file selector

This commit is contained in:
Krille 2024-10-04 10:04:09 +02:00
commit fe06f2efb3
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
8 changed files with 36 additions and 25 deletions

View file

@ -221,7 +221,10 @@ class EmotesSettingsController extends State<EmotesSettings> {
void imagePickerAction(
ValueNotifier<ImagePackImageContent?> controller,
) async {
final result = await selectFiles(context, extensions: imageExtensions);
final result = await selectFiles(
context,
type: FileSelectorType.images,
);
final pickedFile = result.firstOrNull;
if (pickedFile == null) return;
var file = MatrixImageFile(
@ -278,10 +281,7 @@ class EmotesSettingsController extends State<EmotesSettings> {
future: () async {
final result = await selectFiles(
context,
extensions: [
'zip',
// TODO: add further encoders
],
type: FileSelectorType.zip,
);
if (result.isEmpty) return null;