byName static method

PullToRefreshSize? byName(
  1. String? name
)

Gets a possible PullToRefreshSize instance value with name name.

Goes through PullToRefreshSize.values looking for a value with name name, as reported by PullToRefreshSize.name. Returns the first value with the given name, otherwise null.

Implementation

static PullToRefreshSize? byName(String? name) {
  if (name != null) {
    try {
      return PullToRefreshSize.values.firstWhere(
        (element) => element.name() == name,
      );
    } catch (e) {
      return null;
    }
  }
  return null;
}