|
|
@ -192,6 +192,9 @@ class SendFileDialogState extends State<SendFileDialog> {
|
|
|
|
sendStr = L10n.of(context).sendVideo;
|
|
|
|
sendStr = L10n.of(context).sendVideo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final compressionSupported =
|
|
|
|
|
|
|
|
uniqueFileType != 'video' || PlatformInfos.isMobile;
|
|
|
|
|
|
|
|
|
|
|
|
return FutureBuilder<String>(
|
|
|
|
return FutureBuilder<String>(
|
|
|
|
future: _calcCombinedFileSize(),
|
|
|
|
future: _calcCombinedFileSize(),
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
builder: (context, snapshot) {
|
|
|
@ -340,19 +343,17 @@ class SendFileDialogState extends State<SendFileDialog> {
|
|
|
|
if ({TargetPlatform.iOS, TargetPlatform.macOS}
|
|
|
|
if ({TargetPlatform.iOS, TargetPlatform.macOS}
|
|
|
|
.contains(theme.platform))
|
|
|
|
.contains(theme.platform))
|
|
|
|
CupertinoSwitch(
|
|
|
|
CupertinoSwitch(
|
|
|
|
value: compress,
|
|
|
|
value: compressionSupported && compress,
|
|
|
|
onChanged: uniqueFileType == 'video' &&
|
|
|
|
onChanged: compressionSupported
|
|
|
|
!PlatformInfos.isMobile
|
|
|
|
? (v) => setState(() => compress = v)
|
|
|
|
? null
|
|
|
|
: null,
|
|
|
|
: (v) => setState(() => compress = v),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
Switch.adaptive(
|
|
|
|
Switch.adaptive(
|
|
|
|
value: compress,
|
|
|
|
value: compressionSupported && compress,
|
|
|
|
onChanged: uniqueFileType == 'video' &&
|
|
|
|
onChanged: compressionSupported
|
|
|
|
!PlatformInfos.isMobile
|
|
|
|
? (v) => setState(() => compress = v)
|
|
|
|
? null
|
|
|
|
: null,
|
|
|
|
: (v) => setState(() => compress = v),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(width: 16),
|
|
|
|
const SizedBox(width: 16),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
@ -375,6 +376,11 @@ class SendFileDialogState extends State<SendFileDialog> {
|
|
|
|
' ($sizeString)',
|
|
|
|
' ($sizeString)',
|
|
|
|
style: theme.textTheme.labelSmall,
|
|
|
|
style: theme.textTheme.labelSmall,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
if (!compressionSupported)
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
L10n.of(context).notSupportedOnThisDevice,
|
|
|
|
|
|
|
|
style: theme.textTheme.labelSmall,
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|