DEV Community

QuickBlox
QuickBlox

Posted on

How to get started with QuickBlox Flutter SDK

QuickBlox Flutter SDK enables companies to launch cross-platform chat and messaging apps with minimum effort and maximum effect. Please see our step-by-step guide below for using QuickBlox Flutter SDK.

Flutter and QuickBlox

Why do you need QuickBlox Flutter SDK?

QuickBlox provides a comprehensive Flutter chat SDK available for download from our GitHub repository, that offers all you need to add real time communication to your application, including chat and video calling. It comes with rich documentation and code samples to help you get started.

Our chat SDK for Flutter contains a series of modules that enables you to add stunning functionality to create a modern chat messaging app:

Authentication. Use this module to create an authentication system for your users based on passwords and session tokens, so that they can enjoy secure sessions.

User Management. Our SDK provides the necessary tools to manage users by creating passwords, registering new accounts, updating, retrieving, or removing user profiles.

Flutter Chat. Our messaging API works with the XMPP protocol. With this technology you can manage the connection to the chat server and configure chat dialogs and messages.

Flutter Video Calls. It’s possible to integrate peer-to-peer audio and video calls for one-to-one and small group communication with our Flutter SDK.

Content. Use this module to store and manage chat attachments including documents, photos, videos, etc.

Push notifications. Keep in touch with app users even if they are currently offline by integrating push messaging into your application (e.g. inform them about new messages, promotions, and app updates).

Custom Objects. This module helps you utilize QuickBlox key-value storage to create different types of data schemas that can be used in your Flutter application

How to create a Flutter app using QuickBlox SDK?

Getting started

To create a new Flutter chat messaging app with QuickBlox SDK from scratch follow these steps:

  1. Install Flutter for your platforms.

  2. Run flutter create myapp to create a new project.

  3. Add QuickBlox Flutter SDK into your project’s dependencies into dependencies section in pubspec.yaml file in your root project dir.

dependencies:
quickblox_sdk: 0.0.1
Enter fullscreen mode Exit fullscreen mode

You’re done with dependencies!

Launching the app

Now you can start the app with flutter run

But the application created is not really a chat messenger yet, right? So now you should create some UI for messages and then use our SDK to make it alive!

To make the SDK work, you should use your QuickBlox application account. To create a QuickBlox application, follow the steps below:

  1. Register a new account at https://admin.quickblox.com/signup. Type in your email and password to sign in. You can also sign in with your Google or Github accounts.

  2. Create the application by clicking the New app button.

  3. Configure the application. Type in information about your organization into the corresponding fields and click the Add button.

  4. Go to the screen with credentials. Locate Credentials group box and copy your Application ID, Authorization Key, Authorization Secret and Account Key. This data is needed to run your application on the QuickBlox server.

Turning on QuickBlox SDK

Init credentials:

const String APP_ID = "XXXXX";
const String AUTH_KEY = "XXXXXXXXXXXX";
const String AUTH_SECRET = "XXXXXXXXXXXX";
const String ACCOUNT_KEY = "XXXXXXXXXXXX";
const String API_ENDPOINT = ""; //optional
const String CHAT_ENDPOINT = ""; //optional

try {
      await QB.settings.init(APP_ID, AUTH_KEY, AUTH_SECRET, ACCOUNT_KEY,
          apiEndpoint: API_ENDPOINT, chatEndpoint: CHAT_ENDPOINT);
    } on PlatformException catch (e) {
     // Some error occured, look at the exception message for more details 
    }
Enter fullscreen mode Exit fullscreen mode

Continue this Tutorial on the QuickBlox blog!

We provide a detailed tutorial with code snippets to help you get started.

Check out our Flutter documentation & code samples.

Please leave your feedback in the comments below!

Top comments (0)