Scalar class

A Scalar provides an opportunity to scale axis-based double data. Default constructor takes named paramters per axis. Use Scalar.xy as a shortcut to only provide positional double values.

  • Scalar.xy(5) is equivalent to Scalar(horizontal: 5, vertical: 5) and still const.

For use with Foils

Accelerometer sensor data may be scaled independently before they translate to gradient "twinkling" transformation (offset/translation).

Scale up the motion factor by providing Scalar.horizontal or Scalar.vertical a value greater than 1.0, or scale down the influence by providing 0 <= scalar <= 1.0.

scaling accelerometer data

For use with Rolls

In the case of a Roll, a Scalar object provides a means to direct animation of the gradient if isAnimated is true. Also see the min and max values.

Mixed in types

Constructors

Scalar({double horizontal = 1.0, double vertical = 1.0})
A Scalar provides an opportunity to scale axis-based double data. Default constructor takes named paramters per axis. Use Scalar.xy as a shortcut to only provide positional double values.
const
Scalar.xy(double x, [double? y])
Positionally provide an x or Scalar.horizontal value then a y or Scalar.vertical value; returns a constructed Scalar object.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
horizontal double
A double that defaults to 1.0 that scales Foil data.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vertical double
A double that defaults to 1.0 that scales Foil data.
final

Methods

debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
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
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

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

Constants

identity → const Scalar
A static Scalar with both horizontal and vertical properties equal to 1.0.