Blocsync
DocsGet Started
DocsGet Started

Sync your Flutter bloc states across devices with minimal setup.

Get StartedView Docs

✨ Features

🚀

Simple Setup

Just extend SyncedBloc and add toJson/fromJson methods

🌐

Real-time Sync (coming soon)

Changes are pushed to other devices immediately

📱

Offline Support (coming soon)

Changes are queued and synced when connection is restored

🔐

Privacy Options

Choose between public (shared) or private (per-user) states

🏗️

Flexible Hosting

Self-host or use our managed service

🔑

Multi-Auth Support

Firebase, Supabase, Auth0, and custom auth providers

🚀 Quick Start

1. Extend SyncedBloc

import 'package:blocsync/blocsync.dart';

class CounterBloc extends SyncedBloc {
  CounterBloc() : super(0) {
    on((event, emit) => emit(state + 1));
    on((event, emit) => emit(state - 1));
  }

  @override
  int fromJson(Map json) => json['value'] as int;

  @override
  Map? toJson(int state) => {'value': state};
}

2. Configure BlocSync

// Configure remote sync
BlocSyncConfig.apiClient = ApiClient(
  baseUrl: Uri.parse('https://your-server.com'),
  apiKey: 'your_api_key',
);

// Optional: Configure authentication
BlocSyncConfig.authProvider = FirebaseAuthProvider();

3. Use Like a Regular Bloc

BlocProvider(
  create: (context) => CounterBloc(),
  child: BlocBuilder(
    builder: (context, state) {
      return Text('Count: $state');
    },
  ),
)

That's it! Your bloc state will now automatically sync across all devices.

🏠 Hosting Options

Managed Hosting

Use blocsync.dev for hassle-free cloud hosting with:

  • Zero server management
  • Automatic scaling
  • Built-in security
Get Started

Self-Hosted

Run your own server using the included server package for complete control over your data and infrastructure.

Learn More

Ready to sync your bloc states?

Start syncing your Flutter bloc states across devices in minutes with BlocSync.

Get Started NowView Documentation