From 09e09b961384e8634f233836d4ce728d26012773 Mon Sep 17 00:00:00 2001 From: otsmr Date: Thu, 17 Jul 2025 20:22:16 +0200 Subject: [PATCH] fix #237 --- lib/src/views/chats/media_viewer.view.dart | 40 ++++++++++++---------- lib/src/views/components/better_text.dart | 1 - 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/lib/src/views/chats/media_viewer.view.dart b/lib/src/views/chats/media_viewer.view.dart index 8931a18..4fa1811 100644 --- a/lib/src/views/chats/media_viewer.view.dart +++ b/lib/src/views/chats/media_viewer.view.dart @@ -117,6 +117,8 @@ class _MediaViewerViewState extends State { setState(() {}); if (firstRun) { loadCurrentMediaFile(); + // ignore: parameter_assignments + firstRun = false; } }); } @@ -585,26 +587,28 @@ class _MediaViewerViewState extends State { ], ), ), - if (showSendTextMessageInput) - Positioned( - top: 20, - left: 0, - right: 0, - child: Text( - getContactDisplayName(widget.contact), - textAlign: TextAlign.center, - style: const TextStyle( - fontSize: 24, - fontWeight: FontWeight.bold, - shadows: [ - Shadow( - color: Color.fromARGB(122, 0, 0, 0), - blurRadius: 5, - ) - ], - ), + Positioned( + top: 10, + left: showSendTextMessageInput ? 0 : null, + right: showSendTextMessageInput ? 0 : 15, + child: Text( + getContactDisplayName(widget.contact), + textAlign: TextAlign.center, + style: TextStyle( + fontSize: showSendTextMessageInput ? 24 : 14, + fontWeight: FontWeight.bold, + color: showSendTextMessageInput + ? null + : const Color.fromARGB(255, 126, 126, 126), + shadows: const [ + Shadow( + color: Color.fromARGB(122, 0, 0, 0), + blurRadius: 5, + ) + ], ), ), + ), if (showSendTextMessageInput) Positioned( bottom: 0, diff --git a/lib/src/views/components/better_text.dart b/lib/src/views/components/better_text.dart index e522d71..9841e2d 100644 --- a/lib/src/views/components/better_text.dart +++ b/lib/src/views/components/better_text.dart @@ -2,7 +2,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:twonly/src/utils/log.dart'; -import 'package:twonly/src/utils/misc.dart'; import 'package:url_launcher/url_launcher.dart'; class BetterText extends StatelessWidget {