Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions lib/utils/system_utils.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import 'dart:typed_data';

import 'package:installed_apps/installed_apps.dart';
import 'package:logging/logging.dart';

Future<Uint8List?> getInstalledAppIcon(String sourceId) async {
final log = Logger("InstalledAppIcon");
if (sourceId.isNotEmpty) {
try {
var appIcon =
(await InstalledApps.getAppInfo(sourceId.toString(), null))?.icon;
if (appIcon != null && appIcon.isNotEmpty) {
return appIcon;
}
} catch (_) {
log.info("App icon fetching failed");
}
// Sadly due to the QUERY_ALL_PACKAGES permission not being allowed for release in the Play Store in this use case, this
// method is not usable in production. Therefore we have to disable it for now.
// TODO: Find a way to get the app icon without using QUERY_ALL_PACKAGES
// var appIcon =
// (await InstalledApps.getAppInfo(sourceId.toString(), null))?.icon;
// if (appIcon != null && appIcon.isNotEmpty) {
// return appIcon;
// }
}
return null;
}
Expand Down
8 changes: 0 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -494,14 +494,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.5.4"
installed_apps:
dependency: "direct main"
description:
name: installed_apps
sha256: dd2b7c531f91114cd6df447c56567593c9799ca83f057137ae719324ae0afd06
url: "https://pub.dev"
source: hosted
version: "1.6.0"
intl:
dependency: "direct main"
description:
Expand Down
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ dependencies:
percent_indicator: ^4.2.3
shared_preferences: ^2.3.1
fl_chart: ^0.70.2
installed_apps: ^1.5.2
package_info_plus: ^8.3.0
sqflite: ^2.4.1
path: ^1.9.0
Expand Down
Loading