Skip to content

faiziakbr/flutter_screen_time

Repository files navigation

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();
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors