StacPlaceholder class

A Stac model representing Flutter's Placeholder widget.

Draws a simple box to visualize where a widget will be added in the future. Useful during development to indicate unimplemented parts of the UI.

Dart Example:

StacPlaceholder(
  fallbackWidth: 200,
  fallbackHeight: 100,
  strokeWidth: 2,
)

JSON Example:

{
  "type": "placeholder",
  "fallbackWidth": 200,
  "fallbackHeight": 100,
  "strokeWidth": 2
}

See also:

  • Flutter's Placeholder documentation (https://api.flutter.dev/flutter/widgets/Placeholder-class.html)
Inheritance
Available extensions
Annotations
  • @JsonSerializable.new(explicitToJson: true)

Constructors

StacPlaceholder({double? fallbackWidth, double? fallbackHeight, double? strokeWidth, String? color, StacWidget? child})
Creates a StacPlaceholder.
const
StacPlaceholder.fromJson(Map<String, dynamic> json)
Creates a StacPlaceholder from a JSON map.
factory

Properties

child → StacWidget?
Optional child to display inside the placeholder.
final
color → String?
The color of the placeholder's stroke.
final
fallbackHeight → double?
The height to use when the placeholder has unconstrained height.
final
fallbackWidth → double?
The width to use when the placeholder has unconstrained width.
final
hashCode → int
The hash code for this object.
no setterinherited
jsonData → Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
strokeWidth → double?
The stroke width used to draw the placeholder borders.
final
type → String
Widget type identifier.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(BuildContext context) → Widget?

Available on StacWidget?, provided by the StacWidgetParser extension

parsePreferredSizeWidget(BuildContext context) → PreferredSizeWidget?

Available on StacWidget?, provided by the StacWidgetParser extension

Parses a widget for a slot that needs a PreferredSizeWidget, such as a scaffold's appBar or an app bar's bottom.
toJson() → Map<String, dynamic>
Converts this StacPlaceholder to a JSON map.
override
toString() → String
A string representation of this object.
inherited

Operators

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