Improve loading time/stability (at the cost of icon flickering)

This commit is contained in:
Imran Remtulla
2024-05-23 20:02:43 -04:00
parent 06a079e452
commit 7808bc5ccb
3 changed files with 66 additions and 91 deletions

View File

@@ -226,18 +226,26 @@ class _AppPageState extends State<AppPage> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SizedBox(height: 20),
app?.icon != null
? Row(mainAxisAlignment: MainAxisAlignment.center, children: [
GestureDetector(
child: Image.memory(
app!.icon!,
height: 150,
gaplessPlayback: true,
),
onTap: () => pm.openApp(app.app.id),
)
])
: Container(),
FutureBuilder(
future: app?.installedInfo?.applicationInfo?.getAppIcon(),
builder: (ctx, val) {
return val.data != null
? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: app == null
? null
: () => pm.openApp(app.app.id),
child: Image.memory(
val.data!,
height: 150,
gaplessPlayback: true,
),
)
])
: Container();
}),
const SizedBox(
height: 25,
),