pageData property

T get pageData

Get the page data.

Implementation

T get pageData => _pageData;
set pageData (T value)

Set the page data.

Implementation

set pageData(T value) {
  if (value is Listenable) {
    if (_pageData != null) {
      (_pageData as Listenable).removeListener(_onPageDataChanged);
    }

    value.addListener(_onPageDataChanged);
  }

  final tSame = _pageData == value;
  _pageData = value;

  // We are dealing with the Listenable check above this
  // changed check because with overridden == operators, it's
  // likely that the actual object has changed and therefore the listeners
  // also need to be reset, but the data part of the object is the same.
  // So we just replace the listeners but don't notify of changes.
  if (tSame) {
    // ignore
    return;
  }

  _onPageDataChanged();
}