refactor: Magic numbers

This commit is contained in:
Krille Fear 2021-10-26 18:47:05 +02:00
commit f114d545f7
8 changed files with 63 additions and 54 deletions

View file

@ -24,11 +24,13 @@ class SendFileDialog extends StatefulWidget {
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: 1600);
file = await resizeImage(file, max: maxWidth);
} catch (e) {
// couldn't resize
}