How to log data to the Flutter console?

前端 未结 5 1149
攒了一身酷
攒了一身酷 2020-12-23 19:01

I am a beginner and using IntelliJ IDEA, and I wanted to log data to the console?

I tried print() and printDebug(), but none of my data were

5条回答
  •  暖寄归人
    2020-12-23 19:24

    The Dart print() function outputs to the system console, which you can view using flutter logs (which is basically a wrapper around adb logcat).

    If you output too much at once, then Android sometimes discards some log lines. To avoid this, you can use debugPrint().

    Found here: https://flutter.io/docs/testing/debugging

提交回复
热议问题