screen_time_kit 0.1.0
screen_time_kit: ^0.1.0 copied to clipboard
One Dart API for screen time, app usage, and app limits — Android and iOS, unified. Wraps Android UsageStatsManager and iOS FamilyControls / DeviceActivity / ManagedSettings behind a single, type-safe [...]
0.1.0 #
Initial release. One Dart API for screen time, app usage, and app limits across Android and iOS.
Features #
- Permissions — unified
PermissionStatusover Android usage-access (AppOpsManager) and iOSFamilyControlsauthorization. - App usage —
getAppUsage()via AndroidUsageStatsManager(queryAndAggregateUsageStats). iOS reportsPlatformNotSupportedExceptionuntil aDeviceActivityReportExtensionis added (documented). - App limits —
setAppLimit/removeAppLimit/getActiveLimits/clearAllLimits. Soft (detect-and-notify) on Android via a usage poller +onLimitReachedstream; natively enforced on iOS viaManagedSettings. - Summaries — pure-Dart
getDailySummaries/getWeeklySummariesaggregation on top of raw usage. - Focus mode —
startFocusMode/stopFocusModeconvenience wrapper with automatic timer-based revert. - Typed exception hierarchy (
ScreenTimeExceptionand subclasses) mapping every native error code. - Example app demonstrating every feature and integration-test stubs for real-device flows.