Ruler class

A widget that displays a ruler in imperial or metric units.

Ruler.count is used to display a ruler with a fixed number of notches and defined by the notchCount parameter. Ruler.dynamic is used to display a ruler with a fixed width in pixels and defined by the notchWidth parameter. Ruler.real is used to display a ruler with a fixed width in pixels and defined by the notchWidth parameter.

Inheritance

Constructors

Ruler.count(DistanceUnit notchCount, {Axis axis = Axis.horizontal, RulerSide? notchSide, TextStyle? numberTextStyle, RulerSide? numberSide, double? numberSpacing, double? notchScaleFactor, Color? notchColor, bool? showBase, double? thickness, Key? key})
const
Ruler.dynamic(DistanceUnit notchWidth, {Axis axis = Axis.horizontal, RulerSide? numberSide, RulerSide? notchSide, TextStyle? numberTextStyle, double? notchScaleFactor, Color? notchColor, bool? showBase, double? numberSpacing, double? thickness, Key? key})
const
Ruler.real({MeasureSystem system = MeasureSystem.metric, int graduation = 8, Key? key, Axis axis = Axis.horizontal, RulerSide? numberSide, RulerSide? notchSide, TextStyle? numberTextStyle, double? notchScaleFactor, Color? notchColor, bool? showBase, double? numberSpacing, double? thickness})

Properties

axis Axis
The axis of the ruler Axis.horizontal or Axis.vertical
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
notchColor Color?
The notches and base color
final
notchCount DistanceUnit?
The number of notches used with _RulerType.count
final
notchScaleFactor double?
The notches and base scale factor
final
notchSide RulerSide?
The side of the notches and the base to the ruler
final
notchWidth DistanceUnit?
The notch width in pixels used with _RulerType.dynamic the distance type used for graduation only
final
numberSide RulerSide?
The side of the numbers to the notches
final
numberSpacing double?
The spacing between the numbers and the notches
final
numberTextStyle TextStyle?
Used for the numbers
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showBase bool?
Show the base of the ruler
final
thickness double?
The thickness of notches and base
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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