pub package gitHub license

Overview

The at_contacts_flutter package is for Flutter developers who want to add the ability to manage contacts in their atPlatform apps.

This open source 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
  • Add new contacts
  • Block/unblock contacts
  • Delete contacts

We call giving people control of access to their data “flipping the internet” and you can learn more about how it works by reading this overview.

Get started

There are three options to get started using this package.

1. Quick start - generate a skeleton app with at_app

This package includes a working sample application in the Example directory that you can use to create a personalized copy using at_app create in four commands.

$ flutter pub global activate at_app 
$ at_app create --sample=<package ID> <app name> 
$ cd <app name>
$ flutter run

Notes:

  1. You only need to run flutter pub global activate once
  2. Use at_app.bat for Windows

2. Clone it from GitHub

Feel free to fork a copy the source from the GitHub repo. The example code contained there is the same as the template that is used by at_app above.

$ git clone https://github.com/atsign-foundation/at_widgets.git

3. Manually add the package to a project

Instructions on how to manually add this package to you project can be found on pub.dev here.

How it works

Setup

This package needs to be initialised using:

initializeContactsService(rootDomain: AtEnv.rootDomain);

If you are using UI widgets from the package then you also have to initialise SizeConfig service.

SizeConfig().init(context);

Usage

This package provides two UI screens:

  • Contacts Screen
  • Blocked Contacts Screen

The usage can be found in the example.

This package also provides useful calls:

  • Get an atSign details.
TextButton(
    onPressed: () async {
        AtContact _userContact = await getAtSignDetails(_atSign);
        print(_userContact);
    },
    child: Text('Get Details'), 
),
  • Get cached contact details
TextButton(
    onPressed: () async {
        AtContact? _userContact = await getCachedContactDetail(_atSign);
        print(_userContact ?? 'No cached contact found');
    },
    child: Text('Get Cached Details'), 
),

Open source usage and contributions

This is open source code, so feel free to use it as is, suggest changes or enhancements or create your own version. See CONTRIBUTING.md for detailed guidance on how to setup tools, tests and make a pull request.

Libraries

add_contacts_dialog
A popup to ask the AtSign which is to be added
add_singular_contact_dialog
at_contacts_flutter
blocked_screen
blocked_user_card
A list tile to display the blocked contact takes in a AtContact blocked user and displays it's name, atsign, profile picture and option to unblock the user
bottom_sheet
A bottom sheet widget to diaplay the number of contacts selected from contact list and what to do of that list on press of Done takes in @param onPressed which defines what to be executed on press of Done @param selectedList is a ValueChanged function which return the selected contacts to be used outside of package.
circular_contacts
colors
common_button
contact_base_model
contact_service
contacts_initials
contacts_screen
custom_circle_avatar
A customized circular avatar to display the profile picture with a small border takes in @param image for the asset image @param size to define the size of the avatar @param nonAsset if the image is coming over the network @param byteImage to display the image from the netwok
custom_list_tile
A custom list tile to display the contacts takes in a function @param onTap to define what happens on tap of the tile @param onTrailingPresses to set the behaviour for trailing icon @param asSelectionTile to toggle whether the tile is selectable to select contacts @param contact for details of the contact @param contactService to get an instance of AtContactsImpl
custom_search_field
A search field to filter out the contacts
desktop_contacts_screen
error_screen
exposed_service
horizontal_list_view
images
init_contacts_service
text_strings
text_styles