Display list of items from Cloud Firestore(Firebase)

  1. Create a new dart file in lib : recipes.dart
  2. Create a stateless widget inside the above file
  3. Return a Scaffold with an AppBar from the build function
  4. Add a StreamBuilder to the body of the Scaffold
  5. Provide the reference of the firestore Collection named ‘Recipes’ to the stream property
  6. Implement the builder function
    • Check if there is an error
    • Display a progress indicator if the connection state is waiting
    • Create a ListView with the items of the snapshot.data

Complete Code (recipes.dart)

Leave a Reply

Your email address will not be published. Required fields are marked *