Flutter - How to Show Today, Tommorow after comparing the date in db with present date?

♀尐吖头ヾ 提交于 2021-02-11 15:08:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!