AtUri.make constructor

AtUri.make(
  1. String handleOrDid, [
  2. String? collection,
  3. String? rkey
])

Returns the new instance of parsed AT URI based on handleOrDid, and collection and rkey as optionals.

Implementation

factory AtUri.make(
  final String handleOrDid, [
  final String? collection,
  final String? rkey,
]) {
  final buffer = StringBuffer(handleOrDid);
  if (collection != null) buffer.write('/$collection');
  if (rkey != null) buffer.write('/$rkey');

  return ParsedAtUri(buffer.toString());
}