Dynamic Card and Label with lists

Hi All

I have worked out to do a dynamic card view with a dynamic label on top pulling the id text from the global list which is stored and pulled from tinyDB. The only things I’m struggling with is how to simplify the code as will tremendous amount of code just to produce 20 of them. My blocks for just 1 index on a dynamic label on top of a dynamic card is below. Please as this is one of the last missing parts of my App for my boys rugby team.

Thanks

Instead of using ID 3, use the index of the item you are looping thru at that moment.

1 Like

why guys are not using search before posting. :unamused:

1 Like

Because they actually don’t know the forum meaning…

3 Likes

Thanks Italo much appreciated.

1 Like

hi @Italo
I’ve tried to change that coding around so i get the first 5 in the list on one horizontal arrangement and then the next 5 on a second horizontal arrangment but when i try to the " from each number 1 to 5 by 1 " as shown below doesn’t work. Can you advise please as the works as needed but just need to split the list up for 5 horizontal arrnagements.

Thanks

blocks(1)

Show all your blocks inside the FOR EACH loop.

I have tried it as both ways below but i either get the the number of buttons right with no labels or i get alot of buttons in the one horizontal which go out og the horizontal arrangement. Pic 1 and 2 is how i want it to work as in getting the right number of dynamic cards on the row but then get no labels. Pics 3 and 4 give me dynamic cards and labels but don’t split after 5 to the next arrangement.

thanks

Let’s start with one thing. Inside this loop I circled in red, TempindexNumber is always 0, you never increment that variable, so every CardView you create is created with ID “0”.
Check that.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.