from static method

Principal from(
  1. dynamic other
)

Implementation

static Principal from(dynamic other) {
  if (other is String) {
    return Principal.fromText(other);
  } else if (other is Map<String, dynamic> && other['_isPrincipal'] == true) {
    return Principal(other['_arr']);
  } else if (other is Principal) {
    return Principal(other._arr);
  }

  throw 'Impossible to convert ${jsonEncode(other)} to Principal.';
}