Future<int> getBatteryLevel() async { final level = await methodChannel.invokeMethod<int>('getBatteryLevel'); return level ?? -1; }