refactor: Switch to file_picker package and get rid of some dependency overrides
This commit is contained in:
parent
5606cb8252
commit
d9aa2f8e44
17 changed files with 175 additions and 212 deletions
|
|
@ -3,7 +3,8 @@ import 'dart:async';
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
||||
import 'package:file_picker_cross/file_picker_cross.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
|
@ -134,12 +135,15 @@ class SettingsController extends State<Settings> {
|
|||
name: result.path,
|
||||
);
|
||||
} else {
|
||||
final result =
|
||||
await FilePickerCross.importFromStorage(type: FileTypeCross.image);
|
||||
if (result.fileName == null) return;
|
||||
final result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.image,
|
||||
withData: true,
|
||||
);
|
||||
final pickedFile = result?.files.firstOrNull;
|
||||
if (pickedFile == null) return;
|
||||
file = MatrixFile(
|
||||
bytes: result.toUint8List(),
|
||||
name: result.fileName!,
|
||||
bytes: pickedFile.bytes!,
|
||||
name: pickedFile.name,
|
||||
);
|
||||
}
|
||||
final success = await showFutureLoadingDialog(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue