formatTime static method

String formatTime(
  1. BuildContext context,
  2. TimeOfDay timeOfDay, {
  3. bool use24HourFormat = true,
})

Implementation

static String formatTime(BuildContext context, TimeOfDay timeOfDay, {bool use24HourFormat = true}){
  final MaterialLocalizations localizations = MaterialLocalizations.of(context);
  return localizations.formatTimeOfDay(timeOfDay, alwaysUse24HourFormat: use24HourFormat);
}