wake_on_lan 4.1.1+3 copy "wake_on_lan: ^4.1.1+3" to clipboard
wake_on_lan: ^4.1.1+3 copied to clipboard

Send wake-on-LAN magic packets to devices on your local network.

example/main.dart

import 'package:wake_on_lan/wake_on_lan.dart';

void main() async {
  String ipv4 = '192.168.1.255';
  String mac = 'AA:BB:CC:DD:EE:FF';

  // Validate that the IP address is correctly formatted
  final ipValidation = IPAddress.validate(ipv4);
  if (!ipValidation.state) {
    throw ipValidation.error!;
  }

  // Validate that the MAC address is correctly formatted
  final macValidation = MACAddress.validate(mac);
  if (!macValidation.state) {
    throw macValidation.error!;
  }

  // Create the IP and MAC addresses
  IPAddress ipv4Address = IPAddress(ipv4);
  MACAddress macAddress = MACAddress(mac);

  // Send the Wake-on-LAN packet
  WakeOnLAN(ipv4Address, macAddress).wake();
}
12
likes
140
pub points
72%
popularity

Publisher

verified publisherjagandeepbrar.io

Send wake-on-LAN magic packets to devices on your local network.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (LICENSE)

Dependencies

convert

More

Packages that depend on wake_on_lan