BoxShadowParser class
Parses box shadows according to Tokens Studio and provides methods to return Flutter code.
Supports single shadows but also a list of shadows. Also supports
dropShadow
and innerShadow
shadow types from design tokens.
E.g. Figma design tokens: "value": { "x": "4", "y": "2", "spread": "3", "color": "#FFFFFF", "blur": "5", "type": "dropShadow" }
Flutter generated code: BoxShadow( color: Color(0xFFFFFFFF), offset: Offset(4.0, 2.0), blurRadius: 5.0, spreadRadius: 3.0, blurStyle: BlurStyle.normal, )
- Inheritance
-
- Object
- DesignTokenParser
- BoxShadowParser
Constructors
- BoxShadowParser([int indentationLevel = 1, BuilderConfig? config])
- Constructs a BoxShadowParser.
Properties
- config → BuilderConfig?
-
The global config of the builder.
finalinherited
- flutterType → String
-
Returns a string representing the Flutter type to which the token
should be converted.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- indentationLevel → int
-
The indentation level that should be used while generating code.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tokenType
→ List<
String> -
A list of token types that should use this parser.
no setteroverride
Methods
-
buildLerp(
String token) → String -
Builds Flutter code that's linearly interpolating the current type.
override
-
buildValue(
dynamic value) → String -
Builds the value for the specific type.
override
-
indent(
[int add = 0]) → String -
The indentation string for indentationLevel.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
dynamic value, {bool isConst = true}) → String -
Parses the
value
and returns flutter readable code.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited