Build a Custom Flutter Chat and Video App (A Complete Guide)steemCreated with Sketch.

in #flutterlast month (edited)

I built a Flutter app today, a healthcare chat app project, to build a HIPAA-compliant platform in pure flutter code. Last night, purely out of curiosity, I decided to try building a healthcare app with the least amount of efforts possible, using MirrorFly’s custom video and chat SDKs. It worked beyond my expectations.

Fluter video chat app.png

So I couldn't stop myself from writing about it. In this post, I’ve explained how I built a complete Flutter application with messaging, video calling and voice calling features in less than 24 hours.

Top 12 Steps to Build a Custom Flutter Chat & Video App in 2026

Step 1: Checking Platform Requirements First


Quickly check if your system meets these requirements to get started with the project.

Android Requirements I Used

  1. Android API level 21 or higher
  2. Java 8
  3. Gradle 4.1.0+
  4. compileSdk and targetSdk set to 34
  5. iOS Requirements
  6. iOS 13.0 or above for chat
  7. iOS 12.1 or above for calls

iOS Requirements

  1. iOS 13.0 or above for chat
  2. iOS 12.1 or above for calls

Step 2: Getting My MirrorFly License Key


You’ll need a license key to authenticate the SDK with MirrorFly’s backend.

To do this, here is what I did:

  1. I contacted MirrorFly’s Sales Team and got my developer account
  2. Logged into the dashboard
  3. Copied the license key from the Application Info section

Next, I started with configuring the dependencies.

Step 3: Setting Up Android Dependencies


I updated my root build.gradle file to let Flutter get on to fetch the MirrorFly libraries files.

allprojects {
 repositories {
   jcenter()
   maven {
     url "https://repo.mirrorfly.com/release"
   }
 }
}


Then I verified if my app/build.gradle had the correct SDK versions.

android {
 compileSdk 34
 defaultConfig {
   minSdkVersion 21
   targetSdkVersion 34
 }
}

Step 4: Configuring iOS Properly

I’ve heard from many developers on how they get stuck when setting up their iOS dependencies. So I was a bit careful here.

In my ios/Podfile, I added the required post_install block provided by MirrorFly.

This handled toolchain paths, disabled bitcode, excluded arm64 for simulator, and ensured compatibility.

I also enabled all the required capabilities:

  • App Groups
  • Background Modes
  • Inside Background Modes, I enabled:
  • Audio, AirPlay, Picture in Picture
  • Voice over IP
  • Background fetch
  • Remote notifications

Why did I do this? I wanted to make sure that the calls worked even when if my app was not in the foreground.

Step 5: Installing the Flutter Plugin

Next, I added the MirrorFly plugin to my pubspec.yaml.

dependencies:
mirrorfly_plugin: ^1.5.0


Then I ran:

flutter pub get


And imported the SDK:

import 'package:mirrorfly_plugin/mirrorfly.dart';

Step 6: Initializing the MirrorFly SDK

I initialized the SDK inside main.dart before calling runApp().

void main() {
 WidgetsFlutterBinding.ensureInitialized();
 Mirrorfly.initializeSDK(
   licenseKey: LICENSE_KEY,
   iOSContainerID: IOS_APP_GROUP_ID,
   chatHistoryEnable: true,
   enableDebugLog: true,
   flyCallback: (FlyResponse response) {
     runApp(const MyApp());
   }
 );
}

I wanted my users to access their conversations whenever they need it and on any device they need it. So, I enabled chat history to automatically sync all the messages from the server.

Step 7: Logging In a User

After initialization, the next step was user login. MirrorFly handles both registration and connection in one call.

Mirrorfly.login(
 userIdentifier: userIdentifier,
 fcmToken: fcmToken,
 isForceRegister: true,
 flyCallback: (FlyResponse response) {
   if (response.isSuccess) {
     // user is now connected
   }
 }
);

One important thing I learned here is that login should only be called once per session unless the user logs out.

Step 8: Sending a One-to-One Chat Message

To send a message, I first prepared the message parameters.

var textMessage = MessageParams.text(
 toJid: toJid,
 textMessageParams: TextMessageParams(
   messageText: "Hello from Flutter"
 )
);

Then I sent it using:

Mirrorfly.sendMessage(
 messageParams: textMessage,
 flyCallback: (response) {
   if (response.isSuccess) {
     // message sent successfully
   }
 }
);

MirrorFly internally handles delivery receipts and message IDs.

Step 9: Receiving Messages in Real Time

To listen for incoming messages, I added this listener:

Mirrorfly.onMessageReceived.listen((result) {
 var chatMessage = sendMessageModelFromJson(result);
});

This listener only triggers when a new message arrives from another user, which keeps things clean.

Step 10: Enabling Audio and Video Calls

Once chat was working, it was super-simple to add calling features.

Before making calls, I ensured microphone and camera permissions were granted.

On Android 12 and above, I also requested:

  • BLUETOOTH_CONNECT
  • READ_PHONE_STATE
  • POST_NOTIFICATIONS for Android 13+

Step 11: Making a Voice Call

Here is how I triggered a one-to-one voice call:

Mirrorfly.makeVoiceCall(
 toUserJid: userJid,
 flyCallBack: (FlyResponse response) {
   if (response.isSuccess) {
     // call initiated
   }
 }
);

If the call feature is not enabled in the plan, the SDK returns a 403 error.

Step 12: Receiving and Handling Calls

Incoming calls are handled automatically by the SDK.

  • iOS uses CallKit
  • Android uses the Incoming Call Intent

To track call state changes, I added this listener:

Mirrorfly.onCallStatusUpdated.listen((event) {
 var data = jsonDecode(event);
 var callStatus = data["callStatus"];
});

This listener tells me whether the call is ringing, attended, ended, or missed.

Overall, this is one of the easiest ways to build a custom flutter messaging app, video calling and voice calling capabilities. If you’d like to extend the capabilities with AI features, looks like MirrorFly has them as well. I’ll try them in another project and write an article soon about it.

So, now you’ve learned how to build an app in Flutter, and deploy it on your server.

I encourage you to try out the react native sdk available in MirrorFly’s official website and see if you can extend it. Please don’t hesitate to comment below your questions or suggestions related to this project.

Coin Marketplace

STEEM 0.06
TRX 0.32
JST 0.059
BTC 67593.84
ETH 2067.79
USDT 1.00
SBD 0.50