Converts the state to a JSON map.
Returns:
@override Map<String, dynamic> toJson() { return { "type": "opened", "data": data.toJson(), }; }