TSimpleOperation class

A class representing a simple arithmetic operation with two operands and one operator.

Inheritance
  • Object
  • TModel
  • TSimpleOperation

Constructors

TSimpleOperation({List<String> operands = const <String>[], String? operator, String? result, bool isLastOperandPercent = false})
Constructs a new TSimpleOperation instance with the given operands, operator, and result.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
hasOperator bool
Checks if the current operation has an operator.
no setter
isEmpty bool
Checks if the current operation is empty.
no setter
isLastOperandPercent bool
final
isValid bool
Checks if the current operation is valid.
no setter
lastOperand String
Returns the last operand of the current operation.
no setter
length int
Returns the total length of the current operation.
no setter
operands List<String>
final
operator String?
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
result String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

append(String char) TSimpleOperation
Appends a given character to the current operation.
assignValue<T>(T? value, {T? defaultValue, bool loose = true}) → T?
inherited
clear() TSimpleOperation
Clears the current operation.
clone() TSimpleOperation
Creates a clone of the current operation.
override
copyWith({List<String>? operands, String? operator, String? result, bool? isLastOperandPercent}) TSimpleOperation
Creates a copy of the current operation with the specified operands, operator, and result.
override
copyWithDefaults() → TModel
inherited
deleteLastCharacter() TSimpleOperation
Deletes the last character of the current operation.
evaluate() TSimpleOperation
Evaluates the current operation and returns the result.
format() String
Returns a formatted string representation of the current operation.
merge(covariant TSimpleOperation model) TSimpleOperation
Merges the current operation with another operation.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replaceLastOperand(String operand) TSimpleOperation
Replaces the last operand of the current operation with the given operand.
toString() String
Returns a string representation of the current operation.

Operators

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