add ability to copy room/space link
This commit is contained in:
parent
2c23951ea8
commit
ee648ab105
2 changed files with 18 additions and 8 deletions
|
|
@ -100,7 +100,10 @@ A simple and user-friendly Matrix client made with Flutter and a Gomuks backend.
|
|||
- [ ] Threads
|
||||
- [x] Profile popouts
|
||||
- [ ] Working actions
|
||||
- [ ] Copy link to [room, space, message]
|
||||
- [ ] Copy link to:
|
||||
- [x] Room
|
||||
- [x] Space
|
||||
- [ ] Message
|
||||
- [ ] Reporting
|
||||
- [x] Events
|
||||
- [ ] Rooms
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:flutter/material.dart";
|
||||
import "package:flutter/services.dart";
|
||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
import "package:nexus/controllers/client_controller.dart";
|
||||
import "package:nexus/controllers/via_controller.dart";
|
||||
import "package:nexus/models/room.dart";
|
||||
|
||||
class RoomMenu extends ConsumerWidget {
|
||||
|
|
@ -16,13 +18,18 @@ class RoomMenu extends ConsumerWidget {
|
|||
|
||||
return PopupMenuButton(
|
||||
itemBuilder: (_) => [
|
||||
// PopupMenuItem(
|
||||
// onTap: () async {
|
||||
// final link = await room.matrixToInviteLink();
|
||||
// await Clipboard.setData(ClipboardData(text: link.toString()));
|
||||
// },
|
||||
// child: ListTile(leading: Icon(Icons.link), title: Text("Copy Link")),
|
||||
// ),
|
||||
PopupMenuItem(
|
||||
onTap: () async {
|
||||
final vias = ref.watch(ViaController.provider(room));
|
||||
|
||||
await Clipboard.setData(
|
||||
ClipboardData(
|
||||
text: "matrix:roomid/${room.metadata?.id.substring(1)}$vias)",
|
||||
),
|
||||
);
|
||||
},
|
||||
child: ListTile(leading: Icon(Icons.link), title: Text("Copy Link")),
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: () async {
|
||||
await client.markRead(room);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue