in flutter we can get current month using this
var now = new DateTime.now(); var formatter = new DateFormat(\'MM\'); String month = formatter.format(now); <
Try this package, Jiffy, it used momentjs syntax. See below
Jiffy().subtract(months: 1);
Where Jiffy() returns date now. You can also do the following, the same result
Jiffy()
var now = DateTime.now(); Jiffy(now).subtract(months: 1);
Jiffy respects the leap years and how many days there are in each month