Ami*_*dgi 5 dart flutter flutter-desktop flutter-windows
我正在开发一个 flutter 应用程序,该应用程序连接到打开它的桌面上的 MQTT 客户端。我想动态获取桌面的主机名并连接到它,而不是用户必须手动输入它。提前致谢。
小智 7
https://api.flutter.dev/flutter/dart-io/Platform-class.html
import 'dart:io' show Platform, stdout;
void main() {
// Get the hostname as a string.
String hostname = Platform.localHostname;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2825 次 |
| 最近记录: |