@override Map<String, dynamic> toJson() => <String, Object?>{ 'type': type, 'flags': flags?.map((f) => f.toJson()).toList(), };