[client] Show public shares on info view

This commit is contained in:
Abhishek Shroff
2025-05-04 09:35:21 +05:30
parent c44fff597a
commit deb6602e15

View File

@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:offtheline/offtheline.dart';
@@ -61,6 +62,8 @@ class ResourceInfoView extends StatelessWidget {
final repository = context.read<PhylumAccount>().userRepository;
final entries = p.entries.toList(growable: false)..sort(((a, b) => a.key.compareTo(b.key)));
final other = entries.map((e) => repository.getUserDisplayName(e.key)).join(', ');
final publinks =
resource.publinks == null ? const <String>[] : (jsonDecode(resource.publinks!) as List).cast<String>();
return ListTileTheme(
data: ListTileThemeData(
@@ -106,6 +109,14 @@ class ResourceInfoView extends StatelessWidget {
title: const Text('Others with Access'),
subtitle: other.isEmpty ? const Text('--') : Text(other),
),
ListTile(
title: const Text('Public Shares'),
subtitle: publinks.isEmpty ? const Text('--') : Text(publinks.join(', ')),
trailing: IconButton(
icon: const Icon(Icons.add),
onPressed: () {},
),
),
],
),
);