toJson method
Converts the expiry configuration to a JSON representation.
Implementation
Map<String, dynamic> toJson() => {
'startTime': DateFormat(kDateFormat).format(startTime),
'unit': unit.toString().split('.').last,
'duration': duration,
}..removeWhere((_, value) => value == null);