byName static method

WebViewInterface? byName(
  1. String? name
)

Gets a possible WebViewInterface instance value with name name.

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

Implementation

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