📜  在颤动中检测操作系统 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:28.795000             🧑  作者: Mango

代码示例1
import 'dart:io' show Platform, stdout;

void main() {
  // Get the operating system as a string.
  String os = Platform.operatingSystem;
  // Or, use a predicate getter.
  if (Platform.isMacOS) {
    print('is a Mac');
  } else {
    print('is not a Mac');
  }
}