flutter_freedome_connectivity 1.0.1 copy "flutter_freedome_connectivity: ^1.0.1" to clipboard
flutter_freedome_connectivity: ^1.0.1 copied to clipboard

FreeDome connectivity and discovery library for Flutter applications

flutter_freedome_connectivity #

FreeDome connectivity and discovery library for Flutter applications.

Features #

  • Automatic discovery of FreeDome systems on local network
  • Connection management with multiple protocols (Socket.IO, WebSocket, HTTP)
  • Real-time event streaming
  • Heartbeat monitoring and auto-reconnection
  • Network scanning with configurable settings
  • Connection status tracking

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_freedome_connectivity: ^1.0.0

Usage #

Connection Service #

import 'package:flutter_freedome_connectivity/flutter_freedome_connectivity.dart';

final connectionService = FreeDomeConnectionService();

// Initialize the service
await connectionService.initialize();

// Start discovering systems
await connectionService.startDiscovery();

// Connect to a discovered system
final systems = connectionService.discoveredSystems;
if (systems.isNotEmpty) {
  final success = await connectionService.connectToDome(systems.first);
  if (success) {
    print('Connected to: ${connectionService.activeDome?.name}');
  }
}

// Listen to events
connectionService.eventStream.listen((event) {
  print('Event: ${event.type} - ${event.data}');
});

Discovery Service #

final discoveryService = FreeDomeDiscoveryService();

// Start discovery
await discoveryService.startDiscovery();

// Listen to discovered systems
discoveryService.systemsStream.listen((systems) {
  for (final system in systems) {
    print('Found system: ${system.name} at ${system.ipAddress}:${system.port}');
  }
});

// Check if system is available
final isAvailable = await discoveryService.isSystemAvailable(system);

Sending Commands #

// Send command to connected system
final response = await connectionService.sendCommand(
  FreeDomeCommand(
    type: 'play_video',
    data: {'video_id': '123', 'quality': 'hd'},
    targetSystemId: connectionService.activeDome?.id,
    timestamp: DateTime.now(),
  ),
);

if (response.success) {
  print('Command sent successfully');
} else {
  print('Command failed: ${response.error}');
}

API Reference #

Models #

  • DomeSystem - Represents a FreeDome system
  • FreeDomeConnectionStatus - Connection status information
  • FreeDomeEvent - Real-time events from systems
  • FreeDomeCommand - Commands to send to systems
  • FreeDomeResponse - Responses from systems
  • DiscoverySettings - Configuration for network discovery

Services #

  • FreeDomeConnectionService - Main connection management
  • FreeDomeDiscoveryService - Network discovery service

Enums #

  • DomeSystemStatus - System status (offline, online, maintenance, error)

License #

MIT License - see LICENSE file for details.

0
likes
125
points
104
downloads

Publisher

verified publisherfreedome.nativemind.net

Weekly Downloads

FreeDome connectivity and discovery library for Flutter applications

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http, json_annotation, network_info_plus, shared_preferences, socket_io_client, web_socket_channel

More

Packages that depend on flutter_freedome_connectivity