mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-19 10:53:51 +02:00
fix: getting users
This commit is contained in:
parent
c2437fb3ce
commit
5d959184de
2 changed files with 14 additions and 13 deletions
|
@ -16,9 +16,9 @@ class UserModel {
|
|||
|
||||
factory UserModel.fromMap(String id, Map<String, dynamic> data) => UserModel(
|
||||
id: id,
|
||||
firstName: data["firstName"],
|
||||
lastName: data["lastName"],
|
||||
imageUrl: data["imageUrl"],
|
||||
firstName: data["first_name"],
|
||||
lastName: data["last_name"],
|
||||
imageUrl: data["image_url"],
|
||||
);
|
||||
|
||||
/// The user id
|
||||
|
|
|
@ -62,7 +62,8 @@ class _UserListState extends State<UserList> {
|
|||
Widget build(BuildContext context) {
|
||||
var theme = Theme.of(context);
|
||||
var translations = widget.options.translations;
|
||||
filteredUsers = users
|
||||
filteredUsers = widget.query.isNotEmpty
|
||||
? users
|
||||
.where(
|
||||
(user) =>
|
||||
user.fullname?.toLowerCase().contains(
|
||||
|
@ -70,7 +71,8 @@ class _UserListState extends State<UserList> {
|
|||
) ??
|
||||
false,
|
||||
)
|
||||
.toList();
|
||||
.toList()
|
||||
: users;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||
child: ListView.builder(
|
||||
|
@ -78,7 +80,6 @@ class _UserListState extends State<UserList> {
|
|||
itemBuilder: (context, index) {
|
||||
var user = filteredUsers[index];
|
||||
var isSelected = widget.selectedUsers.any((u) => u.id == user.id);
|
||||
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
if (widget.creatingGroup) {
|
||||
|
|
Loading…
Reference in a new issue