fromMap static method

TimeOfDay? fromMap(
  1. dynamic map
)

Implementation

static TimeOfDay? fromMap(dynamic map) {
  try {
    if (map == null || map!['hour'] == null || map!['minute'] == null) {
      return null;
    }

    return TimeOfDay(
      hour: map['hour'] is int ? map['hour'] : int.parse(map['hour']),
      minute: map['minute'] is int ? map['minute'] : int.parse(map['minute']),
    );
  } catch (e) {
    debugPrint("ModernFormTimeOfDayExtension.fromMap() --> $e");
    return null;
  }
}