refactor: Use image package to resize images

This commit is contained in:
Krille Fear 2021-11-20 16:54:18 +01:00
commit b44f309151
8 changed files with 61 additions and 145 deletions

View file

@ -297,12 +297,11 @@ class ChatDetailsController extends State<ChatDetails> {
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(),