# sortedByPublicFirst method

List<T> sortedByPublicFirst()

Sorts declarations with public visibility before private ones.

Returns:

- New List with public declarations first
- Original order preserved among declarations with same visibility

Example:

    final methods = classDecl.getMethods().sortedByPublicFirst();
    // [publicMethod1, publicMethod2, _privateMethod1, _privateMethod2]

Sorting Logic:

    Public   -> -1 (comes first)
    Private  ->  1 (comes after)
    Equal    ->  0 (original order preserved)

## Implementation

    List<T> sortedByPublicFirst() {
      return toList()
        ..sort((a, b) {
          if (a.getIsPublic() == b.getIsPublic()) return 0;
          return a.getIsPublic() ? -1 : 1;
        });
    }