stream-builder

Flutter: Items in StreamBuilder(Using firebase realtime database) are sorted randomly [duplicate]

我的未来我决定 提交于 2020-08-15 14:44:33
问题 This question already has an answer here : Flutter: Firebase Real-Time database orderByChild has no impact on query result (1 answer) Closed 4 months ago . I'm creating a simple application with Firebase Realtime database where a user inputs a text and it gets added to a list of chats. void main() => runApp(MyApp()); class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo',

Flutter: Items in StreamBuilder(Using firebase realtime database) are sorted randomly [duplicate]

早过忘川 提交于 2020-08-15 14:42:22
问题 This question already has an answer here : Flutter: Firebase Real-Time database orderByChild has no impact on query result (1 answer) Closed 4 months ago . I'm creating a simple application with Firebase Realtime database where a user inputs a text and it gets added to a list of chats. void main() => runApp(MyApp()); class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo',

flutter firestore pagination using streambuilder

穿精又带淫゛_ 提交于 2020-08-05 05:54:38
问题 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 after adding new data the list is not updated. if anyone can help then it will be great for me. here is what i am doing now.. didChangeDependencies() { super.didChangeDependencies(); getProducts(); _scrollController.addListener(() { double maxScroll

flutter firestore pagination using streambuilder

徘徊边缘 提交于 2020-08-05 05:54:05
问题 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 after adding new data the list is not updated. if anyone can help then it will be great for me. here is what i am doing now.. didChangeDependencies() { super.didChangeDependencies(); getProducts(); _scrollController.addListener(() { double maxScroll

How do you check internet ACCESS continously in flutter.dart, not connection

你说的曾经没有我的故事 提交于 2020-07-19 06:09:08
问题 how do you continously check internet access? I was able to show if wifi is connectected or mobile data. However, not all connection would have internet access. import 'package:connectivity/connectivity.dart'; var connectivityResult = await (Connectivity().checkConnectivity()); if (connectivityResult == ConnectivityResult.mobile) { // I am connected to a mobile network. } else if (connectivityResult == ConnectivityResult.wifi) { // I am connected to a wifi network. } This is currently the

Flutter: Streambuilder causing far too many reads on Firestore

一世执手 提交于 2020-06-16 04:17:10
问题 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 300 per user), even though I have 50 quotes at max. I have a hunch that something in my code is causing Streambuilder to trigger multiple times (maybe the user 'liking' a quote) and also the Streambuilder is loading ALL the quotes instead of only

Flutter: implementing a search feature for data from a StreamBuilder with ListView

拟墨画扇 提交于 2020-06-16 03:46:13
问题 In my Flutter app I have a screen with all the users. The list of users is generated by a StreamBuilder , which gets the data from Cloud Firestore and displays the users in a ListView . To improve functionality I want to be able to search through this user list with a search bar in the Appbar . I have tried this answer and that worked well but I can't figure out how to get it working with a StreamBuilder in my case. As a flutter beginner I would appreciate any help! Below I have included my

Geting data from mysql to StreamBuilder Flutter

萝らか妹 提交于 2020-05-16 22:03:25
问题 I have an assignment and I have to take data from mysql server into a flutter and pass it to StreamBuilder and I was trying to use the same class we are using it in firebase and now I have problem with passing the data that I already take it from the server into the StreamBuilder and as I remember I have to use a different type of snapshot, any help. import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; import 'dart:convert'; void main() => runApp(MyApp()); class