Create dynamic list for expansion tile from Firestore data
191
You can iterate over the array and sort the data as List for each category. Say you got 3 List ie. makeup, hair, and men's. Now you can use the spread operator to make the final List
Example
final List<Entry> data = [
Entry(
'Makeup',
...makeup
),
Entry(
'Hair',
...hair
),
Entry(
'Men`s',
...mens
),
]
Author by
Can Kaplan
Currently building a marketplace in the beauty service industry.
Updated on December 20, 2022Comments
-
Can Kaplan over 1 year
I would like to create a dynamic expansionTile, which receives as input data from Cloud Firestore.
Currently I download the data as array from Firebase and sort it into 3 different arrays ("Makeup", "Hair", Men's"). Data structure Firestore
But I have to create a list according to the following scheme:
How can I merge the three lists to one such list?
-
Sidak almost 4 yearsWhen you say dynamic ExpansionTile, do you mean you want an ExpansionTile for each Entry?
-
-
Can Kaplan almost 4 yearsHowever, the data structure does not consist of 3 arrays, but 3 json structures. I added another picture to my question... Could you help?