feat(android,interface): Handle battery optimisation

This commit is contained in:
2023-08-05 00:04:49 +02:00
parent 497ac279cc
commit 0d4f0c59cc
11 changed files with 165 additions and 5 deletions

View File

@@ -271,6 +271,21 @@ class MyHomePageState extends State<MyHomePage> {
},
child: const Text('Get cache directory'),
),
ElevatedButton(
onPressed: () async {
// ignore: avoid_print
print(await MoxplatformPlugin.platform
.isIgnoringBatteryOptimizations());
},
child: const Text('Is battery optimised?'),
),
ElevatedButton(
onPressed: () async {
await MoxplatformPlugin.platform
.openBatteryOptimisationSettings();
},
child: const Text('Open battery optimisation page'),
),
],
),
),