sortByZIndex method

void sortByZIndex()

Sorts the list by PCanvasElement.zIndex.

Implementation

void sortByZIndex() => sort((a, b) {
      var z1 = a.zIndex ?? 0;
      var z2 = b.zIndex ?? 0;
      return z1.compareTo(z2);
    });