init static method
初始化*
Implementation
static Future<void> init() async {
LogUtil.init();
//日志文件目录
logDir=(await getApplicationDocumentsDirectory()).path.toString();
//android使用/sdcard/Android/data/包名/files
if(Platform.isAndroid){
Directory? directory = await getExternalStorageDirectory();
if (directory != null) {
//不存在则创建
if (!await directory.exists()) {
await directory.create(recursive: true);
}
logDir=directory.path.toString();
}
}
i(tag, "logDir:$logDir");
inited=true;
}