Improve UI of recommended apps

This commit is contained in:
franzap
2024-11-13 00:02:07 -03:00
parent ac4ae00d06
commit 68edf5b13e
4 changed files with 30 additions and 22 deletions
+2 -1
View File
@@ -96,7 +96,8 @@ class AppDetailScreen extends HookConsumerWidget {
Divider(height: 24),
if (curatedBy.isNotEmpty)
UsersRichText(
trailingText: ' recommended this app',
trailingText:
' recommend${curatedBy.length == 1 ? 's' : ''} this app',
users: curatedBy.toList(),
),
if (curatedBy.isNotEmpty) Gap(20),
+1
View File
@@ -111,6 +111,7 @@ class AppCurationSetNotifier
final appCurationSet = await future;
final appsLocal =
ref.apps.appAdapter.findWhereIdentifierInLocal(appCurationSet.appIds);
// TODO: Rethink this logic, if an app is missing it loops forever
if (appsLocal.length < appCurationSet.appIds.length) {
state = AsyncLoading();
state = await AsyncValue.guard(() async {
+20 -19
View File
@@ -53,29 +53,30 @@ class InstallAlertDialog extends ConsumerWidget {
minimal: true,
labelText: 'Log in to view your own web of trust',
),
Gap(20),
if (app.latestMetadata?.urls.isNotEmpty ?? false)
RichText(
text: WidgetSpan(
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children: [
Text('This app will be downloaded from '),
Text(
Uri.parse(app.latestMetadata!.urls.first).host,
style: TextStyle(
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline,
),
),
Text(' and verified.'),
],
),
),
),
],
),
),
actions: [
if (app.latestMetadata?.urls.isNotEmpty ?? false)
RichText(
text: WidgetSpan(
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children: [
Text('This app will be downloaded from '),
Text(
Uri.parse(app.latestMetadata!.urls.first).host,
style: TextStyle(
fontWeight: FontWeight.bold,
decoration: TextDecoration.underline,
),
),
Text(' and verified.'),
],
),
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: TextButton(
+7 -2
View File
@@ -96,14 +96,19 @@ class UsersRichText extends StatelessWidget {
children: [
RoundedImage(url: user.avatarUrl, size: 20),
Text(
' ${user.nameOrNpub}${users.indexOf(user) == users.length - 1 ? '' : ', '}',
' ${user.nameOrNpub}',
style: TextStyle(fontWeight: FontWeight.bold),
),
Text(users.indexOf(user) == users.length - 1
? ''
: (users.indexOf(user) == users.length - 2
? ' and '
: ', ')),
],
),
),
if (users.indexOf(user) == users.length - 1)
TextSpan(text: trailingText)
TextSpan(text: trailingText, style: TextStyle(fontSize: 15))
],
),
],