I just want to print "After Time" when my local time is greater than my Firebase data document, but it does nothing when my local time is greater only when I restart my application, it shows up print I want it right now displayed
ssaveTimeToFireStrone() async{
await FirebaseFirestore.instance.collection("TimeToChange").doc("Time").set({
"currentTime":atSixInEvening
});
}
Future getTheTime() async{
final DocumentSnapshot doc=await FirebaseFirestore.instance.collection("TimeToChange").doc("Time").get();
DateTime timeToTriggerEvent=doc["currentTime"].toDate();
// await Future.delayed(Duration(seconds: 5));
// print(timeToTriggerEvent);
if(await DateTime.now().isAfter(timeToTriggerEvent)){
print("after time");
return true;
}
}