@override Map<String, dynamic> toJson() { return { if (position != null) 'position': kIsWeb ? position!.value : jsonEncode(position!.value), }; }