at_uri

⚠️ DEPRECATED - Use at_primitives instead

⚠️ Package Deprecated

This package has been deprecated and is no longer maintained. All functionality has been moved to the at_primitives package.

Migration Guide

Please migrate to the at_primitives package:

# Remove the old package
dart pub remove at_uri

# Add the new package
dart pub add at_primitives

Update your imports:

// Old
import 'package:at_uri/at_uri.dart';

// New
import 'package:at_primitives/at_primitives.dart';

The API remains the same, so no code changes are required beyond updating the import statement.


1. Guide 🌎 (Legacy Documentation)

This library provides the easiest way to use AT Uri supported by AT Protocol in Dart and Flutter apps.

1.1. Getting Started ⚡

1.1.1. Install Library

With Dart:

 dart pub add at_uri

Or With Flutter:

 flutter pub add at_uri

1.1.2. Import

import 'package:at_uri/at_uri.dart';

1.1.3. Implementation

import 'package:at_uri/at_uri.dart';

void main(List<String> args) {
  final uri = AtUri.parse('at://bob.com/com.example.post/1234');

  uri.protocol; // => 'at:'
  uri.origin; // => 'at://bob.com'
  uri.hostname; // => 'bob.com'
  uri.collection; // => 'com.example.post'
  uri.rkey; // => '1234'

  ensureValidAtUri('at://user.bsky.social'); // => returns void
  ensureValidAtUri('at//did:plc:asdf123'); // => throws
}

Libraries

at_uri