Когда я запускаю его в Linux, я получаю следующую ошибку:
Код: Выделить всё
/sys/firmware/dmi/tables/smbios entry point: Permission denied
/dev/mem: Permission denied
Код: Выделить всё
Unhandled Exception: MissingPluginException (No implementation found for method getUDIDon chanmel flutter_udid) MethodChannel._invokeMethod (package:flutter/src/services/platforn_channel.dart:320) chronous suspension> FlutterUdid.consistentudid (package:flutter_udid/flutter_udid.dart:22) chronous suspension> RoutePageState. loadBasics (package:my_app/routes.dart:73) chronous suspension
macAddress = await FlutterUdid.consistentUdid;< /p>
Код: Выделить всё
void loadBasics() async {
String? macAddress;
String? version;
try {
macAddress = await FlutterUdid.consistentUdid;
PackageInfo packageInfo = await PackageInfo.fromPlatform();
version = packageInfo.version;
} on PlatformException {
macAddress = 'Failed to get mac address.';
}
if (!mounted) return;
print(macAddress);
Future.delayed(Duration(seconds: 5), () {
// Do something
});
final SharedPreferences storage = await SharedPreferences.getInstance();
// await DesktopWindow.setFullScreen(true);
String? stationId = await storage.getString('stationId');
if (stationId == null) {
Get.off(() => Setup());
return;
}
http.Response response = await http.post(Uri.parse('https://**************/configure'), body: jsonEncode({
'key': stationId,
'mac': macAddress.toString(),
'version':version.toString()
}));
final result = jsonDecode(response.body);
print(response.body);
if (!result['success']) {
await storage.clear();
Get.off(() => Setup());
return;
}
Get.off(() => LiveFeed());
//Get.snackbar('', '', titleText: Directionality(textDirection: TextDirection.rtl, child: Text('אירעה שגיאה!', style: GoogleFonts.heebo(color: Colors.red, fontWeight: FontWeight.bold, fontSize: 12.sp))), messageText: Directionality(textDirection: TextDirection.rtl, child: Text(data['error'], style: GoogleFonts.heebo(color: Colors.red, fontSize: 11.sp))), snackPosition: SnackPosition.BOTTOM);
Следует отметить, что в Windows это работает отлично.
Вопрос в том, нужно ли мне давать определенное разрешение в Линукс/малина пи? Я запускаю проект с помощью SUDO.
Буду признателен за совет по этому вопросу.
Цель состоит в том, чтобы устройство отправило запрос на сервер и идентифицировалось как UUID/ MAC-адрес для проверки одобрения устройства сервером.
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/784 ... pplication
Мобильная версия