ClassNameBuilder class
A StringBuffer-backed CSS class builder optimized for adding classNames, with support for blacklisting CSS classes.
Constructors
- ClassNameBuilder()
-
Creates a new, empty
ClassNameBuilder
instance. - ClassNameBuilder.fromProps(Map? props)
-
Creates a new
ClassNameBuilder
with the CssClassPropsMixin.className values and excludes the CssClassPropsMixin.classNameBlacklist values if specified within the providedprops
Map. - ClassNameBuilder.merged(ClassNameBuilder a, ClassNameBuilder b)
-
Creates a new
ClassNameBuilder
with_classNamesBuffer
and_blacklistBuffer
merged froma
andb
.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
String? className, [bool shouldAdd = true]) → void -
Adds all of the CSS classes represented by a space-delimited list of
className
s ifshouldAdd
istrue
. -
addFromProps(
Map? props) → void -
Adds the CssClassPropsMixin.className and excludes the CssClassPropsMixin.classNameBlacklist values
if specified within the provided
props
Map. -
blacklist(
String? className, [bool shouldBlacklist = true]) → void -
Blacklists all of the CSS classes represented by a space-delimited list of
className
s ifshouldBlacklist
istrue
. -
merge(
ClassNameBuilder other) → void -
Merges the classes and blacklists from
other
into this builder. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toClassName(
) → String - Returns a String representation of the built className, which includes any added classes, and none of the blacklisted classes.
-
toClassNameBlacklist(
) → String? - Returns a String representation of only the blacklisted classes.
-
toProps(
) → Map - Returns a Map with the CssClassPropsMixin.className and CssClassPropsMixin.classNameBlacklist props populated from the return values of toClassName and toClassNameBlacklist, respectively.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited