name property

String? name
final

The optional human-readable component name prefix (e.g. 'card', 'button').

When non-null, generated class names take the form '${name}_${className}__$hash' (e.g. 'card_title__a1b2c3d'). When null, they take the form '${className}__$hash'. Specifying a name makes elements easier to identify in browser DevTools.

final styles = scopedCss('.header { font-size: 16px; }', name: 'header');
print(styles.name); // 'header'

Implementation

final String? name;