I am new to flutter.
I have this method
Future<String?> _getDeviceIdId() async
{
var deviceInfo = DeviceInfoPlugin();
var androidDeviceInfo = await deviceInfo.androidInfo;
return androidDeviceInfo.androidId; // unique ID on Android
}
Now androidDeviceInfo.androidId return a string.
However when I do
String? deviceId = await _getDeviceIdId();
deviceId is always null.
I tried this
String? deviceId;
deviceId = await _getDeviceIdId().then((value) => deviceId);
but also no luck