title: How to build a search bar in a list flutter?
body: <p>i'm a beginner in flutter and i need your help.
  i want to create a search bar with the name of the users but i don't really know how to do it.
  The goal is that a user can search other users name in this search bar.</p>
  <p>please help me
  here is my code</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:app/models/user.dart';
  import 'package:provider/provider.dart';
  import 'package:app/models/chatparams.dart';
  
  
  class UserList extends StatefulWidget {
    @override
    _UserListState createState() =&gt; _UserListState();
  }
  
  class _UserListState extends State&lt;UserList&gt; {
  
    @override
    Widget build(BuildContext context) {
      final users = Provider.of&lt;List&lt;AppUserData&gt;&gt;(context);
      return ListView.builder(
          itemCount: users.length ,
          itemBuilder: (context, index) {
            return UserTile(users[index ]);
        
          });
        
  
  }
  }
  
  
  
  class UserTile extends StatelessWidget {
    final AppUserData user;
  
    UserTile(this.user);
  
    @override
    Widget build(BuildContext context) {
      final currentUser = Provider.of&lt;AppUser?&gt;(context);
      if (currentUser == null) throw Exception(&quot;current user not found&quot;);
  
      return GestureDetector(
        onTap: () {
          if (currentUser.uid == user.uid) return;
          Navigator.pushNamed(
            context,
            '/chat',
            arguments: ChatParams(currentUser.uid, user),
          );
        },
        child: Padding(
          padding: const EdgeInsets.only(top: 8.0),
          child: Card(
            margin:
                EdgeInsets.only(top: 12.0, bottom: 6.0, left: 20.0, right: 20.0),
            child: ListTile(
              leading: CircleAvatar(
                backgroundImage: NetworkImage(user.profilepic),
              ),
              title: Text(user.name),
            ),
          ),
        ),
      );
    }
  
  }
  </code></pre>
  <p>Thank you for your help.</p>