Map<String, Object?> encode() => { if (x != null) 'x': x!.toTfJson(), if (y != null) 'y': y!.toTfJson(), };