Skip to content

AppUsageInfo

The usage of a single app, as listed in AppUsage.

Annotations

Constructors

AppUsageInfo.fromAppUsageInfo

AppUsageInfo.fromAppUsageInfo(
  1. AppUsageInfo info
)

Creates an AppUsageInfo from the app_usage plugin's usage info.

AppUsageInfo.fromJson

AppUsageInfo.fromJson(
  1. Map<String, dynamic> json
)

AppUsageInfo

AppUsageInfo(
  1. String name,
  2. String packageName,
  3. Duration usage,
  4. DateTime startDate,
  5. DateTime endDate,
  6. DateTime lastForeground,
)

Properties

endDate

DateTime endDate
getter/setter pair

The end of the interval.

lastForeground

DateTime lastForeground
getter/setter pair

The last time the app was in the foreground.

name

String name
getter/setter pair

The name of the application.

packageName

String packageName
getter/setter pair

The full name of the application package.

startDate

DateTime startDate
getter/setter pair

The start of the interval.

usage

Duration usage
getter/setter pair

The amount of time the application has been used in the interval from startDate to endDate.

Methods

toJson

Map<String, dynamic> toJson()

toString

String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.