valueOrNull method

String? valueOrNull()

The text, or null when empty (handy for optional API fields). controller.valueOrNull()

Implementation

String? valueOrNull() => text.isEmpty ? null : text;