operator [] method

String operator [](
  1. String className
)

Looks up the generated scoped class name for author className.

Returns the scoped class name if defined in the stylesheet (e.g. 'card_title__a1b2c3d'). If className was not present in the scoped stylesheet (such as a global utility class like 'flex' or 'p-4'), returns className unchanged so utility classes pass through safely without throwing.

final cls = styles['card'];      // Scoped: 'card_card__a1b2c3d'
final util = styles['flex'];     // Pass-through: 'flex'

Implementation

String operator [](String className) => classes[className] ?? className;