CallableItem mixin

Provides the required methods for touch bar items that have methods or children that can have methods.

All the classes that uses this mixin must have its actions implemented following the example below:

class ClassWithAction extends AbstractTouchBarItem with CallableItem {
  // [onAction] store just an unique identifier of the implementation.
  final Identifier _onAction = Identifier.uniq();

  // The setter will change only the implementation stored in [methods].
  set onAction(Function newValue) {
    this.methods['$_onAction'] = newValue;
  }

  // [methods] will be used as single source of truth to the
  // implementation and [_onAction] will be
  // used in the [toMap()].
  ClassWithAction(Function onAction) :  super() {
    this.onAction = onAction;
  }
}
Superclass Constraints
Mixin Applications

Properties

children List<TouchBarItem>?
The subitems of this.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
id int
The unique sequential identifier of this.
finalinherited
methods Map<String, Function>
Stores all the methods of this.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
Name of the touch bar item type that will be used to inform the specific platform implementation which TouchBarItem must be rendered/updated. This is important because the platform channel communication is performed through subset of the primitive types. See https://flutter.dev/docs/development/platform-integration/platform-channels#codec.
no setterinherited

Methods

callMethod(String name, dynamic arguments) bool
Searches the method named name in this and execute it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Convert all the TouchBarItem data to a Map that will be used in the platform channel communication.
inherited
toString() String
A string representation of this object.
inherited
updateProperty(String name, {dynamic newValue}) → void
Updates the property named name with a newValue.
inherited

Operators

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