at_client_flutter
Introduction
A Flutter extension to the at_client library which adds support for mobile, desktop, and IoT devices.
SDK that provides the essential methods for building an app using The atProtocol. You may also want to look at at_client.
at_client_flutter package is written in Dart, supports Flutter, and follows the atPlatform's decentralized, edge computing model with the following features:
- Cryptographic control of data access through personal data stores
- No application backend needed
- End to end encryption where only the data owner has the keys
- Private and surveillance free connectivity
We call giving people control of access to their data "flipping the internet".
Get Started
Before using this package for the first time, you should follow the getting started guide
You may find it useful to read the atPlatform overview.
This package is available on pub.dev at https://pub.dev/packages/at_client_flutter
Usage
See at_client_flutter/example for more details regarding all workflows.
Package provides Flutter Dialogs for the following workflows:
- Onboarding via Registrar / Cram
- Authentication via File
- Authentication via Keychain
Atsign / RootDomain Selection Dialog
AuthRequest? authRequest = await AtSignSelectionDialog.show(
context,
);
Registrar Cram Dialog
RegistrarService registrar = RegistrarService("registarURL" "apiKey");
String cramKey = await RegistrarCramDialog.show(
context,
atOnboardingRequest,
registrar: registrar,
);
Cram Onboarding Dialog
AtOnboardingResponse response = await CramDialog.show(
context,
request: onboardingRequest,
cramKey: cramKey,
progressBuilder: progressBuilder,
onOnboardingComplete: onOnboardingComplete,
title: title,
description: description,
);
Pkam Onboarding Dialog
AtAuthRequest request = AtAuthRequest(
authRequest.atSign,
atKeysIo: atKeysIo,
rootDomain: authRequest.rootDomain,
);
AtAuthResponse response = await PkamDialog.show(context, request: request);
Keychain Authentication
Keychain Authentication is handled by providing a KeychainAtKeysIo instance in your AuthRequest
KeychainAtKeysIo keychainAtKeysIo = KeychainAtKeysIo();
This class handles necessary reading and writing of your AtKeys to your keychain during authentication.
Any futher manipulation of the keychain is handled via KeychainStorage.
Keychain Storage
final KeychainStorage keychainStorage = KeychainStorage();
// Get a specific atsign's keys
AtKeys? alice = await keychainStorage.getAtsign("@alice");
// Get all atsigns in the keychain
List<String> atsigns = await keychainStorage.getAllAtsigns();
// Append atKeys to the keychain
await keychainStorage.appendAtKeysToKeychain(atKeys);
// Remove atSign from keychain
await keychainStorage.removeAtsignFromKeychain("@alice");
// Delete all atKeys data for this app
await keychainStorage.deleteAllAtKeysData();
- If your app supports windows platform then add
biometric_storagein app's dependencies
dependencies:
biometric_storage: ^4.1.3
Enrollments in the keychain
Storing enrollment data for ongoing/approved/denied enrollments are managed by the KeychainStorage class
await keychainStorage.readEnrollmentData("@alice");
await keychainStorage.writeEnrollmentData("@alice", enrollmentData);
await keychainStorage.deleteEnrollmentData("@alice");
bool isValidated = await keychainStorage.validateEnrollment("@alice");
Example
More details in the example
at_client_flutter/example/main.dart