TestHelpersTestClock.fromJson constructor

TestHelpersTestClock.fromJson(
  1. Object? json
)

Implementation

factory TestHelpersTestClock.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return TestHelpersTestClock(
    created:
        DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
    deletesAfter: DateTime.fromMillisecondsSinceEpoch(
        (map['deletes_after'] as int).toInt()),
    frozenTime: DateTime.fromMillisecondsSinceEpoch(
        (map['frozen_time'] as int).toInt()),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    name: map['name'] == null ? null : (map['name'] as String),
    status: TestHelpersTestClockStatus.fromJson(map['status']),
  );
}