void getUsageStats() async {
try {
DateTime endDate = DateTime.now();
DateTime startDate = endDate.subtract(Duration(days: 1));
List<AppUsageInfo> infoList =
await AppUsage().getAppUsage(startDate, endDate);
setState(() => _infos = infoList);
for (var info in infoList) {
print(info.toString());
}
} on AppUsageException catch (exception) {
print(exception);
}
}
라는 함수를 통해서 앱의 사용기록을 받아주면 Ex) 앱 제목, 사용 시간 -> settings, 0:04:46.000000
으로 출력하게 되는데, 출력하지 않고 앱 제목과 사용시간을 firestore에 어떤식으로 저장할
수 있나요?