toMap method
Implementation
Map<String, Object?> toMap() {
if (!visible) return const <String, Object?>{'visible': false};
final value = label!;
if (value.trim().isEmpty) {
throw ArgumentError.value(value, 'label', 'must not be blank');
}
return <String, Object?>{'visible': true, 'label': value};
}