at_client_mobile 3.2.22 copy "at_client_mobile: ^3.2.22" to clipboard
at_client_mobile: ^3.2.22 copied to clipboard

A Flutter extension to the at_client library which adds support for mobile, desktop and IoT devices.

The Atsign FoundationThe Atsign Foundation

pub package pub points build status gitHub license

at_client_mobile #

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_mobile 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_mobile

Usage #

  • Get KeyChainManager instance to manage your keys while switching between atSigns.
import 'package:at_client_mobile/at_client_mobile.dart';

static final KeyChainManager _keyChainManager = KeyChainManager.getInstance();

/// Fetch atsign from the keychain manager
String atSign = await _keyChainManager.getAtSign();
copied to clipboard
  • Delete atSign from the keychain manager
await _keyChainManager.deleteAtSignFromKeychain(atsign);
copied to clipboard
  • Fetch List of atSigns from the keychain manager.
List<String>? atSignsList = await _keyChainManager.getAtSignListFromKeychain();
copied to clipboard
  • Make an atSign primary in device storage.
AtClientManager.getInstance().setCurrentAtSign(atsign, AppConstants.appNamespace, AtClientPreference());

bool isAtsignSetPrimary = await _keyChainManager.makeAtSignPrimary(atsign);

print(isAtsignSetPrimary); // Prints true if set primary.
copied to clipboard
  • Get atSign status from device storage.
Map<String, bool?> atSignsWithState = await _keyChainManager.getAtsignsWithStatus();

print(atSignsWithState); // Prints a map of atSigns with their status.

/// Output:
/// {
///   "@atSign1": true, // atSign1 is set as primary
///   "@atSign2": false,
///   "@atSign3": false
/// }
copied to clipboard
  • Reset atSigns from device storage.
for (String atsign in atSignsList) {
    await _keyChainManager.resetAtSignFromKeychain(atsign);
}
copied to clipboard
  • Get AtClientService instance to manage your atSigns.

OnboardingWidgetService is used to onboard your atSigns. Ckeck out the at_onboarding_flutter for more details.

Map<String?, AtClientService> atClientServiceMap = {};

/// Onboarding widget
OnboardingWidgetService().onboarding(
    fistTimeAuthNextScreen: FirstTimeScreen(),
    nextScreen: null,
    atsign: myAtSign,
    onboard: (value, atsign) async {
        atClientServiceMap = value;
    //... YOUR CODE ...//
    },
    onError: (error) {
        print(error);
    },
);
copied to clipboard
  • Remove an atSign from the AtClientService.
await _keyChainManager.deleteAtSignFromKeychain(atsign);
atClientServiceMap.remove(atsign);
copied to clipboard
  • Check if an atSign is onboarded.
bool isOnboarded = atClientServiceMap.containsKey(atsign);
print(isOnboarded); // Prints true if onboarded.
copied to clipboard
  • Format of the .env file
NAMESPACE = "at_client_demo"
ROOT_DOMAIN = "root.atsign.org"
copied to clipboard
  • Adding the .env file to pubspec.yaml
flutter:
  assets: 
    - .env
copied to clipboard
  • If your app supports windows platform then add biometric_storage in app's dependencies
dependencies:
 biometric_storage: ^4.1.3
copied to clipboard

Example #

We have a good example with explanation in the at_client_mobile package.

223
likes
160
points
4.02k
downloads

Publisher

verified publisheratsign.org

Weekly Downloads

2024.09.08 - 2025.03.23

A Flutter extension to the at_client library which adds support for mobile, desktop and IoT devices.

Homepage
Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

at_auth, at_chops, at_client, at_commons, at_file_saver, at_lookup, at_persistence_secondary_server, at_utils, biometric_storage, crypton, encrypt, flutter, flutter_keychain, hive, package_info_plus, path

More

Packages that depend on at_client_mobile