I'm working on a flutter app as a project and actually I'm stuck with how to get the difference between two times. The first one I'm getting it from firebase as a String then I format it to DateTime using this DateTime.parse(snapshot.documents[i].data['from'])
and it gives me like 14:00 for example. Then, the second is DateTime.now()
.
I tried all methods difference
, substract
... but nothing works!
Please help me to get the exact duration between those 2 times.
TY
PS: I need this for a Count Down Timer