0

How to test the last and current 3 month date in the flutter. Is anyone having the solution for that.

    RichText(
                        text: TextSpan(children: [
                          TextSpan(
                              text: DateTimeHelper.getFormattedDateTime(fromDate,
                                  dateFormat: DateTimeHelper.dateOnlyText),
                              style: TextStyle(
                                  fontSize: 16, fontWeight: FontWeight.w600)),
                          TextSpan(text: " to "),
                          TextSpan(
                              text: DateTimeHelper.getFormattedDateTime(toDate,
                                  dateFormat: DateTimeHelper.dateOnlyText),
                              style: TextStyle(
                                  fontSize: 16, fontWeight: FontWeight.w600)),
                        ]),
                      ),


  

2 Answers2

0

Comparing two dates:

var today = DateTime.now();
var date = DateTime.fromMillisecondsSinceEpoch(some_date); // Suppose your stored date is in Milliseconds Epoch format.
bool isSame = date.day == today.day;
Mahan Marwat
  • 373
  • 1
  • 13
0

I can add to the previous answer that it is possible to assign a key to some widget and use the key to get the value from it. Smth like this

await driver.tap(find.text(lifeStyle)

Evgen
  • 77
  • 6