import 'package:flutter/foundation.dart'; import 'bonsoir_server_discovery.dart'; import 'browser_server_discovery.dart'; import 'discovered_server.dart'; /// Finds Pipelines servers on the local network. abstract interface class ServerDiscovery { /// Browses while listened to. Each event is every server currently known; /// a failure to browse is a stream error. Cancelling stops the browse. Stream> scan(); } /// The discovery this platform supports, or null where there is none. /// /// Browsers ask their authenticated front door to browse its LAN. Native /// clients browse directly through the platform DNS-SD service. ServerDiscovery? platformServerDiscovery({bool web = kIsWeb}) => web ? BrowserServerDiscovery() : BonsoirServerDiscovery();