ModelTimestamp.fromJson constructor

ModelTimestamp.fromJson(
  1. DynamicMap json
)

Convert from json map to ModelTimestamp.

jsonのマップからModelTimestampに変換します。

Implementation

factory ModelTimestamp.fromJson(DynamicMap json) {
  final timestamp = json.get(
    kTimeKey,
    DateTime.now().millisecondsSinceEpoch,
  );
  return ModelTimestamp.fromServer(
    DateTime.fromMillisecondsSinceEpoch(timestamp),
  );
}