I'm trying make loop 12 times as months in year
for (var i = 1; i <= 12; i++) {
DateTime.now().add(Duration(days: (i * 30))).toIso8601String())
}
my code is worked correctly but it's give a different days like
If I run loop in today 10 Dec it will give me that
- 9 January
- 8 February
- 9 march
I want a result like that
- 10 January
- 10 February
- 10 march
Answer : I Found my answer of my question here in that package jiffy
dateOfCreated = Jiffy(dateOfCreated).add(months: 1);