format method

String format (BuildContext context)

Returns the localized string representation of this time of day.

This is a shortcut for MaterialLocalizations.formatTimeOfDay.

Implementation

String format(BuildContext context) {
  assert(debugCheckHasMediaQuery(context));
  assert(debugCheckHasMaterialLocalizations(context));
  final MaterialLocalizations localizations = MaterialLocalizations.of(context);
  return localizations.formatTimeOfDay(
    this,
    alwaysUse24HourFormat: MediaQuery.of(context).alwaysUse24HourFormat,
  );
}