DynamicCalculator class

DynamicCalculator

{@tool sample}

This example shows a simple DynamicCalculator.

DynamicCalculator(
  value: 123.45,
  hideExpression: true,
  onChanged: (key, value, expression) {
    /*...*/
  },
  theme: const CalculatorThemeData(
    displayColor: Colors.black,
    displayStyle: const TextStyle(fontSize: 80, color: Colors.yellow),
  ),
)

{@end-tool}

Inheritance

Constructors

DynamicCalculator({Key? key, CalculatorTheme? theme, bool hideExpression = false, bool? showCalculatorDisplay = false, double value = 0, CalcChanged? onChanged, dynamic onTappedDisplay(double?, TapDownDetails)?, NumberFormat? numberFormat, int maximumDigits = 10, bool hideSurroundingBorder = false, bool autofocus = false, FocusNode? focusNode, CalculatorController? controller})
const

Properties

autofocus bool
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
final
controller → CalculatorController?
Controller for calculator.
final
focusNode FocusNode?
An optional focus node to use as the focus node for this widget.
final
hashCode int
The hash code for this object.
no setterinherited
hideExpression bool
Whether to show expression area.
final
hideSurroundingBorder bool
Whether to show surrounding borders.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maximumDigits int
Maximum number of digits on display.
final
numberFormat → NumberFormat?
The NumberFormat used for display
final
onChanged CalcChanged?
Called when the button is tapped or the value is changed.
final
onTappedDisplay → (dynamic Function(double?, TapDownDetails)?)
Called when the display area is tapped.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showCalculatorDisplay bool?
Whether to show calculator display.
final
theme CalculatorTheme?
Visual properties for this widget.
final
value double
The value currently displayed on this calculator.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() DynamicCalculatorState
Creates the mutable state for this widget at a given location in the tree.
override
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