The big problem with the previous version is that the range in which the app usage was measured was not saved. This range cannot be set and therefore is not the same as the input time range (see https://github.com/cph-cachet/flutter-plugins/issues/592). Additionally some extra information on appusage is gathered (last time app was in foreground).
The maps go from the string of the package name to the following:
usage : total time in foreground
startRange: The start of the range
stopRange: The end of the range
lastUseForeground: The last time the app was in foreground
I'm not sure if 4 separate maps is the best way of outputting the information though.
Additionally, the maps now have the full package name. Only taking the last part doesn't give enough information for all apps. Examples:
com.brave.browser
com.instagram.android
com.imdb.mobile
I think I did the automatic JsonSerializableGenerator correct, but I have no experience with this...
The big problem with the previous version is that the range in which the app usage was measured was not saved. This range cannot be set and therefore is not the same as the input time range (see https://github.com/cph-cachet/flutter-plugins/issues/592). Additionally some extra information on appusage is gathered (last time app was in foreground).
First of course the pull request from https://github.com/cph-cachet/flutter-plugins/pull/624 needs to be accepted. After that there probably needs to be a change in pubspec.yaml.
This pull requests makes sure that the range for each app is saved. Instead of one, there are now 4 maps in the output.
The maps go from the string of the package name to the following: usage : total time in foreground startRange: The start of the range stopRange: The end of the range lastUseForeground: The last time the app was in foreground
I'm not sure if 4 separate maps is the best way of outputting the information though.
Additionally, the maps now have the full package name. Only taking the last part doesn't give enough information for all apps. Examples:
I think I did the automatic JsonSerializableGenerator correct, but I have no experience with this...