Now for some internet optimism.
A flutter plugin project for CRUD operations on contacts.
This plugin can be added to the project as git dependency in pubspec.yaml
dependencies: at_contacts_flutter: ^1.0.0
This plugin provides two screens:
This lists the contacts. From this screen a new contact can be added. Also, an existing contact can be blocked or deleted.
This screen lists the blocked contacts. It also gives the option to unblock a contact in it.
It is expected that the app will first create an AtClientService instance and authenticate an atsign.
The contacts service needs to be initialised with the
atClient from the
AtClientService, current atsign and the root server.
initializeContactsService( clientSdkService.atClientServiceInstance.atClient, currentAtSign, rootDomain: MixedConstants.ROOT_DOMAIN);
Navigating to the contacts or blocked contacts is done simply by using:
Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => ContactsScreen(), ));
Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => BlockedScreen(), ));
- A popup to ask the
AtSignwhich is to be added
- Screen exposed to see blocked contacts and unblock them
- 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
- A bottom sheet widget to diaplay the number of contacts selected from
contact list and what to do of that list on press of
Donetakes in @param
onPressedwhich defines what to be executed on press of
selectedListis a ValueChanged function which return the selected contacts to be used outside of package.
- A service to handle CRUD operation on contacts
- This is a widget to display the initials of an atsign which does not have a profile picture
it takes in @param
sizeas a double and @param
initialsas String and display those initials in a circular avatar with random colors
- The screen which is exposed from the library for displaying, adding, selecting and deleting Contacts,
takes in @param context to get the app context
currentAtsingto get the contacts for the give
selectedListis a callback function to return back the selected list from the screen to the app @param
asSelectionScreentoggles between the selection type screen of to display the contacts
- A customized circular avatar to display the profile picture with a small border
takes in @param
sizeto define the size of the avatar @param
nonAssetif the image is coming over the network @param
byteImageto display the image from the netwok
- A custom list tile to display the contacts
takes in a function @param
onTapto define what happens on tap of the tile @param
onTrailingPressesto set the behaviour for trailing icon @param
asSelectionTileto toggle whether the tile is selectable to select contacts @param
contactfor details of the contact @param
contactServiceto get an instance of AtContactsImpl
- A search field to filter out the contacts