GitPedia

Flutter screentime

Using Screen Time API for iOS in Flutter; similar implementation in Android.

From ioridev·Updated May 7, 2026·View on GitHub·

- The plugin owns the Flutter API, Android foreground overlay service, and iOS native bridge. - The host iOS app owns Screen Time extension targets, entitlements, signing, and final shield-screen presentation. The project is written primarily in Kotlin, distributed under the MIT License license, first published in 2023. Key topics include: android, digital-wellbeing, flutter, ios, kotlin.

flutter_screentime

日本語版 README

Flutter plugin for Screen Time style blocking.

The package now splits concerns this way:

  • The plugin owns the Flutter API, Android foreground overlay service, and iOS native bridge.
  • The host iOS app owns Screen Time extension targets, entitlements, signing, and final shield-screen presentation.

Demo

iOS

iOS demo

Android

Android demo

What the plugin does

  • Requests authorization on iOS and opens the required settings screens on Android.
  • Presents FamilyActivityPicker on iOS to capture blocked app selections.
  • Applies ManagedSettingsStore shielding on iOS for the selected apps and categories.
  • Runs a configurable Android overlay for blocked apps.
  • Persists block-screen configuration into shared storage so host iOS extensions can render custom screens.

Dart API

dart
const screenTime = FlutterScreentime(); await screenTime.setSharedContainerId('group.your.app'); await screenTime.configureBlockScreen( const ScreenTimeBlockScreenConfig( title: 'Focus mode', message: 'This app is blocked right now.', backgroundColorHex: '#0F172A', textColorHex: '#F8FAFC', primaryButtonLabel: 'Open app', secondaryButtonLabel: 'Settings', ), ); await screenTime.requestAuthorization(); await screenTime.selectBlockedApps(); await screenTime.startBlocking();

iOS extension model

Custom blocked screens are still a host-app concern. This plugin stores the configuration, but the host app must add:

  • Shield Configuration Extension
  • Device Activity Monitor Extension, if needed
  • a shared App Group
  • the Family Controls capability

Setup details: doc/ios_extensions.md

Templates:

Android notes

Android does not have an equivalent Screen Time API, so the plugin uses:

  • SYSTEM_ALERT_WINDOW
  • PACKAGE_USAGE_STATS
  • a foreground service overlay

If you do not set blocked packages explicitly, the Android implementation blocks all launchable non-system apps except the host app itself.

Contributors

Showing top 1 contributor by commit count.

View all contributors on GitHub →

This article is auto-generated from ioridev/flutter_screentime via the GitHub API.Last fetched: 6/23/2026