locality_social_cloud_friendlist

A Flutter package based on Locality Social Cloud that provides a pub-sub based friend list system for sending and receiving friend requests between users. This package allows you to manage friend lists securely and efficiently, using SHA-256 for topic hashing and pub-sub mechanisms for event-driven updates.

Features

  • Send and receive friend requests between users.
  • Manage friend lists via a pub-sub architecture.
  • Automatically register and track friend lists.
  • Securely generate unique friend list topics using SHA-256 hashing.
  • Check the friend status between users easily.

Setup

Configure your Locality Social Cloud and enter your appId and appSecret and connect the Cloud:

    LocalitySocialCloud.configure(appId: '..', appSecret: '...=');

    LoggedInUser loggedInUser = (await LocalitySocialCloud.auth('testuser1', 'pwd1')).loggedInUser!;
    LocalityUser user1 = loggedInUser.user;
    LocalityUser user2 = (await LocalitySocialCloud.auth('testuser2', 'pwd2')).loggedInUser!.user;

For more information about Locality Social Cloud, visit https://localitysocial.cloud or https://locality.media.

Usage

Get the FriendList of a LocalityUser:

FriendList friendList1 = await FriendListFacade.getFriendListOfUser(user1);
FriendList friendList2 = await FriendListFacade.getFriendListOfUser(user2);

Send a friend request:

await FriendListFacade.sendFriendRequest(PublicUser fromUser, PublicUser toUser)