mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-23 10:53:45 +02:00
Merge pull request #1180 from ImranR98/dev
- Fix installed version bug when importing apps (#1179) - Share button now shares Obtainium "protocol" links
This commit is contained in:
@@ -19,7 +19,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
|
||||
// ignore: implementation_imports
|
||||
import 'package:easy_localization/src/localization.dart';
|
||||
|
||||
const String currentVersion = '0.14.39';
|
||||
const String currentVersion = '0.14.40';
|
||||
const String currentReleaseTag =
|
||||
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES
|
||||
|
||||
|
@@ -496,14 +496,8 @@ class AppsPageState extends State<AppsPage> {
|
||||
var transparent =
|
||||
Theme.of(context).colorScheme.background.withAlpha(0).value;
|
||||
List<double> stops = [
|
||||
...listedApps[index]
|
||||
.app
|
||||
.categories
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) =>
|
||||
((e.key / (listedApps[index].app.categories.length - 1))))
|
||||
,
|
||||
...listedApps[index].app.categories.asMap().entries.map(
|
||||
(e) => ((e.key / (listedApps[index].app.categories.length - 1)))),
|
||||
1
|
||||
];
|
||||
if (stops.length == 2) {
|
||||
@@ -516,13 +510,9 @@ class AppsPageState extends State<AppsPage> {
|
||||
begin: const Alignment(-1, 0),
|
||||
end: const Alignment(-0.97, 0),
|
||||
colors: [
|
||||
...listedApps[index]
|
||||
.app
|
||||
.categories
|
||||
.map((e) =>
|
||||
Color(settingsProvider.categories[e] ?? transparent)
|
||||
.withAlpha(255))
|
||||
,
|
||||
...listedApps[index].app.categories.map((e) =>
|
||||
Color(settingsProvider.categories[e] ?? transparent)
|
||||
.withAlpha(255)),
|
||||
Color(transparent)
|
||||
])),
|
||||
child: ListTile(
|
||||
@@ -881,7 +871,7 @@ class AppsPageState extends State<AppsPage> {
|
||||
onPressed: () {
|
||||
String urls = '';
|
||||
for (var a in selectedApps) {
|
||||
urls += '${a.url}\n';
|
||||
urls += 'obtainium://add/${a.url}\n';
|
||||
}
|
||||
urls = urls.substring(0, urls.length - 1);
|
||||
Share.share(urls,
|
||||
@@ -981,10 +971,8 @@ class AppsPageState extends State<AppsPage> {
|
||||
defaultValue: filter.sourceFilter,
|
||||
[
|
||||
MapEntry('', tr('none')),
|
||||
...sourceProvider.sources
|
||||
.map((e) =>
|
||||
MapEntry(e.runtimeType.toString(), e.name))
|
||||
|
||||
...sourceProvider.sources.map(
|
||||
(e) => MapEntry(e.runtimeType.toString(), e.name))
|
||||
])
|
||||
]
|
||||
],
|
||||
|
@@ -740,12 +740,15 @@ class AppsProvider with ChangeNotifier {
|
||||
return appsDir;
|
||||
}
|
||||
|
||||
Future<PackageInfo?> getInstalledInfo(String? packageName) async {
|
||||
Future<PackageInfo?> getInstalledInfo(String? packageName,
|
||||
{bool printErr = true}) async {
|
||||
if (packageName != null) {
|
||||
try {
|
||||
return await pm.getPackageInfo(packageName: packageName);
|
||||
} catch (e) {
|
||||
print(e); // OK
|
||||
if (printErr) {
|
||||
print(e); // OK
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -1253,9 +1256,8 @@ class AppsProvider with ChangeNotifier {
|
||||
await Future.delayed(const Duration(microseconds: 1));
|
||||
}
|
||||
for (App a in importedApps) {
|
||||
if (apps[a.id]?.app.installedVersion != null) {
|
||||
a.installedVersion = apps[a.id]?.app.installedVersion;
|
||||
}
|
||||
a.installedVersion =
|
||||
(await getInstalledInfo(a.id, printErr: false))?.versionName;
|
||||
}
|
||||
await saveApps(importedApps, onlyIfExists: false);
|
||||
notifyListeners();
|
||||
|
@@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 0.14.39+233 # When changing this, update the tag in main() accordingly
|
||||
version: 0.14.40+234 # When changing this, update the tag in main() accordingly
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
|
Reference in New Issue
Block a user