mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-25 11:53:45 +02:00
Improve loading time/stability (at the cost of icon flickering)
This commit is contained in:
@@ -406,31 +406,37 @@ class AppsPageState extends State<AppsPage> {
|
||||
}
|
||||
|
||||
getAppIcon(int appIndex) {
|
||||
return listedApps[appIndex].icon != null
|
||||
? Image.memory(
|
||||
listedApps[appIndex].icon!,
|
||||
gaplessPlayback: true,
|
||||
)
|
||||
: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Transform(
|
||||
alignment: Alignment.center,
|
||||
transform: Matrix4.rotationZ(0.31),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Image(
|
||||
image: const AssetImage(
|
||||
'assets/graphics/icon_small.png'),
|
||||
color: Theme.of(context).brightness == Brightness.dark
|
||||
? Colors.white.withOpacity(0.4)
|
||||
: Colors.white.withOpacity(0.3),
|
||||
colorBlendMode: BlendMode.modulate,
|
||||
gaplessPlayback: true,
|
||||
),
|
||||
)),
|
||||
]);
|
||||
return FutureBuilder(
|
||||
future:
|
||||
listedApps[appIndex].installedInfo?.applicationInfo?.getAppIcon(),
|
||||
builder: (ctx, val) {
|
||||
return val.data != null
|
||||
? Image.memory(
|
||||
val.data!,
|
||||
gaplessPlayback: true,
|
||||
)
|
||||
: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Transform(
|
||||
alignment: Alignment.center,
|
||||
transform: Matrix4.rotationZ(0.31),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Image(
|
||||
image: const AssetImage(
|
||||
'assets/graphics/icon_small.png'),
|
||||
color: Theme.of(context).brightness ==
|
||||
Brightness.dark
|
||||
? Colors.white.withOpacity(0.4)
|
||||
: Colors.white.withOpacity(0.3),
|
||||
colorBlendMode: BlendMode.modulate,
|
||||
gaplessPlayback: true,
|
||||
),
|
||||
)),
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
getVersionText(int appIndex) {
|
||||
|
||||
Reference in New Issue
Block a user