简体   繁体   English

如何在 Flutter 中的原生 iOS 代码中使用打印方法?

[英]How to use print method inside native iOS code in Flutter?

I'm trying to use print method in native iOS code in Flutter project.我正在尝试在 Flutter 项目的原生 iOS 代码中使用打印方法。

This is how I tried:这是我尝试的方式:

print("")
debugPrint("")
OSLog("")

But nothing printed anything to the console!但是没有任何东西打印到控制台!

How can I do that?我怎样才能做到这一点?

If you want to interact with the underlying native platform you're going to need a Platform Channel.如果您想与底层原生平台进行交互,您将需要一个平台通道。 This will allow calling native methods from Dart in an async way.这将允许以async方式从 Dart 调用本机方法。

You can find everything you need complete with examples here !你可以在这里找到你需要的一切,并附有示例!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM