🐛 Bug fixes on attachments and related things

This commit is contained in:
LittleSheep 2024-09-17 20:59:01 +08:00
parent 358677ade0
commit dec34e297d
3 changed files with 17 additions and 10 deletions

View File

@ -233,6 +233,7 @@ class _AttachmentItemVideoState extends State<_AttachmentItemVideo> {
final ratio = widget.item.metadata?['ratio'] ?? 16 / 9;
if (!_showContent) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
child: Stack(
children: [
if (widget.item.metadata?['thumbnail'] != null)
@ -400,6 +401,7 @@ class _AttachmentItemAudioState extends State<_AttachmentItemAudio> {
const ratio = 16 / 9;
if (!_showContent) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
child: Stack(
children: [
if (widget.item.metadata?['thumbnail'] != null)

View File

@ -10,6 +10,7 @@ class AutoCacheImage extends StatelessWidget {
final BoxFit? fit;
final bool noProgressIndicator;
final bool noErrorWidget;
final bool isDense;
const AutoCacheImage(
this.url, {
@ -19,6 +20,7 @@ class AutoCacheImage extends StatelessWidget {
this.fit,
this.noProgressIndicator = false,
this.noErrorWidget = false,
this.isDense = false,
});
@override
@ -46,9 +48,10 @@ class AutoCacheImage extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.close, size: 32)
Icon(Icons.close, size: isDense ? 24 : 32)
.animate(onPlay: (e) => e.repeat(reverse: true))
.fade(duration: 500.ms),
if (!isDense)
Text(
error.toString(),
textAlign: TextAlign.center,
@ -89,9 +92,10 @@ class AutoCacheImage extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.close, size: 32)
Icon(Icons.close, size: isDense ? 24 : 32)
.animate(onPlay: (e) => e.repeat(reverse: true))
.fade(duration: 500.ms),
if (!isDense)
Text(
error.toString(),
textAlign: TextAlign.center,

View File

@ -415,6 +415,7 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
x.imageUrl,
width: 28,
height: 28,
isDense: true,
),
display: x.name,
content: x.textWarpedPlaceholder,