一、实现方式
自己实现不太现实,还是使用第三方平台,比如腾讯Bugly,免费的,地址:https://bugly.qq.com/
二、引入
因为官网文档只有针对安卓和苹果的,没有flutter的,所以在网上找了一个库
引入库地址:https://github.com/crazecoder/flutter_bugly
dependencies:flutter_bugly: 0.4.4
三、代码
FlutterBugly.postCatchedException(() {// 如果需要 ensureInitialized,请在这里运行。WidgetsFlutterBinding.ensureInitialized();//kBootArgs = List.from(args);runMobileApp();FlutterBugly.init(androidAppId: "",iOSAppId: "",).then((res){print(res.message);});},debugUpload: false, //设置debug模式是否上传日志);