UnixTimestampConverterNullable constructor

const UnixTimestampConverterNullable()

Implements serialization and deserialization for DateTime from and to int.

The integer is expected to be a UTC Unix timestamp.

Usage:

@JsonSerializable()
class MyClass {
  @JsonKey(name: 'timestamp')
  @UnixTimestampConverter()
  final DateTime timestamp;

  const MyClass(this.timestamp);
}

Implementation

const UnixTimestampConverterNullable();