allow sending emoji/stickers from emote packs
This commit is contained in:
parent
868023a4a1
commit
3754bc2feb
1 changed files with 701 additions and 74 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import "package:collection/collection.dart";
|
||||
import "package:hooks_riverpod/hooks_riverpod.dart";
|
||||
import "package:material_emoji_picker/material_emoji_picker.dart";
|
||||
import "package:material_ui/material_ui.dart";
|
||||
import "package:nexus/controllers/all_emoji.dart";
|
||||
import "package:nexus/helpers/extensions/better_when.dart";
|
||||
import "package:nexus/models/image_pack.dart";
|
||||
|
||||
class const EmojiOverlay(
|
||||
final String query, {
|
||||
|
|
@ -13,7 +14,7 @@ class const EmojiOverlay(
|
|||
}) extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) => ref
|
||||
.watch(EmojiController.provider)
|
||||
.watch(AllEmojiController.provider(roomId))
|
||||
.betterWhen(
|
||||
data: (emojis) => ListView(
|
||||
children: emojis
|
||||
|
|
@ -34,8 +35,11 @@ class const EmojiOverlay(
|
|||
title: Text(emoji.aliases.first),
|
||||
subtitle: Text(emoji.description),
|
||||
onTap: () => addTag(
|
||||
id: Uri.tryParse(emoji.value)?.scheme == "mxc"
|
||||
? "" // TODO: Handle custom emotes
|
||||
id: emoji.value.startsWith("mxc://")
|
||||
? ImagePack.emojiMarkdown(
|
||||
emoji.aliases.first,
|
||||
emoji.value,
|
||||
)
|
||||
: emoji.value,
|
||||
name: emoji.aliases.first,
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue