Map<String, dynamic> toJson() { return { 'type': type, 'scope': scope, 'elements': elements?.map((e) => e.toJson()).toList(), 'label': label, 'text': text, 'options': options, }; }