scopeFromString function

Scope scopeFromString(
  1. String string
)

Converts a string to a Scope.

Implementation

Scope scopeFromString(String string) {
  if (string == null) {
    return null;
  }
  switch (string) {
    case 'user_profile':
      return Scope.userProfile;
    case 'user_territory':
      return Scope.userTerritory;
    case 'user_account_status':
      return Scope.userAccountStatus;
    default:
      break;
  }
  return null;
}