diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 5e46c9bd0..08a23cdb9 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -3204,5 +3204,6 @@ "verifiedDevicesOnly": "Verified devices only", "takeAPhoto": "Take a photo", "recordAVideo": "Record a video", - "optionalMessage": "(Optional) message..." + "optionalMessage": "(Optional) message...", + "notSupportedOnThisDevice": "Not supported on this device" } diff --git a/lib/pages/chat/send_file_dialog.dart b/lib/pages/chat/send_file_dialog.dart index 96af1d2b4..cba1d7970 100644 --- a/lib/pages/chat/send_file_dialog.dart +++ b/lib/pages/chat/send_file_dialog.dart @@ -192,6 +192,9 @@ class SendFileDialogState extends State { sendStr = L10n.of(context).sendVideo; } + final compressionSupported = + uniqueFileType != 'video' || PlatformInfos.isMobile; + return FutureBuilder( future: _calcCombinedFileSize(), builder: (context, snapshot) { @@ -340,19 +343,17 @@ class SendFileDialogState extends State { if ({TargetPlatform.iOS, TargetPlatform.macOS} .contains(theme.platform)) CupertinoSwitch( - value: compress, - onChanged: uniqueFileType == 'video' && - !PlatformInfos.isMobile - ? null - : (v) => setState(() => compress = v), + value: compressionSupported && compress, + onChanged: compressionSupported + ? (v) => setState(() => compress = v) + : null, ) else Switch.adaptive( - value: compress, - onChanged: uniqueFileType == 'video' && - !PlatformInfos.isMobile - ? null - : (v) => setState(() => compress = v), + value: compressionSupported && compress, + onChanged: compressionSupported + ? (v) => setState(() => compress = v) + : null, ), const SizedBox(width: 16), Expanded( @@ -375,6 +376,11 @@ class SendFileDialogState extends State { ' ($sizeString)', style: theme.textTheme.labelSmall, ), + if (!compressionSupported) + Text( + L10n.of(context).notSupportedOnThisDevice, + style: theme.textTheme.labelSmall, + ), ], ), ),