SendingNetwork
  • OVERVIEW
    • Getting Started
    • FAQs
  • Network Instructional Articles
    • Basics
      • Introducing the Edge, WatchDog, and Guardian Nodes
      • Overview
      • Messaging Solution
      • Privacy Solution
      • Rich Communication Solution
      • Multi-Platform Solution
      • Decentralized Identity
      • Multiple Chat Modes
      • How It Works
      • Token Utility
      • The Team
    • Key Concepts
      • Decentralized Identity
      • Social Graphs
      • Edge Node
  • SDK Documentation
    • Glossary
    • JavaScript client SDK
      • DID
      • User
      • Message
      • Room
      • Contact
      • Social Graph
    • iOS client SDK
      • Push
      • DID
      • User
      • Message
      • Room
      • Contact
    • Android client SDK
      • User
      • Room
    • Java SDK
      • DID
      • Room
      • Message
    • Node.js SDK
      • DID
      • Room
      • Message
    • Unreal SDK
      • DID
      • User
      • Message
      • Room
    • Unity SDK
      • DID
      • Room
      • Message
    • Website chat widget SDK
      • Customization
      • DID
      • User
      • Room
      • Message
      • Other
    • Bot SDKs
      • Golang Bot SDK
        • DID
        • User
        • Room
        • Message
    • Extensible Message Interface
    • Push Notifications
    • Flutter SDK
      • DID
      • User
      • Message
      • Room
    • PHP SDK
      • DID
      • Room
      • User
    • Developer Key
  • Acquisition Kit
    • Social Boost Development Instructions
  • WatchDog Agent
    • WatchDog Agent Guide
    • WatchDog Agent Deployment Tutorial
      • Linux Deployment Tutorial
    • One-Click Deployment
  • Edge Node
    • Edge Node Deployment Tutorial
    • VPS Setup Guide
      • Google Cloud Platform (GCP)
      • Amazon Web Services (AWS)
      • Contabo
    • Check Node Stats with Auto-Reply Bot in SendingMe App
    • Alpha-3 Testnet FAQs
  • delegation node
    • Delegation Node Deployment Tutorial
  • Private Delegation Node
  • Use Cases
    • Wallet-to-Wallet Messaging
    • Dapp Notifications
    • Identity Verification
    • Gamer Acquisition
    • Cross-platform Trading
Powered by GitBook
On this page
  • 1 Get the code
  • 2 Configure the wallet address and private key
  • 3 Configure the dependencies in your pubspec.yaml file
  • 4 Import the SDK:
  • 5 import package:sdn/sdn.dart;
  • 6 Run the demo:
  1. SDK Documentation

Flutter SDK

Let's explore how to make a simple SendingNetwork client with the ability to sync messages, create a chat room, and post messages in the room.

When you complete this quickstart, you’ll have a fully running application that can send and receive messages on a demo app. To integrate and initialize SDK written in Dart, follow these steps:

1 Get the code

https://github.com/Sending-Network/sendingnetwork-dart

2 Configure the wallet address and private key

String privKey wallet private Private key"; 
String addressHexAll = "wallet address";

3 Configure the dependencies in your pubspec.yaml file

Add the following dependencies in the same directory:

sendingnetwork_flutter_demo
sendingnetwork_dart_sdk
sendingnetworkdart_api_lite

In the same pubspec.yaml file, include sendingnetwork_dart_sdk as a local path dependency:

sdn_api_lite:
  path: ../sendingnetworkdart_api_lite
Similarly, include sendingnetwork_flutter_demo as a local path dependency:
sdn:
  path: ../sendingnetwork_dart_sdk/
Refer to the configuration of sendingnetwork_flutter_demo for more details.

4 Import the SDK:

import 'package:sdn/sdn.dart';

5 import package:sdn/sdn.dart;

Create a client and provide the server domain:

final client = Client('SDN Example Chat', databaseBuilder: (_) async {
  final dir = await getApplicationSupportDirectory();
  final db = HiveCollectionsDatabase('sdn_example_chat', dir.path);
  await db.open();
  return db;
});
client.sdnnode = Uri.parse('https://XXX.network'); // Replace with your server's domain

6 Run the demo:

flutter pub get
flutter run

By running the demo, you should be able to log in, create rooms, and send messages. You will be able to see rooms created on other platforms that have integrated with SendingNetwork as well.

PreviousPush NotificationsNextDID

Last updated 1 year ago