community icon indicating copy to clipboard operation
community copied to clipboard

How to get MAC address for windows

Open oniangel12933 opened this issue 2 years ago • 1 comments

oniangel12933 avatar Sep 26 '23 15:09 oniangel12933

  1. Add Dependency: Add the network_info_plus package to your pubspec.yaml

dependencies: flutter: sdk: flutter network_info_plus: ^5.0.0 # Check for the latest version

  1. Import the Package: Import the package in your Dart file

import 'package:network_info_plus/network_info_plus.dart';

  1. Get MAC Address: Use the NetworkInfo class to fetch the MAC address. Here's an example:

void getMacAddress() async { final NetworkInfo networkInfo = NetworkInfo(); String? wifiBSSID = await networkInfo.getWifiBSSID(); // This gives the MAC address print('MAC Address: $wifiBSSID'); }

It will be print Mac Address!

MuhammadShoaib495 avatar Oct 10 '24 07:10 MuhammadShoaib495