mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 04:59:26 +01:00
chore: Fix keyboard
This commit is contained in:
parent
c94db72041
commit
ffe387a7e2
@ -428,16 +428,19 @@ class ChatController extends State<Chat> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void emojiPickerAction() {
|
void emojiPickerAction() {
|
||||||
|
if (showEmojiPicker) {
|
||||||
|
inputFocus.requestFocus();
|
||||||
|
} else {
|
||||||
|
inputFocus.unfocus();
|
||||||
|
}
|
||||||
emojiPickerType = EmojiPickerType.keyboard;
|
emojiPickerType = EmojiPickerType.keyboard;
|
||||||
setState(() => showEmojiPicker = !showEmojiPicker);
|
setState(() => showEmojiPicker = !showEmojiPicker);
|
||||||
_inputFocusListener();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _inputFocusListener() {
|
void _inputFocusListener() {
|
||||||
if (showEmojiPicker) {
|
if (showEmojiPicker && inputFocus.hasFocus) {
|
||||||
inputFocus.unfocus();
|
emojiPickerType = EmojiPickerType.keyboard;
|
||||||
} else {
|
setState(() => showEmojiPicker = false);
|
||||||
inputFocus.requestFocus();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ class InputBar extends StatelessWidget {
|
|||||||
final InputDecoration? decoration;
|
final InputDecoration? decoration;
|
||||||
final ValueChanged<String>? onChanged;
|
final ValueChanged<String>? onChanged;
|
||||||
final bool? autofocus;
|
final bool? autofocus;
|
||||||
|
final bool readOnly;
|
||||||
|
|
||||||
const InputBar({
|
const InputBar({
|
||||||
required this.room,
|
required this.room,
|
||||||
@ -38,6 +39,7 @@ class InputBar extends StatelessWidget {
|
|||||||
this.onChanged,
|
this.onChanged,
|
||||||
this.autofocus,
|
this.autofocus,
|
||||||
this.textInputAction,
|
this.textInputAction,
|
||||||
|
this.readOnly = false,
|
||||||
Key? key,
|
Key? key,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@ -374,6 +376,7 @@ class InputBar extends StatelessWidget {
|
|||||||
hideOnEmpty: true,
|
hideOnEmpty: true,
|
||||||
hideOnLoading: true,
|
hideOnLoading: true,
|
||||||
keepSuggestionsOnSuggestionSelected: true,
|
keepSuggestionsOnSuggestionSelected: true,
|
||||||
|
|
||||||
debounceDuration: const Duration(
|
debounceDuration: const Duration(
|
||||||
milliseconds:
|
milliseconds:
|
||||||
50), // show suggestions after 50ms idle time (default is 300)
|
50), // show suggestions after 50ms idle time (default is 300)
|
||||||
@ -388,7 +391,6 @@ class InputBar extends StatelessWidget {
|
|||||||
// it sets the types for the callback incorrectly
|
// it sets the types for the callback incorrectly
|
||||||
onSubmitted!(text);
|
onSubmitted!(text);
|
||||||
},
|
},
|
||||||
//focusNode: focusNode,
|
|
||||||
controller: controller,
|
controller: controller,
|
||||||
decoration: decoration!,
|
decoration: decoration!,
|
||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
|
Loading…
Reference in New Issue
Block a user