asId property

String get asId

Converts the string to a normalized ID (lowercase, underscores, no spaces or special chars)

Implementation

String get asId => trim().toLowerCase().replaceAll(RegExp(r'[^a-z0-9]'), '_');