title: Flutter Firestore StreamBuilder and ListView.builder() how to show index number
body: <p>I have a collection called users from Firebase as users. I can list the users in this collection. but while listing, I want to print these users to the list with their index number. like 1 2 3 4 5 6 7</p>
  <pre><code>class UserInformation extends StatefulWidget {
  const UserInformation({Key? key}) : super(key: key);
  
  @override
  _UserInformationState createState() =&gt; _UserInformationState();
  }
  
  class _UserInformationState extends State&lt;UserInformation&gt; {
  final Stream&lt;QuerySnapshot&gt; _usersStream = FirebaseFirestore.instance
    .collection('users')
    .orderBy(&quot;score&quot;, descending: true)
    .limit(7)
    .snapshots();
  
  @override
  Widget build(BuildContext context) {
  return StreamBuilder&lt;QuerySnapshot&gt;(
    stream: _usersStream,
    builder: (BuildContext context, AsyncSnapshot&lt;QuerySnapshot&gt; snapshot) {
      if (snapshot.hasError) {
        return const Text('Something went wrong');
      }
  
      if (snapshot.connectionState == ConnectionState.waiting) {
        return const CircularProgressIndicator();
      }
  
      return ListView(
        shrinkWrap: true,
        children: snapshot.data!.docs.map((DocumentSnapshot document) {
          Map&lt;String, dynamic&gt; data =
              document.data()! as Map&lt;String, dynamic&gt;;
          return Card(
            child: ListTile(
              contentPadding: const EdgeInsets.symmetric(horizontal: 24),
              leading: const Text(&quot;1&quot;), //show index number 
              title: Center(child: Text(data['userName'])),
              trailing: Text(data['score'].toString()),
            ),
          );
        }).toList(),
      );
    },
  );
  }
  }
  </code></pre>