Improve icon loading after last commit

This commit is contained in:
Imran Remtulla
2024-05-23 21:02:50 -04:00
parent 5edaf1306d
commit 6c5e5043a4
4 changed files with 40 additions and 21 deletions

View File

@@ -227,9 +227,9 @@ class _AppPageState extends State<AppPage> {
children: [
const SizedBox(height: 20),
FutureBuilder(
future: app?.installedInfo?.applicationInfo?.getAppIcon(),
future: appsProvider.updateAppIcon(app?.app.id),
builder: (ctx, val) {
return val.data != null
return app?.icon != null
? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
@@ -238,7 +238,7 @@ class _AppPageState extends State<AppPage> {
? null
: () => pm.openApp(app.app.id),
child: Image.memory(
val.data!,
app!.icon!,
height: 150,
gaplessPlayback: true,
),

View File

@@ -407,12 +407,11 @@ class AppsPageState extends State<AppsPage> {
getAppIcon(int appIndex) {
return FutureBuilder(
future:
listedApps[appIndex].installedInfo?.applicationInfo?.getAppIcon(),
future: appsProvider.updateAppIcon(listedApps[appIndex].app.id),
builder: (ctx, val) {
return val.data != null
return listedApps[appIndex].icon != null
? Image.memory(
val.data!,
listedApps[appIndex].icon!,
gaplessPlayback: true,
)
: Row(