flutter_ftp_dtp library
Flutter FTP & DTP — LAN file sharing and realtime sync for Flutter apps.
FTP (File Transfer Pattern) — one-shot JSON export/import over HTTP. DTP (Data Transfer Pattern) — live bidirectional sync over WebSocket.
Classes
- DeviceId
- Stable per-install device id for echo suppression and last-write-wins.
- FileImportDialog
- ImportSummary
- Result of an import, for confirmation UI.
- Exports/imports JSON data between devices over the local Wi-Fi network.
- RealtimeSyncDialog
- RealtimeSyncEngine
- DTP (Data Transfer Pattern) — realtime LAN sync over WebSocket.
- Web / unsupported-platform stub for ShareHttpServer.
- A live sharing session on the host device.
- Connection details parsed from a scanned QR code or entered manually.
- SyncAdapter
- Callbacks that wire the sync engine to your app's storage layer.
- SyncClientHandle
- SyncHostInfo
- Host connection info shown to the user (QR/manual pairing).
- SyncMessage
- One envelope on the wire.
- SyncType
- Message types exchanged over the live-sync WebSocket.
- SyncWsServer
Enums
Constants
- Payload version. Bump if the export shape changes incompatibly.
Functions
- Generates a 6-character uppercase alphanumeric token (no ambiguous chars).
-
resolveLocalIp(
) → Future< String?> -
showFileImportDialog(
BuildContext context, {required LocalFileShareService service, String title = 'Import Data', String blockedMessage = 'Cannot import while there are active items. Clear them first.'}) → Future< ImportSummary?> - Shows the file-import (FTP) dialog. Returns ImportSummary on success.
- Shows the file-share (FTP) host dialog: starts a LAN HTTP server and displays a QR code + connection details for receivers.
-
showRealtimeSyncDialog(
BuildContext context, {required RealtimeSyncEngine engine, String title = 'Live Sync', String description = 'Keep data in sync across devices on the same Wi-Fi. One device hosts; others join.'}) → Future< void> - Opens the live-sync (DTP) dialog — host or join.