fromNativeValue static method

ConsoleMessageLevel? fromNativeValue(
  1. int? value
)

Gets a possible ConsoleMessageLevel instance from a native value.

Implementation

static ConsoleMessageLevel? fromNativeValue(int? value) {
  if (value != null) {
    try {
      return ConsoleMessageLevel.values
          .firstWhere((element) => element.toNativeValue() == value);
    } catch (e) {
      return null;
    }
  }
  return null;
}