toJson method

  1. @override
Map<String, dynamic> toJson()
override

Serializes an Availability to its JSON representation.

Implementation

@override
Map<String, dynamic> toJson() => {
      "state": state.value,
      if (since != null) "since": since?.toIso8601String(),
      if (until != null) "until": until?.toIso8601String(),
    };