Padding class

A widget that insets its child by the given padding.

Mirrors Flutter's Padding widget API. Uses .apply() to merge CSS padding directly onto the child's root element — no wrapper div.

Note: Do not chain .apply() on a Padding instance. Jaspr's .apply() uses inherited elements that shadow each other. Instead, combine styles in a single .apply() call on the child.

Padding(
  padding: EdgeInsets.all(16),
  child: Text('Hello'),
)
Inheritance
Available extensions

Constructors

Padding({required EdgeInsets padding, required Component child, Key? key})
const

Properties

child Component
The widget below this widget in the tree.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one component replaces another component in the tree.
finalinherited
padding EdgeInsets
The amount of space by which to inset the child.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

apply({String? id, String? classes, Styles? styles, Map<String, String>? attributes, Map<String, EventCallback>? events}) Component

Available on Component, provided by the ComponentApplyExtension extension

build(BuildContext context) Component
Describes the part of the user interface represented by this component.
override
createElement() Element
Creates a StatelessElement to manage this component's location in the tree.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldRebuild(covariant Component newComponent) bool
Implement this method to determine whether a rebuild can be skipped.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited