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(
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)
),
)
],
),
),
),
);