fromCode static method

FirestoreErrorCode fromCode(
  1. String code
)

The code with the string code (for example 'permission-denied'), or unknown for a string that is no Firestore code.

Implementation

static FirestoreErrorCode fromCode(String code) {
  for (final FirestoreErrorCode candidate in values) {
    if (candidate.code == code) {
      return candidate;
    }
  }
  return unknown;
}