camelCase property Null safety

String camelCase

convert to camel case format: foo bar -> FooBar, or an empty string if it is blank

Implementation

String get camelCase => underscored.splitMapJoin('_',
    onMatch: (m) => '',
    onNonMatch: (n) => n.isEmpty
        ? ''
        : (n.length == 1)
            ? n.toUpperCase()
            : '${n[0].toUpperCase()}${n.substring(1).toLowerCase()}');