2024-02-15 19:39:35 +03:30
|
|
|
import 'package:dart_mappable/dart_mappable.dart';
|
2023-12-01 12:56:24 +03:30
|
|
|
|
2024-02-15 19:39:35 +03:30
|
|
|
class IntervalInSecondsMapper extends SimpleMapper<Duration> {
|
|
|
|
|
const IntervalInSecondsMapper();
|
2023-12-01 12:56:24 +03:30
|
|
|
|
|
|
|
|
@override
|
2024-02-15 19:39:35 +03:30
|
|
|
Duration decode(dynamic value) => Duration(seconds: value as int);
|
2023-12-01 12:56:24 +03:30
|
|
|
|
|
|
|
|
@override
|
2024-02-15 19:39:35 +03:30
|
|
|
dynamic encode(Duration self) => self.inSeconds;
|
2023-12-01 12:56:24 +03:30
|
|
|
}
|