Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有颤振 2.10 SDK,但没有关于本机 Web 替换的文档。请任何人阐明这个问题。
你需要做的是基于宿主平台执行代码。
首先导入相关的头文件
import 'dart:io' show Platform;
现在使用平台 API,您可以检测主机平台并为目标平台执行代码:
void myCode() { if (Platform.isWindows) { // do something specific for Windows here } else { // do something for other platforms } }