Motion class

A fancy widget that adds a gyroscope-based motion effect to its child.

Platform-specific operations are performed using the static instance.

Inheritance

Constructors

Motion({Key? key, MotionController? controller, required Widget child, GlareConfiguration? glare = const GlareConfiguration(), ShadowConfiguration? shadow = const ShadowConfiguration(), TranslationConfiguration? translation = const TranslationConfiguration(), BorderRadius? borderRadius, FilterQuality? filterQuality = defaultFilterQuality})
Creates a Motion widget with the given child and controller, applying all of the default effects.
const
Motion.elevated({Key? key, required int elevation, required Widget child, MotionController? controller, BorderRadius? borderRadius, bool glare = true, bool shadow = true, bool translation = true, FilterQuality? filterQuality = defaultFilterQuality})
Creates a Motion widget by setting configurations according to the elevation of the widget.
factory
Motion.only({Key? key, MotionController? controller, required Widget child, GlareConfiguration? glare, ShadowConfiguration? shadow, TranslationConfiguration? translation, BorderRadius? borderRadius, FilterQuality? filterQuality = defaultFilterQuality})
Creates a Motion widget with the given child and controller, but only applying the rotation effect by default.
const

Properties

borderRadius BorderRadius?
An optional border radius to apply to the widget.
final
child Widget
The target widget.
final
controller MotionController?
The controller that holds the widget's motion data.
final
filterQuality FilterQuality?
The filter quality with which to apply the transform as a bitmap operation.
final
glare GlareConfiguration?
Whether to apply a dynamic glare effect to the widget.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadow ShadowConfiguration?
Whether to apply a dynamic shadow to the widget.
final
translation TranslationConfiguration?
Whether to apply a dynamic translation effect on the widget's X and Y positions.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<Motion>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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

Static Properties

instance MotionPlatform
The MotionPlatform instance to perform platform-specific operations.
final