LimitedOperation class Null safety

Operations that do something when the key is pressed, even when the calculator is in program entry state. They're called "limited," because the set of handleXXX() calls is limited to those supported by ProgramEntry.

It might seem counter-intuitive, but all Limited operations are NormalOperations. Normal operations are the operations whose pressed functions execute on an ActiveState, either Resting or DigitEntry. Limited operations have pressed callbacks that execute on a LimitedState, and ActiveState is a subtype of LimitedState. Therefore, NormalOperation is, conceptually, a supertype of LimitedOperation - there's a contravariant relationship between the operations and the types, because the operations, in essence, take an operation as argument.

Implemented types


LimitedOperation({required void pressed(LimitedState), required String name})


arg OperationArg?
A description of an argument, if there is one. For example, the STO operation has an argument to indicate which register to store to.
read-only, override
floatCalc → (void Function?(Model<ProgramOperation> m)?)
The calculation performed when the calculator is in floating-point mode.
read-only, override
hashCode int
The hash code for this object. [...]
read-only, inherited
intCalc → (void Function?(Model<ProgramOperation> m)?)
The calculation performed when the calculator is in integer mode.
read-only, override
maxArg int
0 if this operation doesn't take an argument
read-only, inherited
name String
final, inherited
numericValue int?
Give the numeric value of a number key. cf. tests.dart, SelfTests.testNumbers().
read-only, inherited
programDisplay String
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


calcDefinedFor<T>(Controller controller, T? calc) → T?
By default, operations, if present, work for all kinds of controllers, but cf. BranchingOperation
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
possiblyAlterStackLift(Controller c) → void
Either enable or disable stack lift, if appropriate, after this operation's calculation is done. This will not be called if this operation doesn't have a calculation (intCalc or floatCalc on itself, or on its argument).
pressed(LimitedState arg) → void
What to do when the key is pressed.
toString() String
A string representation of this object. [...]


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