termDate function
date as a terminal writes one, 2026-11-14: year, month and day in
that order, in localizations' digits when given (Arabic's
٢٠٢٦-١١-١٤), else ASCII.
Implementation
String termDate(DateTime date, {DesignLocalizations? localizations}) {
final l = localizations;
String figure(int n, int width) => l == null
? n.toString().padLeft(width, '0')
: termDigits(l, n, width: width);
return '${figure(date.year, 4)}-${figure(date.month, 2)}-'
'${figure(date.day, 2)}';
}