DisplayMode class Null safety

Display mode and a bit more. This selects between number base, float versus integer, and complex versus normal. The actual code is almost all concerned with formatting and display, but this is also a convenient place to select operations based on integer/float/complex mode.



commaDistance int
displayName String
How this mode is shown on the LCD display
hashCode int
The hash code for this object.
isFloatMode bool
radix int
Put calculator in floating-point mode, displaying fractionDigits
rightJustify bool
Are digits right-justified in this mode? If not, they'll be left-justified, like " 1.0 ".
runtimeType Type
A representation of the runtime type of the object.


addCommas(String s, bool intToo) String
convertValuesTo(DisplayMode next, Model<ProgramOperation> model) → void
Convert values in the model when switching between float and int, and vice-versa. We're switching from this mode to next. The 16C does interesting things with x and y here.
format(Value v, Model<ProgramOperation> m) String
leastSignificantDigit(double value) int
Gives the least significant digit when value is displayed, where the units digit is 0, and negative is to the right of the decimal. For example, for FIX-3, gives -3 (10^-3 is 0.001), unless the value is such that scientific notation would be used.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
round(Value x) Value
select<R, A>(DisplayModeSelector<R, A> selector, A arg) → R
Select something based on whether we're in an int mode or a float mode.
setComplexMode(Model<ProgramOperation> m, bool v) → void
signMode(IntegerSignMode integerSignMode) SignMode
Give the calculator's effective sign mode, considering the current display mode (which might be float), and the sign mode that was last set when the calculator was in integer mode (which might be now).
toJson() String
toString() String
A string representation of this object.
tryParse(String s, NumStatus m) Value?


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

Static Properties

bin IntegerDisplayMode
decimal IntegerDisplayMode
hex IntegerDisplayMode
oct IntegerDisplayMode

Static Methods

eng(int fractionDigits, bool complex) DisplayMode
fix(int fractionDigits, bool complex) DisplayMode
float(int fractionDigits) DisplayMode
digits after the decimal point. If digits is 10, always display in scientific notation, as per the 16C manual, page 56.
fromJson(dynamic val, bool isComplex) DisplayMode
sci(int fractionDigits, bool complex) DisplayMode