Change color of dynamic cardview

I’ve tried a lot but this simple looking thing is not working for me

I have value in which my Data and time are separated by _ like this

Data_time

My Data changes over time on the same day but time part is constant
I stored the list of value in tinydb and whenever I call data from online it checks whether it is present offline or not, if not present then I turn the cardview color to red. But this is not working when data is changed. I mean then all the cardview turned to red. I want that only that cardview turn to red which is not present in my tinydb offline storage.

show us your blocks, without blocks it is harder to suggest

Here it is, I was trying to replace it with old data in the or
But didn’t worked

have you debug the block using Do it? did you get false ?

What’s debug

I mean that only work when I have not changed the data
But after changing only that cardview turned to red
So I added the “or” logic but that makes the whole list of cardview to red wether i add new data or change the data
@Still-learning

That’s option not available to me maybe cuz I’m a mobile user

if you test/run the above code, among the global values if any value matches with tinydb values whose colour will not change. If the value is doesnot match those item cardview alone change the background colour. If it not work then you have to check the logic only one by one in system. or use the label to know whether it triggers true or false

Is there any way that it matches only the time only
Cuz my shows only one day data in it
@Still-learning

Still i am not clear with your query. If you shiw your sample datas i may clear

@Still-learning
I have data in list like this:

India_100liked_Jun 10, 2025_It is famous for it’s diverse culture_110views
Dead Sea_300liked_Jun 10, 2025_The lowest point on the earth surface_500views

I have provided 2 items of a list, and as you can there are five items in each item and on 3rd number it’s date, which is constant because it’s a uploaded date but other things like Liked and views number is changable. So whenever views change it shows red cardview and same for liked one but I want it to check only date then it will be okay. But how can I do that

But in the above logic you have not used split text at _ or 5th item of kust with date?

Get the list, split it at _, get the 5th item, compare with date in ddd, MM yyyy format

1 Like

I know to do it for a single item like for index1 but the data which I am calling in is in the list so how can I do for each item

I am checking if last item of both list is same or not,
So the last index you can take index2 of the data I have given and for the online data it would be list. Now I want to check only date of both
I don’t know how to split for a list
@Still-learning

I tried and it worked but I stored date separately and I use split as you said

1 Like