fromMap method Null safety

LoggerEntity fromMap(
  1. Map<String, Object?> map
)

Implementation

static LoggerEntity fromMap(Map<String, Object?> map) {
  final level = LogLevel.values.firstWhere((element) => element.name == map[LoggerRepository.LogLevel.columnName]);

  return LoggerEntity(
    id: map[SqLiteRepository.Id.columnName] as String,
    logLevel: level,
    message: map[LoggerRepository.Message.columnName] as String,
// data: map[LoggerRepository.Data.columnName] as Map<String, dynamic>? data,
    error: nullOrString(map[LoggerRepository.Error.columnName]),
    loggerName: nullOrString(map[LoggerRepository.LoggerName.columnName]),
    source: nullOrString(map[LoggerRepository.Source.columnName]),
// stackTrace: nullOrString(map[LoggerRepository.StackTrace.columnName]),
    timeStamp: nullOrDateTime(map[LoggerRepository.TimeStamp.columnName]),
  );
}