From ccfbe367d00eb1e13651a6a64e2fea4dc9810d2c Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 28 Apr 2022 14:53:29 +0200 Subject: [PATCH] update lists --- .../stream_chat_v1/lib/new_chat_screen.dart | 133 +++++++++--------- 1 file changed, 65 insertions(+), 68 deletions(-) diff --git a/packages/stream_chat_v1/lib/new_chat_screen.dart b/packages/stream_chat_v1/lib/new_chat_screen.dart index 1d57d29..f0ce098 100644 --- a/packages/stream_chat_v1/lib/new_chat_screen.dart +++ b/packages/stream_chat_v1/lib/new_chat_screen.dart @@ -308,77 +308,74 @@ class _NewChatScreenState extends State { ? GestureDetector( behavior: HitTestBehavior.opaque, onPanDown: (_) => FocusScope.of(context).unfocus(), - child: UsersBloc( - child: StreamUserListView( - controller: userListController, - // groupAlphabetically: - // _isSearchActive ? false : true, - onUserTap: (user) { - _controller.clear(); - if (!_selectedUsers.contains(user)) { - _chipInputTextFieldState - ?..addItem(user) - ..pauseItemAddition(); - } else { - _chipInputTextFieldState!.removeItem(user); - } - }, - itemBuilder: ( - context, - users, - index, - defaultWidget, - ) { - return defaultWidget.copyWith( - selected: - _selectedUsers.contains(users[index]), - ); - }, - emptyBuilder: (_) { - return LayoutBuilder( - builder: (context, viewportConstraints) { - return SingleChildScrollView( - physics: - AlwaysScrollableScrollPhysics(), - child: ConstrainedBox( - constraints: BoxConstraints( - minHeight: - viewportConstraints.maxHeight, - ), - child: Center( - child: Column( - children: [ - Padding( - padding: - const EdgeInsets.all(24), - child: StreamSvgIcon.search( - size: 96, - color: Colors.grey, - ), + child: StreamUserListView( + controller: userListController, + // groupAlphabetically: + // _isSearchActive ? false : true, + onUserTap: (user) { + _controller.clear(); + if (!_selectedUsers.contains(user)) { + _chipInputTextFieldState + ?..addItem(user) + ..pauseItemAddition(); + } else { + _chipInputTextFieldState!.removeItem(user); + } + }, + itemBuilder: ( + context, + users, + index, + defaultWidget, + ) { + return defaultWidget.copyWith( + selected: + _selectedUsers.contains(users[index]), + ); + }, + emptyBuilder: (_) { + return LayoutBuilder( + builder: (context, viewportConstraints) { + return SingleChildScrollView( + physics: AlwaysScrollableScrollPhysics(), + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: + viewportConstraints.maxHeight, + ), + child: Center( + child: Column( + children: [ + Padding( + padding: + const EdgeInsets.all(24), + child: StreamSvgIcon.search( + size: 96, + color: Colors.grey, ), - Text( - AppLocalizations.of(context) - .noUserMatchesTheseKeywords, - style: StreamChatTheme.of( - context) - .textTheme - .footnote - .copyWith( - color: StreamChatTheme - .of(context) - .colorTheme - .textHighEmphasis - .withOpacity(.5)), - ), - ], - ), + ), + Text( + AppLocalizations.of(context) + .noUserMatchesTheseKeywords, + style: StreamChatTheme.of( + context) + .textTheme + .footnote + .copyWith( + color: StreamChatTheme + .of(context) + .colorTheme + .textHighEmphasis + .withOpacity(.5)), + ), + ], ), ), - ); - }, - ); - }, - ), + ), + ); + }, + ); + }, ), ) : FutureBuilder(