Stream Builder Type error

I am trying make an vendor app and facing issue with type error in stream builder. It would be great help if you can point out the mistake.
Thank You

import 'package:cloud_firestore/cloud_firestore.dart';

import 'package:flutter/material.dart';

import 'package:winewell_vendor_app/model/orders_model.dart';

import 'package:winewell_vendor_app/services/order_database.dart';

import 'package:winewell_vendor_app/widgets/orders_card.dart';

class Orders extends StatefulWidget {

  const Orders({Key? key}) : super(key: key);


  State<Orders> createState() => _OrdersState();


class _OrdersState extends State<Orders> {


  Widget build(BuildContext context) {

    return Scaffold(

      body: Padding(

        padding: EdgeInsets.only(

            left: MediaQuery.of(context).size.width * 0.05,

            right: MediaQuery.of(context).size.width * 0.05,

            top: MediaQuery.of(context).size.height * 0.022),

        child: OrdersList(),





class OrdersList extends StatefulWidget {

  OrdersList({Key? key}) : super(key: key);


  State<OrdersList> createState() => _OrdersListState();


class _OrdersListState extends State<OrdersList> {

  OrderDatabase orderDatabase = OrderDatabase();


  Widget build(BuildContext context) {

    final Stream<QuerySnapshot> ordersStream = orderDatabase.orders

        //.where('isOrderConfirmed', isEqualTo: true)


    return StreamBuilder(

        stream: ordersStream,

        builder: (context, AsyncSnapshot<QuerySnapshot> snapshot) {

          if (snapshot.hasError) {

            return const Text(

              'Something went wrong',



          if (snapshot.connectionState == ConnectionState.waiting) {

            return const Center(

              child: CircularProgressIndicator(),



          if (!snapshot.hasData) {

            return const Text('There is no order');


          List<Order> ordersList =

    ! documentSnapshot) {

            Map<String, dynamic> data =

      ! as Map<String, dynamic>;

            return Order(

              customerAddress: data['customerAddress'],

              orderID: data['orderID'],

              customerPhoneNumber: data['customerPhoneNumber'],

              productName: data['productName'],

              productPrice: data['productPrice'],

              productQuantity: data['productQuantity'],

              productVolume: data['productVolume'],

              gift: data['gift'],

              orderRecievedTime: data['orderRecievedTime'],

              orderAcceptedTime: data['orderAcceptedTime'],

              isOrderAcceptedByVendor: data['isOrderAcceptedByVendor'],

              isOrderConfirmed: data['isOrderConfirmed'],

              isOrderDelivered: data['isOrderDelivered'],

              isOrderDispatched: data['isOrderDispatched'],




          return ListView.builder(

              itemCount: ordersList.length,

              itemBuilder: (BuildContext context, int index) {

                // if (index == -1) {

                //   return const Text('New order will come soon');

                // } else {

                return (orderDatabase.order.isOrderConfirmed == true &&

                        orderDatabase.order.isOrderAcceptedByVendor == false &&

                        orderDatabase.order.isOrderDispatched == false &&

                        orderDatabase.order.isOrderDelivered == false)

                    ? OrderCard(

                        order: ordersList[index],


                    : const Center(

                        child: Text('Orders will displayed here'),





Error shown in terminal:
The following _TypeError was thrown building StreamBuilder<QuerySnapshot<Object?>>(dirty, state: _StreamBuilderBaseState<QuerySnapshot<Object?>, AsyncSnapshot<QuerySnapshot<Object?>>>#ae7f9):

type ‘List’ is not a subtype of type ‘List’

Welcome @mohit32 to our community. Glad to have you here.

Thanks for asking that question. We currently have a chapter dedicated to Streams, i will drop the link here. Let me know if that helps.