From 42574583edf76709ba4bbd65ade95b87bd8d314d Mon Sep 17 00:00:00 2001 From: Pupsi28 Date: Tue, 2 Apr 2024 14:32:37 +0200 Subject: [PATCH] added unfocus when tapping on background image --- lib/view/pages/talk/chatView.dart | 57 +++++++++++++++++-------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/lib/view/pages/talk/chatView.dart b/lib/view/pages/talk/chatView.dart index 4931187..e57aa36 100644 --- a/lib/view/pages/talk/chatView.dart +++ b/lib/view/pages/talk/chatView.dart @@ -108,33 +108,38 @@ class _ChatViewState extends State { ), ), ), - body: Container( - decoration: BoxDecoration( - image: DecorationImage( - image: const AssetImage('assets/background/chat.png'), - scale: 1.5, - opacity: 1, - repeat: ImageRepeat.repeat, - invertColors: AppTheme.isDarkMode(context) - ) - ), - child: data.primaryLoading() ? const LoadingSpinner() : Column( - children: [ - Expanded( - child: ListView( - reverse: true, - controller: _listController, - children: messages.reversed.toList(), + body: GestureDetector( + onTap: () { + FocusScope.of(context).requestFocus(FocusNode()); + }, + child: Container( + decoration: BoxDecoration( + image: DecorationImage( + image: const AssetImage('assets/background/chat.png'), + scale: 1.5, + opacity: 1, + repeat: ImageRepeat.repeat, + invertColors: AppTheme.isDarkMode(context) + ) + ), + child: data.primaryLoading() ? const LoadingSpinner() : Column( + children: [ + Expanded( + child: ListView( + reverse: true, + controller: _listController, + children: messages.reversed.toList(), + ), ), - ), - Container( - color: Theme.of(context).colorScheme.background, - child: TalkNavigator.isSecondaryVisible(context) - ? ChatTextfield(widget.room.token) - : SafeArea(child: ChatTextfield(widget.room.token) - ), - ) - ], + Container( + color: Theme.of(context).colorScheme.background, + child: TalkNavigator.isSecondaryVisible(context) + ? ChatTextfield(widget.room.token) + : SafeArea(child: ChatTextfield(widget.room.token) + ), + ) + ], + ), ), ), );