flutter_screen_time_api 0.0.1 copy "flutter_screen_time_api: ^0.0.1" to clipboard
flutter_screen_time_api: ^0.0.1 copied to clipboard

PlatformiOS

Screen time

flutter_screen_time #

Flutter Screen Time is an iOS-only project.

Demo

Features #

  • Get permission status
  • Select apps to block
  • Block/unblock apps

Installation #

Add the plugin to your pubspec.yaml file:

dependencies:
  flutter_screen_time_api: ^0.0.1

Prerequisite #

Before running this project, make sure your Xcode target has the Family Controls capability enabled.

FlutterScreenTimeScreenshot

Setup #

iOS #

Create Object #

final _flutterScreenTimePlugin = FlutterScreenTime();

1. Permission Information

Future<int> checkAuthorization() async {
  return await _flutterScreenTimePlugin.checkAuthorization();
}
Statuses: 
-1 -> Permission denied
1 -> Permission granted
0 -? Not determined

2. Get Permission

void getAuthorization() {
  _flutterScreenTimePlugin.getAuthorization();
}

3. Choose Apps to block

void chooseApps() {
  _flutterScreenTimePlugin.chooseApps();
}

4. Block apps

void blockApps() {
  _flutterScreenTimePlugin.blockApps();
}

5. Unblock apps

void unblockApps() {
  _flutterScreenTimePlugin.unblockApps();
}