mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-17 14:30:40 +01:00
feat: Dismiss keyboard on scroll in iOS
This commit is contained in:
parent
edf0d97c20
commit
6026c8976d
@ -268,6 +268,9 @@ class ChatView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
reverse: true,
|
reverse: true,
|
||||||
controller: controller.scrollController,
|
controller: controller.scrollController,
|
||||||
|
keyboardDismissBehavior: PlatformInfos.isIOS
|
||||||
|
? ScrollViewKeyboardDismissBehavior.onDrag
|
||||||
|
: ScrollViewKeyboardDismissBehavior.manual,
|
||||||
childrenDelegate: SliverChildBuilderDelegate(
|
childrenDelegate: SliverChildBuilderDelegate(
|
||||||
(BuildContext context, int i) {
|
(BuildContext context, int i) {
|
||||||
return i == controller.filteredEvents.length + 1
|
return i == controller.filteredEvents.length + 1
|
||||||
|
@ -9,6 +9,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||||
import 'package:vrouter/vrouter.dart';
|
import 'package:vrouter/vrouter.dart';
|
||||||
import '../../utils/localized_exception_extension.dart';
|
import '../../utils/localized_exception_extension.dart';
|
||||||
|
import '../../utils/platform_infos.dart';
|
||||||
import '../search.dart';
|
import '../search.dart';
|
||||||
|
|
||||||
class SearchView extends StatelessWidget {
|
class SearchView extends StatelessWidget {
|
||||||
@ -96,6 +97,9 @@ class SearchView extends StatelessWidget {
|
|||||||
body: TabBarView(
|
body: TabBarView(
|
||||||
children: [
|
children: [
|
||||||
ListView(
|
ListView(
|
||||||
|
keyboardDismissBehavior: PlatformInfos.isIOS
|
||||||
|
? ScrollViewKeyboardDismissBehavior.onDrag
|
||||||
|
: ScrollViewKeyboardDismissBehavior.manual,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 12),
|
SizedBox(height: 12),
|
||||||
ListTile(
|
ListTile(
|
||||||
@ -221,11 +225,17 @@ class SearchView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
ListView.builder(
|
ListView.builder(
|
||||||
|
keyboardDismissBehavior: PlatformInfos.isIOS
|
||||||
|
? ScrollViewKeyboardDismissBehavior.onDrag
|
||||||
|
: ScrollViewKeyboardDismissBehavior.manual,
|
||||||
itemCount: rooms.length,
|
itemCount: rooms.length,
|
||||||
itemBuilder: (_, i) => ChatListItem(rooms[i]),
|
itemBuilder: (_, i) => ChatListItem(rooms[i]),
|
||||||
),
|
),
|
||||||
controller.foundProfiles.isNotEmpty
|
controller.foundProfiles.isNotEmpty
|
||||||
? ListView.builder(
|
? ListView.builder(
|
||||||
|
keyboardDismissBehavior: PlatformInfos.isIOS
|
||||||
|
? ScrollViewKeyboardDismissBehavior.onDrag
|
||||||
|
: ScrollViewKeyboardDismissBehavior.manual,
|
||||||
itemCount: controller.foundProfiles.length,
|
itemCount: controller.foundProfiles.length,
|
||||||
itemBuilder: (BuildContext context, int i) {
|
itemBuilder: (BuildContext context, int i) {
|
||||||
final foundProfile = controller.foundProfiles[i];
|
final foundProfile = controller.foundProfiles[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user