Reputation: 473
How can access programmatically home and power buttons ,I know that that turning screen off is only accessed by system apps in android , but what about moving to home screen ,can it accessed programmatically from flutter and if not are there any plugins that can do that action.
Upvotes: 3
Views: 1287
Reputation: 1349
Sadly, it is not possible to turn off the screen in Flutter, however you can perform system actions:
Use this library:
system_shortcuts: ^1.0.0
Import it like this:
import 'package:system_shortcuts/system_shortcuts.dart';
And then you can call:
await SystemShortcuts.home();
Please note however that this requires your function in which you call it to be async
Upvotes: 4