NearbyAndroidDevice constructor

NearbyAndroidDevice({
  1. required String deviceName,
  2. required String deviceAddress,
  3. bool isGroupOwner = false,
  4. bool isServiceDiscoveryCapable = false,
  5. String primaryDeviceType = kNearbyUnknown,
  6. bool wpsKeypadSupported = false,
  7. bool wpsPbcSupported = false,
  8. bool wpsDisplaySupported = false,
  9. String? secondaryDeviceType,
  10. NearbyDeviceStatus status = NearbyDeviceStatus.unavailable,
})

The class representing the Android class WifiP2pDevice.

Automatically generates the info field from the deviceName and deviceAddress fields.

They are used because in a Wifi Direct environment the MAC address of the device is an identifier on the network.

Implementation

NearbyAndroidDevice({
  required String deviceName,
  required this.deviceAddress,
  this.isGroupOwner = false,
  this.isServiceDiscoveryCapable = false,
  this.primaryDeviceType = kNearbyUnknown,
  this.wpsKeypadSupported = false,
  this.wpsPbcSupported = false,
  this.wpsDisplaySupported = false,
  this.secondaryDeviceType,
  super.status = NearbyDeviceStatus.unavailable,
}) : super(
        info: NearbyDeviceInfo(
          displayName: deviceName,
          id: deviceAddress,
        ),
      );