Flutter tree view widget and firestore - flutter

How do we get the firestore data into the treeview widget? I tried everything to format the data into array but didn't go well. I just started learning flutter and firestore and is my first project.
Flutter TreeView Json Data Parsing

Check flutter_simple_treeview. You can feed any widget to be a node. So, you need to convert each record to TreeNode object and feed it to the widget TreeView.
This is a demo.

Related

Create Vertical List in Flutter

I want to create this type of listview using flutter.
https://dribbble.com/shots/6872462-Food-ordering-app-Animate
You can find out more by clicking on this link. But I don't know how to create this type of list. I mean, you can see in the GIF that the list is indexed based.
A fixed indexed item container is colored.
How can I achieve it?
Flutter provides you with a widget very similar to the result you want to achieve called NavigationRail.
You will not have the animation by default, but you can maybe search in the source code of this widget how to create a custom widget that will implement animations.

How to rebuild Widget after updating data to RTDB flutter

Hi I'm new to flutter and I'm currently trying to work with Realtime Database from firebase. I manage to get all my data from RTDB and I also made function to edit the data in RTDB.
The problem is I cannot make my Widget to rebuild when I already done updating the RTDB data.
Here's how the process of the Data fetching and updating goes:
First, We will have variable A on screen A to fetch the RTDB data in the initState
Second, the fetched data will be used to create Widget of Text in Screen A
Third, there will be a button on screen A to push the screen to Screen B (Editing Page)
Fourth, After the user done editing it will push the user into Splash Screen and it will be Pop back to screen A
Fifth (Here's the problem), the Widget still build the old data, not the new data that has been edited.
I thought after step 4, Screen A will do the fetching again in initState.. Am I wrong ? How can I do the rebuild of widget ? Thanks before

Flutter FirestoreListView detect and present widget on no available documents

I'm using FirestoreListView to fetch documents from Firestore and present them as a list of items (as part of flutterfire_ui ^0.4.0+5 package).
In case of no available documents (empty QuerySnapshot), the ListView is empty and blank. In that case, I want present a text widget to the screen.
How do I detect and present a widget on empty items using FirestoreListView?

Flutter: How to save widget state in ListView.builder

I have an app which has a ListView.builder() which builds widgets. Those widgets fetch an image from firebase cloud storage. Every time those widgets go off the screen and come back, the widget fetches the image from firebase cloud storage again. I want to make it so that it doesn't fetch the image again but rather displays the image it already got when it is rebuilt if the widget already got the image.
It currently looks like this: https://cln.sh/S9Ky0L.

Serialize Flutter Widget

Is there any way to serialize the Build layout of a stateless flutter widget and save it to a database?
I would like to design many simple Badge widgets and don‘t want to update the App each Time I have a new one.
I would like to save new widgets to a db instead.
Remote flutter widgets - may be the direction. It has mechanism for rendering widgets based on declarative UI descriptions that can be obtained & rendered at runtime.