Flutter Screen Time is an iOS-only project.
- Get permission status
- Select apps to block
- Block/unblock apps
Add the plugin to your pubspec.yaml file:
dependencies:
flutter_screen_time_api: ^0.0.1Before running this project, make sure your Xcode target has the Family Controls capability enabled.
final _flutterScreenTimePlugin = FlutterScreenTime();Future<int> checkAuthorization() async {
return await _flutterScreenTimePlugin.checkAuthorization();
}Statuses:
-1 -> Permission denied
1 -> Permission granted
0 -? Not determined
void getAuthorization() {
_flutterScreenTimePlugin.getAuthorization();
}void chooseApps() {
_flutterScreenTimePlugin.chooseApps();
}void blockApps() {
_flutterScreenTimePlugin.blockApps();
}void unblockApps() {
_flutterScreenTimePlugin.unblockApps();
}
