General-purpose LAN-based File Transfer Pattern and Data Transfer Pattern for Flutter apps.
One-shot JSON export/import over HTTP. A host device starts a temporary LAN server; receivers download via QR scan or manual IP + token entry.
GET http://192.168.1.25:8080/data.json?token=A9X8M2
Realtime bidirectional sync over WebSocket. Every device keeps a full local copy. The host relays changes between clients with last-write-wins conflict resolution.
ws://192.168.1.25:8080/sync?token=A9X8M2
{"t":"entity_upsert","o":"dev_abc","id":"note_1","ts":1720000000,"d":{...}}
| Platform | FTP Host | FTP Client | DTP Host | DTP Client |
|---|---|---|---|---|
| Android | ✅ | ✅ | ✅ | ✅ |
| iOS | ✅ | ✅ | ✅ | ✅ |
| macOS | ✅ | ✅ | ✅ | ✅ |
| Windows | ✅ | ✅ | ✅ | ✅ |
| Linux | ✅ | ✅ | ✅ | ✅ |
| Web | ❌ | ✅ | ❌ | ✅ |
Flutter_FTP-DTP/
├── lib/
│ ├── flutter_ftp_dtp.dart # Main export
│ └── src/
│ ├── ftp/ # File Transfer Pattern
│ ├── dtp/ # Data Transfer Pattern
│ ├── common/ # Shared utilities
│ └── ui/ # Optional dialogs
├── example/ # Demo app (all platforms)
├── doc/
│ └── index.html # This page
├── README.md
├── INSTALLATION.md
└── CHANGELOG.md
// pubspec.yaml
dependencies:
flutter_ftp_dtp: ^1.0.3
// Dart
import 'package:flutter_ftp_dtp/flutter_ftp_dtp.dart';
final share = LocalFileShareService(
buildExport: () => myData.toJson(),
importExport: (j) async => myData.import(j),
);
final sync = RealtimeSyncEngine(MySyncAdapter());
await showFileShareDialog(context, service: share);
await showRealtimeSyncDialog(context, engine: sync);