ClassNameBuilder class
A StringBuffer-backed CSS class builder optimized for adding classNames, with support for blacklisting CSS classes.
Constructors
- ClassNameBuilder()
-
Creates a new, empty
ClassNameBuilderinstance. - ClassNameBuilder.fromProps(Map? props)
-
Creates a new
ClassNameBuilderwith the CssClassPropsMixin.className values and excludes the CssClassPropsMixin.classNameBlacklist values if specified within the providedpropsMap. - ClassNameBuilder.merged(ClassNameBuilder a, ClassNameBuilder b)
-
Creates a new
ClassNameBuilderwith_classNamesBufferand_blacklistBuffermerged fromaandb.
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
classNames ifshouldAddistrue. -
addFromProps(
Map? props) → void -
Adds the CssClassPropsMixin.className and excludes the CssClassPropsMixin.classNameBlacklist values
if specified within the provided
propsMap. -
blacklist(
String? className, [bool shouldBlacklist = true]) → void -
Blacklists all of the CSS classes represented by a space-delimited list of
classNames ifshouldBlacklististrue. -
merge(
ClassNameBuilder other) → void -
Merges the classes and blacklists from
otherinto 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