MethodChannelScreenTime class
An implementation of ScreenTimePlatform that uses method channels.
- Inheritance
-
- Object
- PlatformInterface
- ScreenTimePlatform
- MethodChannelScreenTime
Constructors
Properties
- eventChannel → EventChannel
-
The event channel used for streaming app usage data
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isOnBlockingApps
→ Future<
bool> -
no setteroverride
- methodChannel → MethodChannel
-
The method channel used to interact with the native platform.
final
- 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.
override
-
blockApps(
{List< String> packagesName = const <String>[], required Duration duration, required String layoutName, String? notificationTitle, String? notificationText}) → Future<bool> -
override
-
cancelScheduledBlock(
String scheduleId) → Future< bool?> -
override
-
configureAppMonitoringService(
{UsageInterval interval = UsageInterval.daily, int lookbackTimeMs = 10000}) → Future< bool> -
Configures the app monitoring service with the specified interval and lookback time
override
-
getActiveSchedules(
) → Future< Map< String, dynamic> ?> -
override
-
installedApps(
{bool ignoreSystemApps = true}) → Future< List< InstalledApp> > -
override
-
isBlockingPaused(
) → Future< Map< String, dynamic> > -
Check if app blocking is currently paused
override
-
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.
override
-
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
override
-
permissionStatus(
{ScreenTimePermissionType permissionType = ScreenTimePermissionType.appUsage}) → Future< ScreenTimePermissionStatus> -
override
-
requestPermission(
{UsageInterval interval = UsageInterval.daily, ScreenTimePermissionType permissionType = ScreenTimePermissionType.appUsage}) → Future< bool> -
Returns a RequestPermissionModel with the following keys:
override
-
scheduleBlock(
{required String scheduleId, required List< String> packagesName, required DateTime startTime, required Duration duration, bool recurring = false, List<int> daysOfWeek = const []}) → Future<bool?> -
override
-
streamAppUsage(
{UsageInterval usageInterval = UsageInterval.daily, int lookbackTimeMs = 10000}) → Stream< Map< String, dynamic> > -
Stream app usage data in real-time.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
unblockApps(
{List< String> packagesName = const <String>[]}) → Future<bool> -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited