flutter-listview

List view throws an error before stream has finished retrieving data

北城余情 提交于 2020-04-18 05:36:54
问题 I've been learning Flutter and following an online tutorial regarding Provider package, at present I'm working with StreamProvider . I have a service which connects to Firestore and returns all documents within a collection ('reports'), these documents are then mapped to my report object. Service: class FirestoreService { Firestore _db = Firestore.instance; var random = Random(); Stream<List<Report>> getReports() { return _db.collection('reports') .orderBy('timeStamp', descending: true)

List view throws an error before stream has finished retrieving data

白昼怎懂夜的黑 提交于 2020-04-18 05:36:41
问题 I've been learning Flutter and following an online tutorial regarding Provider package, at present I'm working with StreamProvider . I have a service which connects to Firestore and returns all documents within a collection ('reports'), these documents are then mapped to my report object. Service: class FirestoreService { Firestore _db = Firestore.instance; var random = Random(); Stream<List<Report>> getReports() { return _db.collection('reports') .orderBy('timeStamp', descending: true)

ExpansionTile inside ListView - page not scrolling

安稳与你 提交于 2020-03-06 09:43:11
问题 I am facing issue with page scrolling. I am showing users transactions grouped per day. so there will be multiple items inside ExpansionTile. I am first taking days from database and then taking transactions done on that day . so below is how my page working take all records get days and put in one list (days list) load main expansion tiles with for loop in this list(days list) when we do for loop take transactions on that day and load in another array bind children list as children to

How to remove overscroll on ios?

给你一囗甜甜゛ 提交于 2020-01-11 07:32:06
问题 By default, flutter adds a overscroll effect on ListView/GridView/... on ios I would like to remove this effect entirely or on one specific scrollable. What can I do ? 回答1: I found this answer (https://stackoverflow.com/a/51119796/5869913) and just added information about deleting overscroll effect. The overscroll effect comes from BouncingScrollPhysics added by ScrollBehavior To remove this effect, you need to specify a custom ScrollBehavior and override getScrollPhysics method. For that,

I want to change the color of CustomListTile which is child of ListView when onTap is clicked, and setting other children color into default one?

拥有回忆 提交于 2020-01-05 08:28:19
问题 In a Drawer, in listview want to change the color of CustomListTile when the onTap is clicked and setting color of all other children to default? class CustomListTile extends StatelessWidget { final Color itemContainerColor; const CustomListTile({ //deafult color is Colors.white this.itemContainerColor= Colors.white, }); @override Widget build(BuildContext context) { return InkWell( onTap: (){}, child: Container( margin: EdgeInsets.symmetric(vertical: 4), padding: EdgeInsets.symmetric

What is the equivalent of Android's RecyclerView.SCROLL_STATE_IDLE in Flutter

故事扮演 提交于 2019-12-22 17:06:45
问题 Android gives scroll states like RecyclerView.SCROLL_STATE_IDLE which tells when user stops the scroll. I'm not able to find any alternative in flutter for Pageview or ListView ScrollListener. My Problem I need to detect scroll up/down in PageView to perform some operation based on that. Flutter gives the direction ( _myPageViewController.position.userScrollDirection ) but it gives a continuous callback. I need to detect it only when the user stops scrolling. Another scenario I need to do

What is the equivalent of Android's RecyclerView.SCROLL_STATE_IDLE in Flutter

大憨熊 提交于 2019-12-22 17:06:32
问题 Android gives scroll states like RecyclerView.SCROLL_STATE_IDLE which tells when user stops the scroll. I'm not able to find any alternative in flutter for Pageview or ListView ScrollListener. My Problem I need to detect scroll up/down in PageView to perform some operation based on that. Flutter gives the direction ( _myPageViewController.position.userScrollDirection ) but it gives a continuous callback. I need to detect it only when the user stops scrolling. Another scenario I need to do

Find out which items in a ListView are visible

主宰稳场 提交于 2019-12-22 07:00:09
问题 How can I find out which items are currently visible or invisible in a ListView ? For example, I have 100 items in ListView and when i scroll to top of screen or list, I want to detect which items appear or disappear from the viewport. Illustration: 回答1: There is no easy way to do this. Here is the same question, however, it does not have an answer. There is an active GitHub issue about this. There are multiple solutions for the problem in that issue. This Gist features one that requires the

What is the equivalent of Android's RecyclerView.SCROLL_STATE_IDLE in Flutter

 ̄綄美尐妖づ 提交于 2019-12-06 09:19:54
Android gives scroll states like RecyclerView.SCROLL_STATE_IDLE which tells when user stops the scroll. I'm not able to find any alternative in flutter for Pageview or ListView ScrollListener. My Problem I need to detect scroll up/down in PageView to perform some operation based on that. Flutter gives the direction ( _myPageViewController.position.userScrollDirection ) but it gives a continuous callback. I need to detect it only when the user stops scrolling. Another scenario I need to do auto-play videos in a listView. So I need to detect when the user stops scrolling and then get the

Find out which items in a ListView are visible

六眼飞鱼酱① 提交于 2019-12-05 16:16:42
How can I find out which items are currently visible or invisible in a ListView ? For example, I have 100 items in ListView and when i scroll to top of screen or list, I want to detect which items appear or disappear from the viewport. Illustration: There is no easy way to do this. Here is the same question, however, it does not have an answer. There is an active GitHub issue about this. There are multiple solutions for the problem in that issue. This Gist features one that requires the rect_getter package . Alternatively, you could take a look at this proposal . TL;DR This is not yet