chore: Follow up send file dialog
This commit is contained in:
parent
6c54e552dc
commit
9fab7630a3
2 changed files with 31 additions and 12 deletions
|
|
@ -2806,5 +2806,5 @@
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"version": "Version",
|
"version": "Version",
|
||||||
"website": "Website",
|
"website": "Website",
|
||||||
"compressBeforeSending": "Compress before sending"
|
"sendUncompressed": "Send uncompressed"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ class SendFileDialogState extends State<SendFileDialog> {
|
||||||
|
|
||||||
var sendStr = L10n.of(context).sendFile;
|
var sendStr = L10n.of(context).sendFile;
|
||||||
final uniqueMimeType = widget.files
|
final uniqueMimeType = widget.files
|
||||||
.map((file) => file.mimeType ?? lookupMimeType(file.path))
|
.map((file) => file.mimeType ?? lookupMimeType(file.name))
|
||||||
.toSet()
|
.toSet()
|
||||||
.singleOrNull;
|
.singleOrNull;
|
||||||
|
|
||||||
|
|
@ -250,23 +250,42 @@ class SendFileDialogState extends State<SendFileDialog> {
|
||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
CupertinoSwitch(
|
if ({TargetPlatform.iOS, TargetPlatform.macOS}
|
||||||
value: compress,
|
.contains(theme.platform))
|
||||||
onChanged: uniqueMimeType.startsWith('video') &&
|
CupertinoSwitch(
|
||||||
!PlatformInfos.isMobile
|
value: !compress,
|
||||||
? null
|
onChanged: uniqueMimeType.startsWith('video') &&
|
||||||
: (v) => setState(() => compress = v),
|
!PlatformInfos.isMobile
|
||||||
),
|
? null
|
||||||
|
: (v) => setState(() => compress = !v),
|
||||||
|
)
|
||||||
|
else
|
||||||
|
Switch.adaptive(
|
||||||
|
value: !compress,
|
||||||
|
onChanged: uniqueMimeType.startsWith('video') &&
|
||||||
|
!PlatformInfos.isMobile
|
||||||
|
? null
|
||||||
|
: (v) => setState(() => compress = !v),
|
||||||
|
),
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
L10n.of(context).sendUncompressed,
|
||||||
|
style: theme.textTheme.titleMedium,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
L10n.of(context).compressBeforeSending,
|
' ($sizeString)',
|
||||||
style: theme.textTheme.labelMedium,
|
style: theme.textTheme.labelSmall,
|
||||||
textAlign: TextAlign.left,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue