mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-18 18:33:49 +02:00
fix: getting users
This commit is contained in:
parent
4ee5445809
commit
b6fc7b2cb0
1 changed files with 11 additions and 10 deletions
|
@ -62,7 +62,8 @@ class _UserListState extends State<UserList> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var theme = Theme.of(context);
|
var theme = Theme.of(context);
|
||||||
var translations = widget.options.translations;
|
var translations = widget.options.translations;
|
||||||
filteredUsers = users
|
filteredUsers = widget.query.isNotEmpty
|
||||||
|
? users
|
||||||
.where(
|
.where(
|
||||||
(user) =>
|
(user) =>
|
||||||
user.fullname?.toLowerCase().contains(
|
user.fullname?.toLowerCase().contains(
|
||||||
|
@ -70,7 +71,8 @@ class _UserListState extends State<UserList> {
|
||||||
) ??
|
) ??
|
||||||
false,
|
false,
|
||||||
)
|
)
|
||||||
.toList();
|
.toList()
|
||||||
|
: users;
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(top: 8, left: 12, right: 12, bottom: 80),
|
padding: const EdgeInsets.only(top: 8, left: 12, right: 12, bottom: 80),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
|
@ -78,7 +80,6 @@ class _UserListState extends State<UserList> {
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
var user = filteredUsers[index];
|
var user = filteredUsers[index];
|
||||||
var isSelected = widget.selectedUsers.any((u) => u.id == user.id);
|
var isSelected = widget.selectedUsers.any((u) => u.id == user.id);
|
||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (widget.creatingGroup) {
|
if (widget.creatingGroup) {
|
||||||
|
|
Loading…
Reference in a new issue