import 'package:flutter/foundation.dart'; import 'bonsoir_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 cannot send mDNS, and the web app is served by the server it /// talks to, so web has no scan. ServerDiscovery? platformServerDiscovery({bool web = kIsWeb}) => web ? null : BonsoirServerDiscovery();