mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-21 02:03:44 +02:00
This commit is contained in:
@@ -16,9 +16,14 @@ import 'package:provider/provider.dart';
|
|||||||
import 'package:markdown/markdown.dart' as md;
|
import 'package:markdown/markdown.dart' as md;
|
||||||
|
|
||||||
class AppPage extends StatefulWidget {
|
class AppPage extends StatefulWidget {
|
||||||
const AppPage({super.key, required this.appId});
|
const AppPage({
|
||||||
|
super.key,
|
||||||
|
required this.appId,
|
||||||
|
this.showOppositeOfPreferredView = false,
|
||||||
|
});
|
||||||
|
|
||||||
final String appId;
|
final String appId;
|
||||||
|
final bool showOppositeOfPreferredView;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AppPage> createState() => _AppPageState();
|
State<AppPage> createState() => _AppPageState();
|
||||||
@@ -60,6 +65,11 @@ class _AppPageState extends State<AppPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var appsProvider = context.watch<AppsProvider>();
|
var appsProvider = context.watch<AppsProvider>();
|
||||||
var settingsProvider = context.watch<SettingsProvider>();
|
var settingsProvider = context.watch<SettingsProvider>();
|
||||||
|
var showAppWebpageFinal =
|
||||||
|
(settingsProvider.showAppWebpage &&
|
||||||
|
!widget.showOppositeOfPreferredView) ||
|
||||||
|
(!settingsProvider.showAppWebpage &&
|
||||||
|
widget.showOppositeOfPreferredView);
|
||||||
getUpdate(String id, {bool resetVersion = false}) async {
|
getUpdate(String id, {bool resetVersion = false}) async {
|
||||||
try {
|
try {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -565,7 +575,7 @@ class _AppPageState extends State<AppPage> {
|
|||||||
icon: const Icon(Icons.settings),
|
icon: const Icon(Icons.settings),
|
||||||
tooltip: tr('settings'),
|
tooltip: tr('settings'),
|
||||||
),
|
),
|
||||||
if (app != null && settingsProvider.showAppWebpage)
|
if (app != null && showAppWebpageFinal)
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showDialog(
|
showDialog(
|
||||||
@@ -661,10 +671,10 @@ class _AppPageState extends State<AppPage> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: settingsProvider.showAppWebpage ? AppBar() : appScreenAppBar(),
|
appBar: showAppWebpageFinal ? AppBar() : appScreenAppBar(),
|
||||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||||
body: RefreshIndicator(
|
body: RefreshIndicator(
|
||||||
child: settingsProvider.showAppWebpage
|
child: showAppWebpageFinal
|
||||||
? getAppWebView()
|
? getAppWebView()
|
||||||
: CustomScrollView(
|
: CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
|
@@ -451,40 +451,57 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getAppIcon(int appIndex) {
|
getAppIcon(int appIndex) {
|
||||||
return FutureBuilder(
|
return GestureDetector(
|
||||||
future: appsProvider.updateAppIcon(listedApps[appIndex].app.id),
|
child: FutureBuilder(
|
||||||
builder: (ctx, val) {
|
future: appsProvider.updateAppIcon(listedApps[appIndex].app.id),
|
||||||
return listedApps[appIndex].icon != null
|
builder: (ctx, val) {
|
||||||
? Image.memory(
|
return listedApps[appIndex].icon != null
|
||||||
listedApps[appIndex].icon!,
|
? Image.memory(
|
||||||
gaplessPlayback: true,
|
listedApps[appIndex].icon!,
|
||||||
opacity: AlwaysStoppedAnimation(
|
gaplessPlayback: true,
|
||||||
listedApps[appIndex].installedInfo == null ? 0.6 : 1,
|
opacity: AlwaysStoppedAnimation(
|
||||||
),
|
listedApps[appIndex].installedInfo == null ? 0.6 : 1,
|
||||||
)
|
),
|
||||||
: Row(
|
)
|
||||||
mainAxisSize: MainAxisSize.min,
|
: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
Transform(
|
children: [
|
||||||
alignment: Alignment.center,
|
Transform(
|
||||||
transform: Matrix4.rotationZ(0.31),
|
alignment: Alignment.center,
|
||||||
child: Padding(
|
transform: Matrix4.rotationZ(0.31),
|
||||||
padding: const EdgeInsets.all(15),
|
child: Padding(
|
||||||
child: Image(
|
padding: const EdgeInsets.all(15),
|
||||||
image: const AssetImage(
|
child: Image(
|
||||||
'assets/graphics/icon_small.png',
|
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,
|
||||||
),
|
),
|
||||||
color: Theme.of(context).brightness == Brightness.dark
|
|
||||||
? Colors.white.withOpacity(0.4)
|
|
||||||
: Colors.white.withOpacity(0.3),
|
|
||||||
colorBlendMode: BlendMode.modulate,
|
|
||||||
gaplessPlayback: true,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
);
|
||||||
);
|
},
|
||||||
|
),
|
||||||
|
onDoubleTap: () {
|
||||||
|
pm.openApp(listedApps[appIndex].app.id);
|
||||||
|
},
|
||||||
|
onLongPress: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => AppPage(
|
||||||
|
appId: listedApps[appIndex].app.id,
|
||||||
|
showOppositeOfPreferredView: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user