forked from Nexus/nexus
parent
36a43a7a36
commit
3ba258d6b4
2 changed files with 6 additions and 5 deletions
|
|
@ -92,19 +92,19 @@ class ComposerDraftController(final ComposerParams composer)
|
||||||
({String text, IList<Tag> tags}) _restoreTags(String text) {
|
({String text, IList<Tag> tags}) _restoreTags(String text) {
|
||||||
final rooms = ref.read(RoomsController.provider);
|
final rooms = ref.read(RoomsController.provider);
|
||||||
Tag tagOf(Match match) => switch ((match[1], match[2], match[3])) {
|
Tag tagOf(Match match) => switch ((match[1], match[2], match[3])) {
|
||||||
(final userId?, _, _) => Tag(
|
(final userId?, _, _) => .new(
|
||||||
id: match[0]!,
|
id: match[0]!,
|
||||||
text: userId.split(":").first,
|
text: userId.split(":").first,
|
||||||
triggerCharacter: "@",
|
triggerCharacter: "@",
|
||||||
),
|
),
|
||||||
(_, final roomId?, _) => Tag(
|
(_, final roomId?, _) => .new(
|
||||||
id: match[0]!,
|
id: match[0]!,
|
||||||
text:
|
text:
|
||||||
rooms["!$roomId"]?.metadata?.canonicalAlias?.localpart ??
|
rooms["!$roomId"]?.metadata?.canonicalAlias?.localpart ??
|
||||||
"!$roomId",
|
"!$roomId",
|
||||||
triggerCharacter: "#",
|
triggerCharacter: "#",
|
||||||
),
|
),
|
||||||
(_, _, final shortcode) => Tag(
|
(_, _, final shortcode) => .new(
|
||||||
id: match[0]!,
|
id: match[0]!,
|
||||||
text: shortcode!,
|
text: shortcode!,
|
||||||
triggerCharacter: ":",
|
triggerCharacter: ":",
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,10 @@ class const SpoilerText(final String text, {super.key}) extends HookWidget {
|
||||||
onTap: () => revealed.value = !revealed.value,
|
onTap: () => revealed.value = !revealed.value,
|
||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
duration: Durations.short2,
|
duration: Durations.short2,
|
||||||
padding: const .symmetric(horizontal: 4, vertical: 2),
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: revealed.value ? Colors.transparent : Colors.blueGrey,
|
color: revealed.value
|
||||||
|
? Colors.blueGrey.withValues(alpha: 0.3)
|
||||||
|
: Colors.blueGrey,
|
||||||
borderRadius: .circular(4),
|
borderRadius: .circular(4),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue