LighthouseApp/lib/core/utils/json_converters.dart
speakeloudest 75d4c48e41
Some checks failed
Build Windows / build (push) Has been cancelled
feat: 源码提交
2025-10-19 23:30:54 -07:00

12 lines
312 B
Dart
Executable File

import 'package:freezed_annotation/freezed_annotation.dart';
class IntervalInSecondsConverter implements JsonConverter<Duration, int> {
const IntervalInSecondsConverter();
@override
Duration fromJson(int json) => Duration(seconds: json);
@override
int toJson(Duration object) => object.inSeconds;
}