format method
Implementation
String format({String? format, Locale? locale, BuildContext? context}) {
try {
locale ??=
FlutterViewUtils.get(context: context).platformDispatcher.locale;
return Intl.DateFormat(
format ?? getFormattedDateTimeFormat(), locale.toString())
.format(getDateAsDateTimeLocal()!);
} catch (e) {
print(e);
try {
return Intl.DateFormat(format ?? getFormattedDateTimeFormat())
.format(getDateAsDateTimeLocal()!);
} catch (e) {
print(e);
return Intl.DateFormat().format(getDateAsDateTimeLocal()!);
}
}
}