/// 在ui中使用下面的这个判断
Theme.of(context).platform == TargetPlatform.android
/// 而不是
import 'dart:io'
Platform.isAndroid
然后使用VScode开启
Dart: Open Dev Tools
开启ios就能看到ui变化
/// 在ui中使用下面的这个判断
Theme.of(context).platform == TargetPlatform.android
/// 而不是
import 'dart:io'
Platform.isAndroid
然后使用VScode开启
Dart: Open Dev Tools
开启ios就能看到ui变化
转载于:https://www.cnblogs.com/ajanuw/p/11116560.html