💄 Optimize attachment editor controls
This commit is contained in:
parent
bbee825cf4
commit
fdc68fc5e1
@ -459,5 +459,5 @@
|
|||||||
"friendAdd": "添加好友",
|
"friendAdd": "添加好友",
|
||||||
"blockUser": "屏蔽用户",
|
"blockUser": "屏蔽用户",
|
||||||
"unblockUser": "解除屏蔽用户",
|
"unblockUser": "解除屏蔽用户",
|
||||||
"learMoreAboutPerson": "了解关于 TA 的更多"
|
"learnMoreAboutPerson": "了解关于 TA 的更多"
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class Attachment {
|
|||||||
String alt;
|
String alt;
|
||||||
String mimetype;
|
String mimetype;
|
||||||
String hash;
|
String hash;
|
||||||
String destination;
|
int destination;
|
||||||
bool isAnalyzed;
|
bool isAnalyzed;
|
||||||
bool isUploaded;
|
bool isUploaded;
|
||||||
Map<String, dynamic>? metadata;
|
Map<String, dynamic>? metadata;
|
||||||
|
@ -36,7 +36,7 @@ Attachment _$AttachmentFromJson(Map<String, dynamic> json) => Attachment(
|
|||||||
alt: json['alt'] as String,
|
alt: json['alt'] as String,
|
||||||
mimetype: json['mimetype'] as String,
|
mimetype: json['mimetype'] as String,
|
||||||
hash: json['hash'] as String,
|
hash: json['hash'] as String,
|
||||||
destination: json['destination'] as String,
|
destination: (json['destination'] as num).toInt(),
|
||||||
isAnalyzed: json['is_analyzed'] as bool,
|
isAnalyzed: json['is_analyzed'] as bool,
|
||||||
isUploaded: json['is_uploaded'] as bool,
|
isUploaded: json['is_uploaded'] as bool,
|
||||||
metadata: json['metadata'] as Map<String, dynamic>?,
|
metadata: json['metadata'] as Map<String, dynamic>?,
|
||||||
|
@ -744,8 +744,8 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
|
|||||||
return IgnorePointer(
|
return IgnorePointer(
|
||||||
ignoring: _uploadController.isUploading.value,
|
ignoring: _uploadController.isUploading.value,
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 64,
|
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
top: BorderSide(
|
top: BorderSide(
|
||||||
@ -754,11 +754,9 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: SingleChildScrollView(
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 0,
|
runSpacing: 8,
|
||||||
alignment: WrapAlignment.center,
|
alignment: WrapAlignment.center,
|
||||||
runAlignment: WrapAlignment.center,
|
runAlignment: WrapAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -766,55 +764,62 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
|
|||||||
PlatformInfo.isIOS ||
|
PlatformInfo.isIOS ||
|
||||||
PlatformInfo.isWeb) &&
|
PlatformInfo.isWeb) &&
|
||||||
!widget.imageOnly)
|
!widget.imageOnly)
|
||||||
ElevatedButton.icon(
|
IconButton(
|
||||||
icon: const Icon(Icons.paste),
|
icon: const Icon(Icons.paste),
|
||||||
label: Text('attachmentAddClipboard'.tr),
|
tooltip: 'attachmentAddClipboard'.tr,
|
||||||
style: const ButtonStyle(visualDensity: density),
|
style: const ButtonStyle(visualDensity: density),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
onPressed: () => _pasteFileToUpload(),
|
onPressed: () => _pasteFileToUpload(),
|
||||||
),
|
),
|
||||||
ElevatedButton.icon(
|
IconButton(
|
||||||
icon: const Icon(Icons.add_photo_alternate),
|
icon: const Icon(Icons.add_photo_alternate),
|
||||||
label: Text('attachmentAddGalleryPhoto'.tr),
|
tooltip: 'attachmentAddGalleryPhoto'.tr,
|
||||||
style: const ButtonStyle(visualDensity: density),
|
style: const ButtonStyle(visualDensity: density),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
onPressed: () => _pickPhotoToUpload(),
|
onPressed: () => _pickPhotoToUpload(),
|
||||||
),
|
),
|
||||||
if (!widget.imageOnly)
|
if (!widget.imageOnly)
|
||||||
ElevatedButton.icon(
|
IconButton(
|
||||||
icon: const Icon(Icons.add_road),
|
icon: const Icon(Icons.add_road),
|
||||||
label: Text('attachmentAddGalleryVideo'.tr),
|
tooltip: 'attachmentAddGalleryVideo'.tr,
|
||||||
style: const ButtonStyle(visualDensity: density),
|
style: const ButtonStyle(visualDensity: density),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
onPressed: () => _pickVideoToUpload(),
|
onPressed: () => _pickVideoToUpload(),
|
||||||
),
|
),
|
||||||
ElevatedButton.icon(
|
if (PlatformInfo.isMobile)
|
||||||
|
IconButton(
|
||||||
icon: const Icon(Icons.photo_camera_back),
|
icon: const Icon(Icons.photo_camera_back),
|
||||||
label: Text('attachmentAddCameraPhoto'.tr),
|
tooltip: 'attachmentAddCameraPhoto'.tr,
|
||||||
style: const ButtonStyle(visualDensity: density),
|
style: const ButtonStyle(visualDensity: density),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
onPressed: () => _takeMediaToUpload(false),
|
onPressed: () => _takeMediaToUpload(false),
|
||||||
),
|
),
|
||||||
if (!widget.imageOnly)
|
if (!widget.imageOnly && PlatformInfo.isMobile)
|
||||||
ElevatedButton.icon(
|
IconButton(
|
||||||
icon: const Icon(Icons.video_camera_back_outlined),
|
icon: const Icon(Icons.video_camera_back_outlined),
|
||||||
label: Text('attachmentAddCameraVideo'.tr),
|
tooltip: 'attachmentAddCameraVideo'.tr,
|
||||||
style: const ButtonStyle(visualDensity: density),
|
style: const ButtonStyle(visualDensity: density),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
onPressed: () => _takeMediaToUpload(true),
|
onPressed: () => _takeMediaToUpload(true),
|
||||||
),
|
),
|
||||||
if (!widget.imageOnly)
|
if (!widget.imageOnly)
|
||||||
ElevatedButton.icon(
|
IconButton(
|
||||||
icon: const Icon(Icons.file_present_rounded),
|
icon: const Icon(Icons.file_present_rounded),
|
||||||
label: Text('attachmentAddFile'.tr),
|
tooltip: 'attachmentAddFile'.tr,
|
||||||
style: const ButtonStyle(visualDensity: density),
|
style: const ButtonStyle(visualDensity: density),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
onPressed: () => _pickFileToUpload(),
|
onPressed: () => _pickFileToUpload(),
|
||||||
),
|
),
|
||||||
if (!widget.imageOnly)
|
if (!widget.imageOnly)
|
||||||
ElevatedButton.icon(
|
IconButton(
|
||||||
icon: const Icon(Icons.link),
|
icon: const Icon(Icons.link),
|
||||||
label: Text('attachmentAddFile'.tr),
|
tooltip: 'attachmentAddLink'.tr,
|
||||||
style: const ButtonStyle(visualDensity: density),
|
style: const ButtonStyle(visualDensity: density),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
onPressed: () => _linkAttachments(),
|
onPressed: () => _linkAttachments(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
).paddingSymmetric(horizontal: 12),
|
).paddingSymmetric(horizontal: 12),
|
||||||
),
|
|
||||||
)
|
)
|
||||||
.animate(
|
.animate(
|
||||||
target: _uploadController.isUploading.value ? 0 : 1,
|
target: _uploadController.isUploading.value ? 0 : 1,
|
||||||
|
@ -2,7 +2,7 @@ name: solian
|
|||||||
description: "The Solar Network App"
|
description: "The Solar Network App"
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
|
|
||||||
version: 1.2.4+1
|
version: 1.2.4+2
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.3.4 <4.0.0"
|
sdk: ">=3.3.4 <4.0.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user