获取当前设备的名称。
static Future<String?> getDeviceName() async { try { return Platform.localHostname; } catch (e) { debugPrint("Failed to get device name: '${e.toString()}'."); return null; } }