SegmentStyle class Null safety

Style description that determines color, size (ratio) and shape of Segment in SegmentDisplay.

To create your own segment style, extend this class and implement createHorizontalPath, createVerticalPath, createDiagonalForwardPath and createDiagonalBackwardPath methods.

To customize each segment individually, you can also override createPath* methods:

  • createPath7* for 7-segment display
  • createPath14* for 14-segment display

For example: if you want to change the shape of the top segment in 7-segment display, you can override createPath7A method. NOTE: createPath** methods use createHorizontalPath/createVerticalPath/createDiagonalBackwardPath/createDiagonalForwardPath by default so you don't have to override all createPath7* methods.

Implementers

Constructors

SegmentStyle({Size? segmentBaseSize, Color? enabledColor, Color? disabledColor})
const

Properties

disabledColor Color
Color of every disabled segment.
final
enabledColor Color
Color of every enabled segment.
final
hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
segmentBaseSize Size
Base size of every segment - used as a size ratio for each segment.
final

Methods

copyWith({Color? enabledColor, Color? disabledColor}) SegmentStyle
createColonPath(Size segmentSize, double padding) Path
Creates path for colon (:) segment.
createDecimalPointPath(Size segmentSize, double padding) Path
Creates path for decimal point (.) segment.
createDiagonalBackwardPath(SegmentPosition position, Size segmentSize) Path
Creates path for diagonal 'backward' (\) segments.
createDiagonalForwardPath(SegmentPosition position, Size segmentSize) Path
Creates path for diagonal 'forward' (/) segments.
createHorizontalPath(SegmentPosition position, Size segmentSize) Path
Creates path for horizontal (-) segments.
createPath14A(Size segmentSize, double padding) Path
Creates path for top segment in 14-segment display.
createPath14B(Size segmentSize, double padding) Path
Creates path for top right segment in 14-segment display.
createPath14C(Size segmentSize, double padding) Path
Creates path for bottom right segment in 14-segment display.
createPath14D(Size segmentSize, double padding) Path
Creates path for bottom segment in 14-segment display.
createPath14E(Size segmentSize, double padding) Path
Creates path for bottom left segment in 14-segment display.
createPath14F(Size segmentSize, double padding) Path
Creates path for top left segment in 14-segment display.
createPath14G1(Size segmentSize, double padding) Path
Creates path for middle left segment in 14-segment display.
createPath14G2(Size segmentSize, double padding) Path
Creates path for middle right segment in 14-segment display.
createPath14H(Size segmentSize, double padding) Path
Creates path for top left diagonal segment in 14-segment display.
createPath14I(Size segmentSize, double padding) Path
Creates path for top center vertical segment in 14-segment display.
createPath14J(Size segmentSize, double padding) Path
Creates path for top right diagonal segment in 14-segment display.
createPath14K(Size segmentSize, double padding) Path
Creates path for bottom left diagonal segment in 14-segment display.
createPath14L(Size segmentSize, double padding) Path
Creates path for bottom center vertical segment in 14-segment display.
createPath14M(Size segmentSize, double padding) Path
Creates path for bottom right diagonal segment in 14-segment display.
createPath16A1(Size segmentSize, double padding) Path
Creates path for top right horizontal segment in 16-segment display.
createPath16A2(Size segmentSize, double padding) Path
Creates path for top left horizontal segment in 16-segment display.
createPath16B(Size segmentSize, double padding) Path
Creates path for top right vertical segment in 16-segment display.
createPath16C(Size segmentSize, double padding) Path
Creates path for bottom right vertical segment in 14-segment display.
createPath16D1(Size segmentSize, double padding) Path
Creates path for bottom right horizontal segment in 16-segment display.
createPath16D2(Size segmentSize, double padding) Path
Creates path for bottom left horizontal segment in 16-segment display.
createPath16E(Size segmentSize, double padding) Path
Creates path for bottom left vertical segment in 16-segment display.
createPath16F(Size segmentSize, double padding) Path
Creates path for top left vertical segment in 16-segment display.
createPath16G1(Size segmentSize, double padding) Path
Creates path for middle left segment in 16-segment display.
createPath16G2(Size segmentSize, double padding) Path
Creates path for middle right segment in 16-segment display.
createPath16H(Size segmentSize, double padding) Path
Creates path for top left diagonal segment in 16-segment display.
createPath16I(Size segmentSize, double padding) Path
Creates path for top center vertical segment in 16-segment display.
createPath16J(Size segmentSize, double padding) Path
Creates path for top right diagonal segment in 16-segment display.
createPath16K(Size segmentSize, double padding) Path
Creates path for bottom left diagonal segment in 16-segment display.
createPath16L(Size segmentSize, double padding) Path
Creates path for bottom center segment in 16-segment display.
createPath16M(Size segmentSize, double padding) Path
Creates path for bottom right diagonal segment in 16-segment display.
createPath7A(Size segmentSize, double padding) Path
Creates path for top segment in 7-segment display.
createPath7B(Size segmentSize, double padding) Path
Creates path for top right segment in 7-segment display.
createPath7C(Size segmentSize, double padding) Path
Creates path for bottom right segment in 7-segment display.
createPath7D(Size segmentSize, double padding) Path
Creates path for bottom segment in 7-segment display.
createPath7E(Size segmentSize, double padding) Path
Creates path for bottom left segment in 7-segment display.
createPath7F(Size segmentSize, double padding) Path
Creates path for top left segment in 7-segment display.
createPath7G(Size segmentSize, double padding) Path
Creates path for middle segment in 7-segment display.
createVerticalPath(SegmentPosition position, Size segmentSize) Path
Creates path for vertical (|) segments.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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