Questions tagged [stream-builder]

Flutter widget that builds itself based on the latest snapshot of interaction with a Dart stream.

642 questions
19
votes
1 answer

Scoped Model, BLoC pattern, StreamBuilder and Inherited Widget(or Model) which one should I chose and why?

I think I have now at least a vague idea of how to use a BLoC, Stream Builder and Inherited Widget(or Model) in my app (nothing special, but for me it took time), but playing with the Scoped Model I had a sort of existential crisis: I feel they can…
15
votes
4 answers

flutter firestore pagination using streambuilder

hello i am trying to use pagination in my list. and the list data is coming from firebase. i am not sure how to paginate data using stream builder. now i am doing the pagination by calling getdocuments in the didChangeDependencies() function. but…
11
votes
4 answers

Flutter iOS crash with EXC_BAD_ACCESS error

I am developing an app with Flutter and testing the app on a physical iOS device (iPhone 7). The iOS version is: 15.3.1 And the Flutter version is: 2.10.3 When I am testing my app, I occasionally get crashes. The crash gives the error below. It does…
edn
  • 1,981
  • 3
  • 26
  • 56
10
votes
1 answer

Flutter: Streambuilder causing far too many reads on Firestore

I am trying to build a simple quotes Flutter app, where I show a list of quotes and allow users to 'like' the quotes. I am using the Streambuilder for that. My problem is that the Firestore usage dashboard shows a very high number of reads (almost…
Varun
  • 1,938
  • 18
  • 19
10
votes
2 answers

Flutter Streambuilder rebuilds constantly

I have a stream builder listening to Firestore, and it kinda works. The main issue is that the streambuilder keeps rebuilding (if it doesn't cost me extra reads then no worries, but if it does then it's a problem which I'm assuming it does). When…
Mohamed Mohamed
  • 3,965
  • 3
  • 23
  • 40
9
votes
3 answers

Stream for API coming from PHP in Flutter (Not Firebase)

Let's say I have an API - example: https://jsonplaceholder.typicode.com/posts Now, I want to apply StreamBuilder to it with a ListView have ListTiles. How do I configure? How do I create a stream for it? I totally understood the firebase and…
Santu
  • 121
  • 1
  • 1
  • 7
9
votes
1 answer

How to skip build in item builder gridview.builder Flutter Firebase Stream Builder

I would like to delete something of firebase and when Streambuilder(gridview.builder) reach it index which gonna be null it ignore it and don't add any widget in that slot and keep it for others this what it looks like I want the empty space on the…
Zyzto
  • 137
  • 1
  • 11
8
votes
4 answers

StreamBuilder in Flutter stuck with ConnectionState.waiting and displays only the loading mark

Hi I am trying to display the data inside the Firebase documents into my Flutter dynamically where they get rendered using a loop, so I made a List Cards and added to it the function makeItem() that contains the cards, and put them inside a…
AdnanAsali
  • 139
  • 2
  • 8
8
votes
2 answers

Do I need to cancel Stream (flutter)

I am listening to a collection of documents in firestore (as part of a chat app). I am doing this by using a service, which creates a Stream as follows: _snapshots$ =…
8
votes
5 answers

Flutter - How to use ScrollController to jumpto the bottom of the listview after fetching data from firebase using StreamBuilder?

What is the best way to use ScrollController in the list for scrolling to the bottom of the list after the listview is rendered data from streambuilder using firestore query stream? What is the best place to use scrollcontroller.jumpto method ? //…
Mahesh P
  • 400
  • 1
  • 4
  • 18
8
votes
5 answers

Flutter Stream Builder Triggered when Navigator Pop or Push is Called

I have a stream builder in the app's home/root page. This stream builder gets triggered whenever I do a page-navigation elsewhere, which has nothing to do with the stream itself. My understanding, according to here and here, is when a page is…
7
votes
2 answers

How to see changes in flutter app when changing values in Firebase Realtime Database?

I am trying to make these rolling switches to change its value whenever I do any change in Firebase realtime database. To be more specific, whenever I change the value of Relay1/Data to 0, I want that switch to become inactive. I've tried and…
7
votes
3 answers

Flutter StreamBuilder Called Twice When Initialized

Is StreamBuilder always called twice? Once for initial data and then once for the input stream? Initializing the following StreamBuilder shows that the build method is called twice. The second call is 0.4 seconds after the first one. Stream: Build…
Ray Li
  • 7,601
  • 6
  • 25
  • 41
7
votes
1 answer

how to get multiple streams based on the same stream controller in flutter?

I have a Bloc class that needs three streams based on the same stream controller. class TodoBloc { final _todoController = StreamController>(); get allTodoStream => _todoController.stream; get activeTodoStream =>…
Salma
  • 1,211
  • 2
  • 16
  • 33
7
votes
2 answers

How to access multiple streams inside a StreamBuilder?

I've tried to make a new StreamBuilder inside the builder of my initial stream, and while I don't get any errors, it also doesn't seem like it works. Is this possible to do? Basically, I'm accessing a root Collection in Firebase. This collection…
GroovinChip
  • 339
  • 4
  • 17
1
2 3
42 43