Compare commits
2 Commits
ab4120cc22
...
6c25af3b30
| Author | SHA1 | Date | |
|---|---|---|---|
|
6c25af3b30
|
|||
|
a1da72d447
|
@@ -10,6 +10,8 @@ import 'package:google_fonts/google_fonts.dart';
|
|||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:island/models/file.dart';
|
import 'package:island/models/file.dart';
|
||||||
import 'package:island/pods/config.dart';
|
import 'package:island/pods/config.dart';
|
||||||
|
import 'package:island/screens/account/profile.dart';
|
||||||
|
import 'package:island/screens/creators/publishers_form.dart';
|
||||||
import 'package:island/widgets/alert.dart';
|
import 'package:island/widgets/alert.dart';
|
||||||
import 'package:island/widgets/content/cloud_files.dart';
|
import 'package:island/widgets/content/cloud_files.dart';
|
||||||
import 'package:island/widgets/content/markdown_latex.dart';
|
import 'package:island/widgets/content/markdown_latex.dart';
|
||||||
@@ -397,7 +399,13 @@ class MentionChipSpanNode extends SpanNode {
|
|||||||
onTap: () => onTap(type, id),
|
onTap: () => onTap(type, id),
|
||||||
borderRadius: BorderRadius.circular(32),
|
borderRadius: BorderRadius.circular(32),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
padding: const EdgeInsets.only(
|
||||||
|
left: 5,
|
||||||
|
right: 7,
|
||||||
|
top: 2.5,
|
||||||
|
bottom: 2.5,
|
||||||
|
),
|
||||||
|
margin: const EdgeInsets.symmetric(horizontal: 2),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: backgroundColor.withOpacity(0.1),
|
color: backgroundColor.withOpacity(0.1),
|
||||||
borderRadius: BorderRadius.circular(32),
|
borderRadius: BorderRadius.circular(32),
|
||||||
@@ -411,18 +419,58 @@ class MentionChipSpanNode extends SpanNode {
|
|||||||
color: backgroundColor.withOpacity(0.5),
|
color: backgroundColor.withOpacity(0.5),
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(32)),
|
borderRadius: const BorderRadius.all(Radius.circular(32)),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: switch (parts.length == 1 ? 'u' : parts.first) {
|
||||||
switch (parts.first.isEmpty ? 'u' : parts.first) {
|
'u' => Consumer(
|
||||||
'c' => Symbols.forum_rounded,
|
builder: (context, ref, _) {
|
||||||
'r' => Symbols.group_rounded,
|
final userData = ref.watch(accountProvider(parts.last));
|
||||||
'u' => Symbols.person_rounded,
|
return userData.when(
|
||||||
'p' => Symbols.edit_rounded,
|
data:
|
||||||
_ => Symbols.person_rounded,
|
(data) => ProfilePictureWidget(
|
||||||
},
|
file: data.profile.picture,
|
||||||
size: 14,
|
fallbackIcon: Symbols.person_rounded,
|
||||||
color: foregroundColor,
|
radius: 9,
|
||||||
fill: 1,
|
),
|
||||||
).padding(all: 2),
|
error: (_, _) => const Icon(Symbols.close),
|
||||||
|
loading:
|
||||||
|
() => const SizedBox(
|
||||||
|
width: 9,
|
||||||
|
height: 9,
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
'p' => Consumer(
|
||||||
|
builder: (context, ref, _) {
|
||||||
|
final pubData = ref.watch(publisherProvider(parts.last));
|
||||||
|
return pubData.when(
|
||||||
|
data:
|
||||||
|
(data) => ProfilePictureWidget(
|
||||||
|
file: data?.picture,
|
||||||
|
fallbackIcon: Symbols.design_services_rounded,
|
||||||
|
radius: 9,
|
||||||
|
),
|
||||||
|
error: (_, _) => const Icon(Symbols.close),
|
||||||
|
loading:
|
||||||
|
() => const SizedBox(
|
||||||
|
width: 9,
|
||||||
|
height: 9,
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
_ => Icon(
|
||||||
|
(switch (parts.length == 1 ? 'u' : parts.first) {
|
||||||
|
'c' => Symbols.forum_rounded,
|
||||||
|
'r' => Symbols.group_rounded,
|
||||||
|
_ => Symbols.person_rounded,
|
||||||
|
}),
|
||||||
|
size: 14,
|
||||||
|
color: foregroundColor,
|
||||||
|
fill: 1,
|
||||||
|
).padding(all: 2),
|
||||||
|
},
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
parts.last,
|
parts.last,
|
||||||
|
|||||||
Reference in New Issue
Block a user