$JinjaBody class
Represents a Jinja template block with opening and closing commands. $JinjaBody creates template structures that have both opening and closing directives with content in between. This is useful for control structures like loops, conditionals, and custom blocks that wrap other content. Example usage:
final forLoop = $JinjaBody(
commandUp: 'for item in items',
commandDown: 'endfor',
children: [
CustomTag('li').addChild(TextTag('{{ item.name }}')),
],
);
// Generates: {% for item in items %}<li>{{ item.name }}</li>{% endfor %}
- Inheritance
- Implementers
Constructors
-
$JinjaBody({required String commandUp, required List<
Tag> ? children, required String commandDown})
Properties
- attrs ↔ Map
-
getter/setter pairinherited
-
children
↔ List<
Tag> -
getter/setter pairinherited
- classes ↔ List
-
getter/setter pairinherited
- commandDown ↔ String
-
getter/setter pair
- commandUp ↔ String
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tagName → String
-
no setterinherited
- type ↔ TagType
-
getter/setter pairinherited
Methods
-
addAttr(
String key, dynamic value) → Tag -
inherited
-
addChild(
Tag child) → Tag -
inherited
-
addClass(
dynamic className) → Tag -
inherited
-
addStyle(
String property, String value) → Tag -
inherited
-
attrKey(
dynamic key) → String -
inherited
-
clearChildren(
) → Tag -
inherited
-
clearClasses(
) → Tag -
inherited
-
clearStyles(
) → Tag -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeAttr(
String key) → Tag -
inherited
-
removeChild(
Tag child) → Tag -
inherited
-
removeClass(
String className) → Tag -
inherited
-
removeStyle(
String property) → Tag -
inherited
-
setClass(
String className) → Tag -
inherited
-
setId(
String id) → Tag -
inherited
-
setStyle(
String property, String value) → Tag -
inherited
-
toHtml(
) → String -
override
-
toString(
{bool pretty = false}) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited