SassString class
A SassScript string.
Strings can either be quoted or unquoted. Unquoted strings are usually CSS identifiers, but they may contain any text.
- Inheritance
- Available extensions
- Annotations
-
- @sealed
Constructors
- SassString(String _text, {bool quotes = true})
- Creates a string with the given text.
- SassString.empty({bool quotes = true})
-
Creates an empty string.
factory
Properties
-
asList
→ List<
Value> -
This value as a list.
no setterinherited
- hasBrackets → bool
-
Whether this value as a list has brackets.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
- hasQuotes → bool
-
Whether this string has quotes.
no setter
- isTruthy → bool
-
Whether the value counts as
true
in an@if
statement and other contexts.no setterinherited - realNull → Value?
-
Returns Dart's
null
value if this is sassNull, and returnsthis
otherwise.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sassLength → int
-
Sass's notion of the length of this string.
no setter
- separator → ListSeparator
-
The separator for this value as a list.
no setterinherited
- text → String
-
The contents of the string.
no setter
Methods
-
assertBoolean(
[String? name]) → SassBoolean -
Throws a
SassScriptException
ifthis
isn't a boolean.inherited -
assertCalculation(
[String? name]) → SassCalculation -
Throws a
SassScriptException
ifthis
isn't a calculation.inherited -
assertColor(
[String? name]) → SassColor -
Throws a
SassScriptException
ifthis
isn't a color.inherited -
assertFunction(
[String? name]) → SassFunction -
Throws a
SassScriptException
ifthis
isn't a function reference.inherited -
assertMap(
[String? name]) → SassMap -
Throws a
SassScriptException
ifthis
isn't a map.inherited -
assertMixin(
[String? name]) → SassMixin -
Throws a
SassScriptException
ifthis
isn't a mixin reference.inherited -
assertNumber(
[String? name]) → SassNumber -
Throws a
SassScriptException
ifthis
isn't a number.inherited -
assertString(
[String? name]) → SassString -
Throws a
SassScriptException
ifthis
isn't a string.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sassIndexToListIndex(
Value sassIndex, [String? name]) → int -
Converts
sassIndex
into a Dart-style index into the list returned by asList.inherited -
sassIndexToRuneIndex(
Value sassIndex, [String? name]) → int -
Converts
sassIndex
into a Dart-style index into text.runes
. -
sassIndexToStringIndex(
Value sassIndex, [String? name]) → int -
Converts
sassIndex
into a Dart-style index into text. -
toCssString(
{bool quote = true}) → String -
Returns a valid CSS representation of
this
.inherited -
toString(
) → String -
Returns a string representation of
this
.inherited -
tryMap(
) → SassMap? -
Returns
this
as a SassMap if it is one (including empty lists, which count as empty maps) or returnsnull
if it's not.inherited -
withListContents(
Iterable< Value> contents, {ListSeparator? separator, bool? brackets}) → SassList -
Returns a new list containing
contents
that defaults to this value's separator and brackets.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override