How do you detect the host platform from Dart code?

前端 未结 9 2211
情书的邮戳
情书的邮戳 2020-12-02 08:57

For UI that should differ slightly on iOS and Android, i.e. on different platforms, there must be a way to detect

9条回答
  •  粉色の甜心
    2020-12-02 09:32

    Thanks to Collin, the final answer is:

    bool isIOS = Theme.of(context).platform == TargetPlatform.iOS;
    

提交回复
热议问题