Questions tagged [flutter-streambuilder]

192 questions
146
votes
7 answers

Flutter StreamBuilder vs FutureBuilder

What is the main difference between StreamBuilder and FutureBuilder. What to use and when to use? What are the tasks they are intended to perform? How each of them listens to changes in a dynamic list?
5
votes
1 answer

Flutter bloc chat is not refreshing after sending message

I'm new to bloc and trying to implement a chat with flutter_bloc package. The service for my messaging is twilio conversations api. My function works perfectly fine, Im simply not able to refresh my list of messages. Could somebody show me what I'm…
3
votes
1 answer

can not load data again with Stream flutter

I'm using a stream data to load data from API when app start up.But it had a problem, when It load the SearchPage widget, snapshot has data but when I change to other screen and back to SearchPage widget, it lost all data. class _SearchPageState…
YetDev
  • 123
  • 4
3
votes
1 answer

Webscoket channel not connecting after closing it - Flutter

I'm creating a web socket stream broadcast that is accessed across multiple pages in a flutter app. The code is as below class MyApp extends StatelessWidget { static IOWebSocketChannel channel = …
Kalaivani
  • 31
  • 1
2
votes
1 answer

Provider cannot handle Firebase authStateChanges()

I am struggeling for the long time with handling correctly reauthentication of user in conjunction with storing the data in Provider. During the first execution of the app on the device, the user is unauthenticated. Then user can register/login and…
2
votes
1 answer

Showing database in flutter

I have a problem with showing a database in my app. Here's the code. SingleChildScrollView( child: Center( child: Padding( padding: const EdgeInsets.all(8.0), child: Column( mainAxisSize: MainAxisSize.min, children:…
2
votes
1 answer

StreamBuilder / ChangeNotifierProvider- setState() or markNeedsBuild() called during build

Streambuilder, ChangeNotifier and Consumer cannot figure out how to use correctly. Flutter I've tried and tried and tried, I've searched a lot but I cannot figure this out: I'm using a Streambuilder this should update a ChangeNotifier that should…
2
votes
0 answers

How to upload multiple image Urls inside my Firebase Database and How to display the URLs images in a separate Page

I am getting two issues with my coding. I have created a multiple image picker that uploads all the images of the logged user into firebase image storage under the user ID. But the issue is when it downloads the image link from the storage of…
2
votes
1 answer

Dart/Flutter Firestore allow multiple values for a field in a query

I started learning dart / flutter on my own initiative. I have encountered one problem, which I have been trying to solve for the last 3 days. It is about reading data from the firestore. There are a lot of documents in the firestore. I need a way…
2
votes
1 answer

Flutter: StreamBuilder does not show data on connection.state.active

I been trying to figure this out for the entire weekend so I finaly decided to ask you for your advice. Got a streambuilder which listens for a stream or recipes (filtered by the category -> soups, deserts etc.). I were confused because the Text…
2
votes
2 answers

Flutter Firebase: I want to stream the details of the logged in user across the app using Stream provider

I'm getting the below error: The return type 'AuthUser?' isn't a 'User?', as required by the closure's context. From the below code: class AuthService { final FirebaseAuth authInstance = FirebaseAuth.instance; final FirebaseFirestore…
2
votes
1 answer

Changes to Stream Provider after migrating to null safety version Provider 5.0.0

I have migrated to dart null safety version. The command in migrate function fixed most issues. However, I have a Stream Provider which handles the User Session using Firebase. After the migration to Provider version 5.0.0 the app is crashing. Below…
2
votes
3 answers

How to convert serverTimestamp to String when using StreamBuilder

What I want To order ListView based on server timestamp My code Adding to firestore collection: onPressed: () { FirebaseFirestore.instance.collection('things').add( { // some code 'timestamp': FieldValue.serverTimestamp(), }, ); Get…
1
vote
0 answers

Flutter Pagination with StreamBuilder Firebase

I am trying to make a Chat Application in Flutter with Firebase Firestore. I want to show 10 messages with every "Next Load"; while updating the stream with all new incoming messages. (I want to perform this action with the least amount of reads…
1
vote
0 answers

Why does the stream in websocket close?

I have server in python and clients in flutter. When I try to send message from one client to another (that message would be sent to the server before ofcourse) it close the stream in flutter for the client that sent the message. For example let's…
1
2 3
12 13