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
|
|
@ -26,12 +26,11 @@ class _SendFileDialogState extends State<SendFileDialog> {
|
|||
bool origImage = false;
|
||||
bool _isSending = false;
|
||||
|
||||
static const maxWidth = 1600;
|
||||
Future<void> _send() async {
|
||||
var file = widget.file;
|
||||
if (file is MatrixImageFile && !origImage) {
|
||||
try {
|
||||
file = await resizeImage(file, max: maxWidth);
|
||||
file = await file.resizeImage();
|
||||
} catch (e) {
|
||||
// couldn't resize
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue