hukusuke1007 / flamingo

[Flutter Library] Flamingo is a firebase firestore model framework library. 🐤
https://pub.dev/packages/flamingo
MIT License
118 stars 20 forks source link

How to get items in a streamBuilder in realtime #11

Closed tnaffh closed 4 years ago

tnaffh commented 4 years ago

Hi,

Can you please show how to get items in a streambuilder and be able to update changes in realtime?

here is an example of this without using flamingo:

StreamBuilder(
          stream: db.collection('chats').orderBy('updated_at').snapshots(),
          builder: (context, snapshot) {
             //....
             // snapshots changes loaded in realtime
          },
)

Kindly help.

hukusuke1007 commented 4 years ago

Can be used CollectionPagingListener. This is a sample code. https://github.com/hukusuke1007/flamingo/blob/master/flamingo/example/lib/collection_paging_listener_stream_builder_page.dart

tnaffh commented 4 years ago

Perfect. Close