API Reference 0.7.1rikulo_modelFoo

Foo class

class Foo extends ListModel {
 String operator [](int index) => "";
 /** Returns the length of the list.
  */
 int get length=>0;
}

Extends

DataModel > ListModel > Foo

Properties

final int length #

Returns the length of the list.

int get length=>0;

final DataEvents on #

inherited from DataModel

Returns DataEvents for adding or removing event listeners.

DataEvents get on => _on;

Operators

String operator [](int index) #

Returns the value at the specified index.

docs inherited from ListModel
String operator [](int index) => "";

Methods

void addEventListener(String type, DataEventListener listener) #

inherited from DataModel

Adds an event listener. addEventListener("select", listener) is the same as on.select.add(listener).

void addEventListener(String type, DataEventListener listener) {
 if (listener == null)
   throw new ArgumentError("listener");

 bool first = false;
 _listeners.putIfAbsent(type, () {
   first = true;
   return [];
 }).add(listener);
}

void removeEventListener(String type, DataEventListener listener) #

inherited from DataModel

Removes an event listener. removeEventListener("select", listener) is the same as on.select.remove(listener).

void removeEventListener(String type, DataEventListener listener) {
 final list = _listeners[type];
 if (list != null)
   list.remove(listener);
}

bool sendEvent(DataEvent event) #

inherited from DataModel

Sends an event to this model.

Example: `model.sendEvent(new ListDataEvent(model, "select"))</code>.

bool sendEvent(DataEvent event) {
 final bool
   b1 = _sendEvent(event, _listeners[event.type]),
   b2 = _sendEvent(event, _listeners['all']);
 return b1 || b2;
}