fromString static method Null safety

PasskeyState fromString(
  1. String state
)

Implementation

static PasskeyState fromString(String state) {
  switch (state.toLowerCase()) {
    case "active":
      return PasskeyState.ACTIVE;
    case "revoked":
      return PasskeyState.REVOKED;
    default:
      throw Exception(
          "Cannot initialize PasskeyState from invalid String value $state");
  }
}