added unfocus when tapping outside textfield
This commit is contained in:
parent
42574583ed
commit
339d402422
@ -108,38 +108,33 @@ class _ChatViewState extends State<ChatView> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: GestureDetector(
|
body: Container(
|
||||||
onTap: () {
|
decoration: BoxDecoration(
|
||||||
FocusScope.of(context).requestFocus(FocusNode());
|
image: DecorationImage(
|
||||||
},
|
image: const AssetImage('assets/background/chat.png'),
|
||||||
child: Container(
|
scale: 1.5,
|
||||||
decoration: BoxDecoration(
|
opacity: 1,
|
||||||
image: DecorationImage(
|
repeat: ImageRepeat.repeat,
|
||||||
image: const AssetImage('assets/background/chat.png'),
|
invertColors: AppTheme.isDarkMode(context)
|
||||||
scale: 1.5,
|
)
|
||||||
opacity: 1,
|
),
|
||||||
repeat: ImageRepeat.repeat,
|
child: data.primaryLoading() ? const LoadingSpinner() : Column(
|
||||||
invertColors: AppTheme.isDarkMode(context)
|
children: [
|
||||||
)
|
Expanded(
|
||||||
),
|
child: ListView(
|
||||||
child: data.primaryLoading() ? const LoadingSpinner() : Column(
|
reverse: true,
|
||||||
children: [
|
controller: _listController,
|
||||||
Expanded(
|
children: messages.reversed.toList(),
|
||||||
child: ListView(
|
|
||||||
reverse: true,
|
|
||||||
controller: _listController,
|
|
||||||
children: messages.reversed.toList(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Container(
|
),
|
||||||
color: Theme.of(context).colorScheme.background,
|
Container(
|
||||||
child: TalkNavigator.isSecondaryVisible(context)
|
color: Theme.of(context).colorScheme.background,
|
||||||
? ChatTextfield(widget.room.token)
|
child: TalkNavigator.isSecondaryVisible(context)
|
||||||
: SafeArea(child: ChatTextfield(widget.room.token)
|
? ChatTextfield(widget.room.token)
|
||||||
),
|
: SafeArea(child: ChatTextfield(widget.room.token)
|
||||||
)
|
),
|
||||||
],
|
)
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -156,6 +156,9 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
|||||||
}
|
}
|
||||||
setDraft(text);
|
setDraft(text);
|
||||||
},
|
},
|
||||||
|
onTapOutside: (PointerDownEvent event) {
|
||||||
|
FocusScope.of(context).requestFocus(FocusNode());
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 15),
|
const SizedBox(width: 15),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user