Skip to content

[Cloud Firestore] Stream builder not updating when using Order by clause in flutter #2262

@swapnilshah09

Description

@swapnilshah09

While using order by clause the stream builder is not updating the data. But if I remove the order by clause then stream builder shows updated data.

To Reproduce

  • Add order by clause, in my case, I am ordering by a date field.
  • The stream builder is not updated on the change of data.
  • I don't see any errors on the screen.
StreamBuilder(
              stream: Firestore.instance.collection('orders').where(
                  'userUID', isEqualTo: futureSnapshot.data.uid).where('orderStatus', whereIn: allOrderStatus).orderBy('placedAtTime', descending: true).snapshots(),
              builder: (context, snapshot) {

Expected behavior
On CRUD operations, the stream builder should update but it is not updating. But once I remove the order by then it works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    impact: customerA bug with low impact (e.g. affecting only a few customers or has a workaround). (P3)plugin: cloud_firestoretype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions