Scrolling bugfix #392, custom name #420, search archive label #421

This commit is contained in:
Imran Remtulla
2023-04-04 19:59:35 -04:00
parent dea635fa6a
commit e6b05d50b9
5 changed files with 24 additions and 18 deletions

View File

@@ -185,9 +185,11 @@ class GitHub extends AppSource {
Map<String, String> urlsWithDescriptions = {};
for (var e in (jsonDecode(res.body)['items'] as List<dynamic>)) {
urlsWithDescriptions.addAll({
e['html_url'] as String: e['description'] != null
e['html_url'] as String:
((e['archived'] == true ? '[ARCHIVED] ' : '') +
(e['description'] != null
? e['description'] as String
: tr('noDescription')
: tr('noDescription')))
});
}
return urlsWithDescriptions;

View File

@@ -334,8 +334,7 @@ class _AddAppPageState extends State<AddAppPage> {
],
);
Widget getSourcesListWidget() => Expanded(
child: Column(
Widget getSourcesListWidget() => Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
@@ -365,16 +364,17 @@ class _AddAppPageState extends State<AddAppPage> {
fontStyle: FontStyle.italic),
)))
.toList()
]));
]);
return Scaffold(
backgroundColor: Theme.of(context).colorScheme.surface,
body: CustomScrollView(slivers: <Widget>[
body: CustomScrollView(shrinkWrap: true, slivers: <Widget>[
CustomAppBar(title: tr('addApp')),
SliverFillRemaining(
SliverToBoxAdapter(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
getUrlInputRow(),

View File

@@ -147,7 +147,7 @@ class _AppPageState extends State<AppPage> {
height: 25,
),
Text(
app?.installedInfo?.name ?? app?.app.name ?? tr('app'),
app?.app.name ?? tr('app'),
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.displayLarge,
),

View File

@@ -670,6 +670,9 @@ class AppsProvider with ChangeNotifier {
for (var app in apps) {
AppInfo? info = await getInstalledInfo(app.id);
app.name = info?.name ?? app.name;
if (app.additionalSettings['appName']?.toString().isNotEmpty == true) {
app.name = app.additionalSettings['appName'].toString().trim();
}
if (attemptToCorrectInstallStatus) {
app = getCorrectedInstallStatusAppIfPossible(app, info) ?? app;
}

View File

@@ -278,7 +278,8 @@ class AppSource {
return regExValidator(value);
}
])
]
],
[GeneratedFormTextField('appName', label: tr('appName'), required: false)]
];
// Previous 2 variables combined into one at runtime for convenient usage
@@ -427,8 +428,10 @@ class SourceProvider {
throw NoAPKError();
}
String apkVersion = apk.version.replaceAll('/', '-');
var name = currentApp?.name.trim() ??
apk.names.name[0].toUpperCase() + apk.names.name.substring(1);
var name = currentApp != null ? currentApp.name.trim() : '';
name = name.isNotEmpty
? name
: apk.names.name[0].toUpperCase() + apk.names.name.substring(1);
return App(
currentApp?.id ??
source.tryInferringAppId(standardUrl,
@@ -436,9 +439,7 @@ class SourceProvider {
generateTempID(standardUrl, additionalSettings),
standardUrl,
apk.names.author[0].toUpperCase() + apk.names.author.substring(1),
name.trim().isNotEmpty
? name
: apk.names.name[0].toUpperCase() + apk.names.name.substring(1),
name,
currentApp?.installedVersion,
apkVersion,
apk.apkUrls,