added unfocus when tapping on background image

This commit is contained in:
Lars Neuhaus 2024-04-02 14:32:37 +02:00
parent 1b407562df
commit 42574583ed

View File

@ -108,33 +108,38 @@ class _ChatViewState extends State<ChatView> {
), ),
), ),
), ),
body: Container( body: GestureDetector(
decoration: BoxDecoration( onTap: () {
image: DecorationImage( FocusScope.of(context).requestFocus(FocusNode());
image: const AssetImage('assets/background/chat.png'), },
scale: 1.5, child: Container(
opacity: 1, decoration: BoxDecoration(
repeat: ImageRepeat.repeat, image: DecorationImage(
invertColors: AppTheme.isDarkMode(context) image: const AssetImage('assets/background/chat.png'),
) scale: 1.5,
), opacity: 1,
child: data.primaryLoading() ? const LoadingSpinner() : Column( repeat: ImageRepeat.repeat,
children: [ invertColors: AppTheme.isDarkMode(context)
Expanded( )
child: ListView( ),
reverse: true, child: data.primaryLoading() ? const LoadingSpinner() : Column(
controller: _listController, children: [
children: messages.reversed.toList(), Expanded(
child: ListView(
reverse: true,
controller: _listController,
children: messages.reversed.toList(),
),
), ),
), Container(
Container( color: Theme.of(context).colorScheme.background,
color: Theme.of(context).colorScheme.background, child: TalkNavigator.isSecondaryVisible(context)
child: TalkNavigator.isSecondaryVisible(context) ? ChatTextfield(widget.room.token)
? ChatTextfield(widget.room.token) : SafeArea(child: ChatTextfield(widget.room.token)
: SafeArea(child: ChatTextfield(widget.room.token) ),
), )
) ],
], ),
), ),
), ),
); );