livelike_flutter_sdk 0.0.4 livelike_flutter_sdk: ^0.0.4 copied to clipboard
To use the services and features of LiveLike SDK
livelike_flutter_sdk #
The Official Flutter LiveLike SDK #
Create Engagement SDK instance
final sdk = EngagementSDK("<client-id>");
Create Engagement SDK instance with access token support
final sdk = EngagementSDK.accessToken("<client-id>","<saved-access-token>",(accessToken){
//fetched access token
});
Error Delegate Support
sdk.errorStream.listen((error) {
print("Error: $error");
//Getting error from any where from the sdk
});
ChatView
ChatView(key: Key("${chatSession.chatRoomId}"),
session:chatSession!);
WidgetView
WidgetView(session: session!,
key: Key(session!.programId!));
Leaderboard API's
Getting Leaderboard associated with a Program
final List<LeaderBoard> list = await sdk.getLeaderBoards("<program-id>");
Getting leaderboard details
final LeaderBoard detail=await sdk.getLeaderBoardDetails("<leaderBoardId>");
Getting leaderboard entries
final List<LeaderBoardEntry> result = await sdk.getEntriesForLeaderBoard(
"<leaderboard-id>", "<LiveLikePagination>");
Getting leaderboard entry for a given profile
final LeaderBoardEntry result = await sdk.getLeaderBoardEntryForProfile(
"<leaderboard-id>", "<profile-id>");
Getting a leaderboard entry for the current user profile
final LeaderBoardEntry result = await sdk.getLeaderBoardEntryForCurrentUserProfile("<leaderboard-id>");
Sponsor APi
final sposnors =await sdk.sponsor.fetchByProgramId("<program-id>")