From a5a7436bb1dc1938828b39547c51642ed8df4531 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Fri, 22 Dec 2023 21:12:07 -0500 Subject: [PATCH] Share button now shares Obtainium "protocol" links --- lib/pages/apps.dart | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/lib/pages/apps.dart b/lib/pages/apps.dart index 6deda9e..25f8b72 100644 --- a/lib/pages/apps.dart +++ b/lib/pages/apps.dart @@ -496,14 +496,8 @@ class AppsPageState extends State { var transparent = Theme.of(context).colorScheme.background.withAlpha(0).value; List 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 { 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 { 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 { 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)) ]) ] ],