mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-05-22 22:29:06 -05:00
[client] Show bookmark icon
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'package:drift/drift.dart' as drift;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:offtheline/offtheline.dart';
|
||||
import 'package:phylum/libphylum/actions/action_resource.dart';
|
||||
import 'package:phylum/libphylum/db/db.dart';
|
||||
import 'package:phylum/libphylum/phylum_account.dart';
|
||||
import 'package:phylum/libphylum/phylum_api_types.dart';
|
||||
import 'package:phylum/ui/explorer/resource_icon_extension.dart';
|
||||
import 'package:phylum/util/file_size.dart';
|
||||
@@ -130,6 +132,21 @@ class ResourceDetailsRow extends StatelessWidget {
|
||||
padding: EdgeInsets.only(right: 6.0),
|
||||
child: Icon(Icons.public, size: 14),
|
||||
),
|
||||
StreamBuilder<bool?>(
|
||||
stream: (context.read<PhylumAccount>().db.bookmarks.select()
|
||||
..where((b) => b.resourceId.equals(resource.id)))
|
||||
.map((b) => !b.deleted)
|
||||
.watchSingleOrNull(),
|
||||
initialData: false,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.data == true) {
|
||||
return const Padding(
|
||||
padding: EdgeInsets.only(right: 6.0),
|
||||
child: Icon(Icons.bookmark, size: 14),
|
||||
);
|
||||
}
|
||||
return const SizedBox();
|
||||
}),
|
||||
Text(
|
||||
subtitle,
|
||||
maxLines: 1,
|
||||
|
||||
@@ -59,7 +59,6 @@ class ResourceInfoView extends StatelessWidget {
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
PermissionsTile(resourceId: resource.id),
|
||||
ListTile(
|
||||
title: const Text('Type'),
|
||||
subtitle: Text(resource.dir ? 'Folder' : resource.contentType),
|
||||
@@ -87,6 +86,7 @@ class ResourceInfoView extends StatelessWidget {
|
||||
overflow: TextOverflow.fade,
|
||||
),
|
||||
),
|
||||
PermissionsTile(resourceId: resource.id),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -139,7 +139,7 @@ class _PermissionsTileState extends State<PermissionsTile> {
|
||||
),
|
||||
ListTile(
|
||||
title: const Text('Others with Access'),
|
||||
subtitle: other == null ? const Text('') : Text(other),
|
||||
subtitle: (other?.isEmpty ?? true) ? const Text('--') : Text(other!),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user