ScreenTimePlatform class abstract

Inheritance
  • Object
  • PlatformInterface
  • ScreenTimePlatform
Implementers

Constructors

ScreenTimePlatform.new()
Constructs a ScreenTimePlatform.

Properties

hashCode int
The hash code for this object.
no setterinherited
isOnBlockingApps Future<bool>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

appUsageData({DateTime? startTime, DateTime? endTime, UsageInterval usageInterval = UsageInterval.daily, List<String>? packagesName}) Future<List<AppUsage>>
Fetch app usage data from the device.
blockApps({List<String> packagesName = const <String>[], required Duration duration, required String layoutName, String? notificationTitle, String? notificationText}) Future<bool>
cancelScheduledBlock(String scheduleId) Future<bool?>
configureAppMonitoringService({UsageInterval interval = UsageInterval.daily, int lookbackTimeMs = 10000}) Future<bool>
Configures the app monitoring service with the specified interval and lookback time
getActiveSchedules() Future<Map<String, dynamic>?>
installedApps({bool ignoreSystemApps = true}) Future<List<InstalledApp>>
isBlockingPaused() Future<Map<String, dynamic>>
Check if app blocking is currently paused
monitoringAppUsage({int startHour = 0, int startMinute = 0, int endHour = 23, int endMinute = 59, UsageInterval usageInterval = UsageInterval.daily, int lookbackTimeMs = 10000, List<String>? packagesName}) Future<MonitoringAppUsage>
Start monitoring app usage with the specified schedule.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pauseBlockApps({required Duration pauseDuration, String? notificationTitle, String? notificationText, bool showNotification = true}) Future<bool>
Temporarily pause blocking apps for a specified duration After the pause duration expires, blocking will automatically resume
permissionStatus({ScreenTimePermissionType permissionType = ScreenTimePermissionType.appUsage}) Future<ScreenTimePermissionStatus>
requestPermission({UsageInterval interval = UsageInterval.daily, ScreenTimePermissionType permissionType = ScreenTimePermissionType.appUsage}) Future<bool>
Returns a RequestPermissionModel with the following keys:
scheduleBlock({required String scheduleId, required List<String> packagesName, required DateTime startTime, required Duration duration, bool recurring = false, List<int> daysOfWeek = const []}) Future<bool?>
streamAppUsage({UsageInterval usageInterval = UsageInterval.daily, int lookbackTimeMs = 10000}) Stream<Map<String, dynamic>>
Stream app usage data in real-time.
toString() String
A string representation of this object.
inherited
unblockApps({List<String> packagesName = const <String>[]}) Future<bool>

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance ScreenTimePlatform
The default instance of ScreenTimePlatform to use.
getter/setter pair