我正在调试应用程序。该应用程序将一些文件保存在本地存储中,我想查看该文件以调试该文件吗?有什么办法吗?
如果您能提供一些代码,以便我们能为您提供最好的帮助,那就太好了:)
我认为您可以编写一个函数来加载并读取localFile,并在初始化窗口小部件时调用它:
Future<String> read() async {
try {
final file = await _localFile;
// Read the file.
String contents = await file.readAsString();
print(contents);
return contents;
} catch (e) {
// error catching
}
}
希望有帮助!