toMap method Null safety

Map<String, Object?> toMap(
  1. LoggerEntity item
)

Implementation

static Map<String, Object?> toMap(LoggerEntity item) {
  return <String, Object?>{
    // Date
    SqLiteRepository.Id.getAliasOrName(): item.id,
    LoggerRepository.LogLevel.getAliasOrName(): item.logLevel.name,
    LoggerRepository.Message.getAliasOrName(): item.message,
    LoggerRepository.Error.getAliasOrName(): item.error.toString(),
    LoggerRepository.LoggerName.getAliasOrName(): item.loggerName,
    LoggerRepository.Source.getAliasOrName(): item.source,
    LoggerRepository.TimeStamp.getAliasOrName(): item.timeStamp.millisecondsSinceEpoch,
  };
}