问题
Show day for ex:- today, tommorow, 28 Dec 2020 etc after comparing date from sqlite db in a list tile with present date. And also delete a particular item from list on app start if the day was yesterday.
In present it is showing like 21-11-2020 and if the date has expired also it still continues to show.
This is my Code
List<Note2> items2 = new List();
DatabaseHelper2 db2 = new DatabaseHelper2();
db2.getAllNotes2().then((notes2) {
setState(() {
notes2.forEach((note2) {
items2.add(Note2.fromMap(note2));
});
});
});
avaDate = items2[position].date2;
ListTile(
trailing: Text(avaDate),
),
来源:https://stackoverflow.com/questions/64870128/flutter-how-to-show-today-tommorow-after-comparing-the-date-in-db-with-presen