hello I don't succeded to output this code in this format ( 04 Juin 2019 )
var now = new DateTime.now();
var daysfromnow = now.add(new Duration(days: changedate));
RegExp regExp = new RegExp(
r"(^\S*)",
);
var match = regExp.firstMatch("$daysfromnow");
daysfromnow_modify = match.group(1);
current outpub : 2019-06-04
expected output : 04 juin 2019
Update:
I tried to format but I don't succeded to change days when I press button...
here is the new code
new IconButton(
icon: Icon(Icons.keyboard_arrow_left),
onPressed: () {
setState(() {
changedate--;
DateTime now = DateTime.now();
formattedDate = DateFormat.yMMMMd("en_FR").format(now);
daysfromnow = formattedDate.add(new Duration(days: changedate)); //add can't be a String ...
});
)}
I tried this also ..
formattedDate = DateFormat.yMMMMd("en_FR").now.add(new Duration(days: changedate));