MorphOrigin class

Captures the source geometry for a morph transition.

Created by inspecting a widget's RenderBox at the moment of interaction.

final box = context.findRenderObject() as RenderBox;
final position = box.localToGlobal(Offset.zero);
final origin = MorphOrigin(
  type: MorphOriginType.card,
  rect: position & box.size,
  borderRadius: 16.0,
);
Annotations

Constructors

MorphOrigin({required MorphOriginType type, required Rect rect, double borderRadius = 16.0})
const
MorphOrigin.fromContext(dynamic context, {MorphOriginType type = MorphOriginType.card, double borderRadius = 16.0})
Convenience constructor for a card-type origin captured from a widget.
factory

Properties

borderRadius double
Corner radius of the source widget.
final
hashCode int
The hash code for this object.
no setteroverride
rect Rect
The global-coordinate bounding rect of the source widget.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type MorphOriginType
The semantic kind of origin.
final

Methods

copyWith({MorphOriginType? type, Rect? rect, double? borderRadius}) MorphOrigin
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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