I am trying to display the current DateTime in a Text widget after tapping on a button. The following works, but I\'d like to change the format.
DateTime
Text
Here's my simple solution. That does not require any dependency.
However, the date will be in string format. If you want the time then change the substring values
print(new DateTime.now() .toString() .substring(0,10) ); // 2020-06-10