Skip to content

Use ScrollViewKeyboardDismissBehavior.onDrag on both platforms #1093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,10 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
// TODO: Offer `ScrollViewKeyboardDismissBehavior.interactive` (or
// similar) if that is ever offered:
// https://github.com/flutter/flutter/issues/57609#issuecomment-1355340849
keyboardDismissBehavior: switch (Theme.of(context).platform) {
// This seems to offer the only built-in way to close the keyboard
// on iOS. It's not ideal; see TODO above.
TargetPlatform.iOS => ScrollViewKeyboardDismissBehavior.onDrag,
// The Android keyboard seems to have a built-in close button.
_ => ScrollViewKeyboardDismissBehavior.manual,
},
// This seems to offer the only built-in way to close the keyboard
// on iOS. It's not ideal; see TODO above.
// For Android also users gets ability to dismiss the keyboard by dragging the message list.
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,

controller: scrollController,
semanticChildCount: length + 2,
Expand Down