mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 08:15:09 +00:00
enhanced send video functionality by adding toggle send original
This commit is contained in:
parent
a6b5acb451
commit
49caebcaa8
1 changed files with 33 additions and 1 deletions
|
@ -37,7 +37,7 @@ class SendFileDialogState extends State<SendFileDialog> {
|
||||||
await showFutureLoadingDialog(
|
await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () async {
|
future: () async {
|
||||||
file = await file.resizeVideo();
|
file = origImage ? file : await file.resizeVideo();
|
||||||
thumbnail = await file.getVideoThumbnail();
|
thumbnail = await file.getVideoThumbnail();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -126,6 +126,38 @@ class SendFileDialogState extends State<SendFileDialog> {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
} else if (widget.files.every((file) => file is MatrixVideoFile)) {
|
||||||
|
contentWidget = Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(fileName),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
// Workaround for SwitchListTile.adaptive crashes in CupertinoDialog
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
CupertinoSwitch(
|
||||||
|
value: origImage,
|
||||||
|
onChanged: (v) => setState(() => origImage = v),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
L10n.of(context)!.sendOriginal,
|
||||||
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Text(sizeString),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
contentWidget = Text('$fileName ($sizeString)');
|
contentWidget = Text('$fileName ($sizeString)');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue