getAppUsage method

  1. @override
Future<String?> getAppUsage(
  1. int periodInDays
)
override

Implementation

@override
Future<String?> getAppUsage(int periodInDays) async {
  try {
    final String? appUsage = await methodChannel
        .invokeMethod<String>('getAppUsage', {'periodInDays': periodInDays});
    return appUsage;
  } catch (e) {
    debugPrint("Failed to get app usage: $e");
    return null;
  }
}