FlutterFever Studio
Back to packages

Meshagent Flutter package guide

A ready‑to‑use SDK for secure real‑time rooms, live documents, and messaging in Flutter.

Install command
Copy and run in your Flutter project
flutter pub add meshagent_flutter

When to use Meshagent Flutter

Meshagent Flutter is a comprehensive Flutter SDK that brings secure, real‑time collaboration to your mobile, web, and desktop applications. The package abstracts the complexities of networking, end‑to‑end encryption, conflict resolution, and offline caching, offering developers a set of high‑level widgets and services for room‑based synchronization, collaborative document editing, and in‑app messaging. By handling the low‑level protocol details, Meshagent lets you focus on UI/UX and business logic while delivering a seamless, latency‑aware experience to end users.

If you are building a collaborative whiteboard, shared note‑taking app, team chat, or any product that requires multiple users to see and edit the same data instantly, Meshagent Flutter is a natural fit. The SDK works equally well for small‑scale peer‑to‑peer sessions and large‑scale enterprise deployments, providing fine‑grained access controls and encrypted data channels out of the box. Its modular design lets you enable only the features you need—whether that's secure room sync, live document streams, or a full‑featured messaging layer—so you can keep the binary size minimal.

Architecturally, Meshagent sits between your UI layer and the underlying transport layer, exposing a clean, Dart‑centric API that can be consumed by any state‑management solution. Whether you prefer Provider, Bloc, Riverpod, or GetX, the SDK’s streams and ChangeNotifiers integrate without friction. The package supports all mainstream Flutter platforms—iOS, Android, Web, macOS, Windows, and Linux—so you can write once and deploy everywhere. Its event‑driven model aligns well with client‑server architectures, allowing you to plug in custom back‑ends or rely on Meshagent’s hosted service for rapid prototyping.

Getting started is straightforward. Add the dependency with `flutter pub add meshagent_flutter`, then initialize the SDK with your Meshagent API key in the `main` function. From there you can create a `MeshRoom` widget to host a synchronized session, a `MeshDocument` widget for collaborative editing, or a `MeshChat` widget for real‑time messaging. The SDK provides helper methods for room lifecycle management, user presence tracking, and message persistence, all of which emit Dart streams that you can listen to using your preferred state manager. A minimal example is included below to illustrate the typical bootstrapping flow.

When moving to production, pay attention to authentication and secure key storage; the SDK expects a valid JWT or API token for each user. Monitor connectivity events to gracefully handle network interruptions and leverage the built‑in offline cache to avoid data loss. For beginners, a simple note‑taking app that syncs a plain‑text document across devices demonstrates the core capabilities without overwhelming complexity. As you scale, consider configuring custom back‑ends, fine‑tuning sync intervals, and employing Meshagent’s analytics hooks to gain insight into usage patterns. With careful planning, Meshagent Flutter can become the backbone of any real‑time, collaborative Flutter application.

collaborative note taking
real‑time chat
shared whiteboard
multi‑user document editing
team productivity tools

Pros

  • high‑level widgets reduce boilerplate
  • built‑in end‑to‑end encryption
  • cross‑platform support
  • offline‑first design
  • compatible with any state manager

Watch outs

  • relies on Meshagent service for full feature set
  • additional learning curve for room concepts
  • limited to features exposed by the SDK

Setup notes

1. Run `flutter pub add meshagent_flutter` to add the package. 2. Import the library: `import 'package:meshagent_flutter/meshagent_flutter.dart';` 3. Initialize the SDK early, typically in `main()`: `await MeshAgent.initialize(apiKey: 'YOUR_API_KEY');` 4. Use the provided widgets (MeshRoom, MeshDocument, MeshChat) or the low‑level services for custom UI. 5. Follow the platform‑specific setup guide for iOS (add permissions to Info.plist) and Android (update AndroidManifest.xml).

Requires Flutter 3.0 or higher. Supports iOS 12+, Android API 21+, Web, macOS 10.14+, Windows 10+, and Linux. Works with Dart 2.17+. Ensure that your project uses a recent version of the `http` package to avoid conflicts.

import 'package:flutter/material.dart';
import 'package:meshagent_flutter/meshagent_flutter.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await MeshAgent.initialize(apiKey: 'YOUR_API_KEY');
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Meshagent Demo')),
        body: const MeshRoom(
          roomId: 'demo-room',
          child: Center(child: Text('Live sync in this room')),
        ),
      ),
    );
  }
}

Official package resources