refactor: Use image package to resize images
This commit is contained in:
parent
c5f084db87
commit
b44f309151
8 changed files with 61 additions and 145 deletions
|
|
@ -79,12 +79,11 @@ class SettingsController extends State<Settings> {
|
|||
MatrixFile file;
|
||||
if (PlatformInfos.isMobile) {
|
||||
final result = await ImagePicker().pickImage(
|
||||
source: action == AvatarAction.camera
|
||||
? ImageSource.camera
|
||||
: ImageSource.gallery,
|
||||
imageQuality: 50,
|
||||
maxWidth: 1600,
|
||||
maxHeight: 1600);
|
||||
source: action == AvatarAction.camera
|
||||
? ImageSource.camera
|
||||
: ImageSource.gallery,
|
||||
imageQuality: 50,
|
||||
);
|
||||
if (result == null) return;
|
||||
file = MatrixFile(
|
||||
bytes: await result.readAsBytes(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue