flutter 判断平台

40次阅读
没有评论
//'dart:io' 下
if (Platform.isIOS) {
 //ios   
} else {
//andriod
}

/// 在ui中使用下面的这个判断
if (Theme.of(context).platform ==TargetPlatform.iOS) {
  //ios             
} else {
//andriod
}
正文完