flutter_ftp_dtp 1.0.1
flutter_ftp_dtp: ^1.0.1 copied to clipboard
Flutter package for LAN-based File Transfer Pattern (FTP) and Data Transfer Pattern (DTP) — one-shot JSON sharing over HTTP and realtime sync over WebSocket.
Flutter FTP & DTP #
LAN-based local data sharing for Flutter — FTP (one-shot JSON over HTTP) and DTP (realtime sync over WebSocket) on the same Wi-Fi network. Extracted from the RUPOS dine-in table management module.
| Pattern | Name | Transport | Use case |
|---|---|---|---|
| FTP | File Transfer Pattern | HTTP GET | One-shot JSON export/import (setup sharing) |
| DTP | Data Transfer Pattern | WebSocket | Realtime bidirectional sync (live collaboration) |
Author #
Balamurugan · AI Architect · Chennai, India
| messagetobalamurugan@gmail.com | |
| +91 75388 86343 | |
| Custom solutions | LAN sync, offline-first POS, multi-device table management, QR pairing flows |
Need custom LAN sync, white-label data sharing, or enterprise Flutter integrations? Connect on WhatsApp or email — I build tailored Flutter solutions.
Support this project #
If flutter_ftp_dtp saved you time on your app, consider buying me a coffee:
| Method | Details |
|---|---|
| UPI (India) | balamuruganm2102-1@okaxis |
| Buy Me a Coffee | buymeacoffee.com — search Balamurugan or use UPI above |
Your support helps maintain cross-platform LAN sync, WebSocket reliability, and new pairing features.
Documentation #
| Guide | Link |
|---|---|
| Installation guide (all platforms) | INSTALLATION.md |
| Full HTML guide | doc/index.html — open in browser |
| Changelog | CHANGELOG.md |
| RUPOS UI reference | doc/rupos_full_flow_1.html |
| GitHub repository | bala-404/Flutter_FTP-DTP |
# Open HTML guide (macOS)
open doc/index.html
Install #
From pub.dev #
dependencies:
flutter_ftp_dtp: ^1.0.1
Local path (development) #
dependencies:
flutter_ftp_dtp:
path: ../Flutter_FTP-DTP
flutter pub get
import 'package:flutter_ftp_dtp/flutter_ftp_dtp.dart';
See INSTALLATION.md for Android cleartext, iOS local network, and camera permissions.
Features #
- No cloud required — devices communicate directly over the local network
- QR + manual pairing — scan a QR code or enter IP + port + token
- Token-gated security — 6-character alphanumeric tokens on every connection
- Cross-platform — Android, iOS, macOS, Windows, Linux (host); Web (client join only)
- Pluggable storage — wire FTP/DTP to your own Hive, SQLite, or in-memory store
- Ready-made UI — optional dialogs for share, import, and live sync flows
Quick start #
File Transfer Pattern (FTP) #
final shareService = LocalFileShareService(
label: 'My App Data',
buildExport: () => {'items': myData.toJson()},
importExport: (json) async {
myData.loadFrom(json);
return ImportSummary(itemCount: myData.length);
},
);
// Host — show QR dialog
await showFileShareDialog(context, service: shareService);
// Client — import from host
await showFileImportDialog(context, service: shareService);
Data Transfer Pattern (DTP) #
class MySyncAdapter implements SyncAdapter {
@override
Future<Map<String, dynamic>> buildSnapshot() async => {...};
@override
Future<void> applyRemote(SyncMessage message) async {...}
@override
void startWatching(void Function(SyncMessage) onLocalChange) {...}
@override
Future<void> stopWatching() async {...}
}
final engine = RealtimeSyncEngine(MySyncAdapter());
await showRealtimeSyncDialog(context, engine: engine);
Example app #
cd example
flutter pub get
flutter run
The example demonstrates both patterns with a simple shared-notes app. Test with two devices on the same Wi-Fi:
- Device A → Share (FTP) or Live Sync (DTP) → Host
- Device B → Import (FTP) or Live Sync (DTP) → Join (scan QR)
Platform support #
| Platform | FTP Host | FTP Client | DTP Host | DTP Client |
|---|---|---|---|---|
| Android | ✅ | ✅ | ✅ | ✅ |
| iOS | ✅ | ✅ | ✅ | ✅ |
| macOS | ✅ | ✅ | ✅ | ✅ |
| Windows | ✅ | ✅ | ✅ | ✅ |
| Linux | ✅ | ✅ | ✅ | ✅ |
| Web | ❌ | ✅ | ❌ | ✅ |
Hosting requires dart:io (native platforms). Web can join as a client but cannot host.
Architecture #
┌─────────────────────────────────────────────────────────┐
│ Your Flutter App │
│ ┌──────────────┐ ┌──────────────────────┐ │
│ │ LocalFile │ │ RealtimeSyncEngine │ │
│ │ ShareService │ │ + SyncAdapter │ │
│ └──────┬───────┘ └──────────┬───────────┘ │
│ │ │ │
│ ┌──────▼───────┐ ┌─────────▼──────────┐ │
│ │ ShareHttp │ │ SyncWsServer │ │
│ │ Server │ │ (WebSocket host) │ │
│ │ GET /data.json│ │ GET /sync │ │
│ └──────────────┘ └────────────────────┘ │
└─────────────────────────────────────────────────────────┘
│ LAN (same Wi-Fi) │
▼ ▼
Receiver device(s) Joining device(s)
Protocol #
FTP QR payload #
{"v":1,"ip":"192.168.1.25","port":8080,"token":"A9X8M2","label":"My Store","path":"/data.json","mode":"share"}
DTP QR payload #
{"ip":"192.168.1.25","port":8080,"token":"A9X8M2","path":"/sync","mode":"sync"}
WebSocket message envelope #
{"t":"entity_upsert","o":"dev_...","id":"item_id","ts":1234567890,"d":{...}}
Origin #
This package was extracted from the RUPOS application's Table Management module:
TableShareService→LocalFileShareService(FTP)DineSyncService→RealtimeSyncEngine(DTP)
The original Rupos code is unchanged — this is a standalone copy for reuse in other Flutter projects.
Publishing checklist (pub.dev) #
cd Flutter_FTP-DTP
dart pub publish --dry-run
dart pub publish
Requires: LICENSE, CHANGELOG.md, README.md, valid homepage / repository URLs.
License #
MIT License — Copyright © 2026 Balamurugan, Chennai, India.
Permission is granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Full license text: LICENSE · Repository: GitHub
Made with ❤️ in Chennai · Email · WhatsApp · UPI: balamuruganm2102-1@okaxis