AcceleraxLayer constructor
const
AcceleraxLayer({})
A Layer
in an XL
. These by themselves are not Widget
s.
Each Layer
serves as a blueprint for transformations to its child
within its parent and contains all the animatable properties.
Keep in mind that axes will depend on device orientation.
The xOffset
, yOffset
, xRotation
, yRotation
, and zRotationByX
are reactionary to their respective axes when it comes to
AccelerometerEvent
s.
The zRotationByGyro
, however, is a secondary Z-axis
"spin" factor whose core value is derived from GyroscopeEvent
s.
- This means that samples from the gyroscope for Z-axis "spins"
with this property, according to
Normalization.samplingRate
, will spike but return to0
immediately once the device has finished "spinning".
Implementation
const AcceleraxLayer({
Key? key,
double xOffset = 0.0,
double yOffset = 0.0,
double xRotation = 0.0,
double yRotation = 0.0,
double zRotationByX = 0.0,
double zRotationByGyro = 0.0,
bool enable3d = true,
double dimensionalOffset = 0.001,
Offset offset = const Offset(0, 0),
Widget? child,
}) : super(
key: key,
xOffset: xOffset,
yOffset: yOffset,
xRotation: xRotation,
yRotation: yRotation,
zRotationByX: zRotationByX,
zRotationByGyro: zRotationByGyro,
enable3d: enable3d,
dimensionalOffset: dimensionalOffset,
offset: offset,
child: child ?? const SizedBox(),
);