StacOpacity class

A Stac model representing Flutter's Opacity widget.

A widget that makes its child partially transparent.

StacOpacity(
  opacity: 0.5,
  alwaysIncludeSemantics: false,
  child: StacText(data: 'Faded Text'),
)
{
  "type": "opacity",
  "opacity": 0.5,
  "alwaysIncludeSemantics": false,
  "child": {"type": "text", "data": "Faded Text"}
}
Inheritance
Annotations
  • @JsonSerializable()

Constructors

StacOpacity.new({required double opacity, bool? alwaysIncludeSemantics, StacWidget? child})
Creates a StacOpacity with the given properties.
const
StacOpacity.fromJson(Map<String, dynamic> json)
Creates a StacOpacity from JSON.
factory

Properties

alwaysIncludeSemantics bool?
Whether to include the opacity widget in the semantics tree. Defaults to false.
final
child StacWidget?
The widget below this widget in the tree.
final
hashCode int
The hash code for this object.
no setterinherited
jsonData Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
opacity double
The fraction to scale the child's alpha value. An opacity of 1.0 is fully opaque. An opacity of 0.0 is fully transparent.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
Widget type identifier.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this StacOpacity to JSON.
override
toString() String
A string representation of this object.
inherited

Operators

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