A library for Dart developers.
To use this library in your app, first add it to your pubspec.yaml
dependencies:
at_contact: ^1.0.0
pub get
import 'package:at_contact/at_contact.dart';
var atSign = '@alice';
var atContact = await AtContactsImpl.getInstance(atSign);
// set contact details
contact = AtContact(atSign: atSign,
personas: ['finance_persona', 'health_persona'],);
//add contact
var result = await atContact.add(contact);
//update contact
contact.type = ContactType.Institute;
result = await atContact.update(contact);
//get contact by atSign
var contact = await atContact.get(atSign);
//Get all active contacts
var contactList = await atContact.listActiveContacts();
// Block contact
contact.blocked = true;
var updateResult = await atContact.update(contact);
// Get all blocked contacts
var blockedContacts = await atContact.listBlockedContacts();
Run this command:
With Dart:
$ dart pub add at_contact
With Flutter:
$ flutter pub add at_contact
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
at_contact: ^2.0.3
Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:at_contact/at_contact.dart';
Author: atsign-foundation
Official Website: https://github.com/atsign-foundation/at_libraries