API Reference 0.3.24dart_web_toolkit_uiSimplePanelIterator

SimplePanelIterator class

class SimplePanelIterator implements Iterator<Widget> {

 bool hasElement = false;
 Widget returned = null;
 SimplePanel _panel;

 SimplePanelIterator(this._panel) {
   hasElement = this._panel.widget != null;
 }

 /**
  * Returns whether the [Iterator] has elements left.
  */
 bool moveNext() {
   return hasElement;
 }
 
 Widget get current => _getCurrent();

 /**
  * Gets the next element in the iteration. Throws a
  * [StateError] if no element is left.
  */
 Widget _getCurrent() {
   if (!hasElement || (this._panel.widget == null)) {
     throw new Exception("NoSuchElement");
   }
   hasElement = false;
   return (returned = this._panel.widget);
 }

 remove() {
   if (returned != null) {
     _panel.remove(returned);
   }
 }
}

Implements

Iterator<Widget>

Constructors

new SimplePanelIterator(SimplePanel _panel) #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
SimplePanelIterator(this._panel) {
 hasElement = this._panel.widget != null;
}

Properties

final Widget current #

Returns the current element.

Return null if the iterator has not yet been moved to the first element, or if the iterator has been moved after the last element of the Iterable.

docs inherited from Iterator<Widget>
Widget get current => _getCurrent();

bool hasElement #

bool hasElement = false

Widget returned #

Widget returned = null

Methods

bool moveNext() #

Returns whether the Iterator has elements left.

bool moveNext() {
 return hasElement;
}

dynamic remove() #

remove() {
 if (returned != null) {
   _panel.remove(returned);
 }
}