getDeviceSerial method

  1. @override
Future<String?> getDeviceSerial()
override

Gets the device's serial number.

Implementation

@override
Future<String?> getDeviceSerial() async {
  try {
    final serial =
        await methodChannel.invokeMethod<String>('getDeviceSerial');
    return serial;
  } on PlatformException catch (e) {
    debugPrint('Failed to get device serial: ${e.message}');
    return null;
  }
}