Home > database >  Flutter - How to get mac address without using package
Flutter - How to get mac address without using package

Time:09-26

I Know how to get mac address by using get_mac flutter package

can anyone here tell me How to Get MAC Address without using any package in flutter

CodePudding user response:

Use this method

class GetMacAddress {
  static const MethodChannel _channel = const MethodChannel('get_mac');

  static Future<String> get macAddress async {
    final String macID = await _channel.invokeMethod('getMacAddress');
    return macID;
  }
}

Call it like this

print(GetMacAddress.macAddress);

CodePudding user response:

You can't really get the mac address for privacy concerns. Old versions of android may give it up, but new ones will just give you placeholders.

  • Related