admin管理员组文章数量:1122846
I'm trying to make a very simple app in Flutter (for my Android phone, Xiaomi 13T). It's supposed to run in the background and immediately set an alarm if I get a particular type of email from my Gmail. I figured the first thing that I should do is set up the persistence and a basic UI. Here's the code to add the file:
void add_to_file(String email, String search_term, String sender) async {
final filename = './alert_file.txt';
new File(filename).create(recursive: true);
final f = File(filename).writeAsString('$email,$search_term,$sender\n',mode: FileMode.append);
print('added file');
}
I connected the app to my phone, flutter build apk
, flutter install
, and ran in debug mode from VS Code and got the following:
I/ImeTracker(26100): com.example.email_alarm:1215632d: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
I/flutter (26100): added file
Based on this, my function is running, but I can't find the created file anywhere. I also can't find the com.example.email_alarm
folder in my phone's app data. The program works as intended when I run it as a desktop app. When I run it in my laptop's chrome, it just hangs when I press the button to trigger the add_to_file
function.
Is the app writing to a file? If so, where is it?
本文标签: androidWhere can I find the file my flutter app createdStack Overflow
版权声明:本文标题:android - Where can I find the file my flutter app created? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736300000a1930659.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论