Compare commits
1 Commits
develop-fi
...
develop-so
Author | SHA1 | Date | |
---|---|---|---|
c44b0464a4 |
@ -13,16 +13,23 @@ class ParticipantsListView extends StatefulWidget {
|
|||||||
|
|
||||||
class _ParticipantsListViewState extends State<ParticipantsListView> {
|
class _ParticipantsListViewState extends State<ParticipantsListView> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => Scaffold(
|
Widget build(BuildContext context) {
|
||||||
|
final participants = widget.participantsResponse.data.map((participant) => ListTile(
|
||||||
|
leading: UserAvatar(id: participant.actorId),
|
||||||
|
title: Text(participant.displayName),
|
||||||
|
subtitle: participant.statusMessage != null ? Text(participant.statusMessage!) : null,
|
||||||
|
)).toList();
|
||||||
|
|
||||||
|
lastname(participant) => participant.title.toString().split(' ').last;
|
||||||
|
participants.sort((a, b) => lastname(a).compareTo(lastname(b)));
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Teilnehmende'),
|
title: const Text('Teilnehmende'),
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
children: widget.participantsResponse.data.map((participant) => ListTile(
|
children: participants,
|
||||||
leading: UserAvatar(id: participant.actorId),
|
|
||||||
title: Text(participant.displayName),
|
|
||||||
subtitle: participant.statusMessage != null ? Text(participant.statusMessage!) : null,
|
|
||||||
)).toList(),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,47 +21,39 @@ class ChatMessage {
|
|||||||
ChatMessage({required this.originalMessage, this.originalData}) {
|
ChatMessage({required this.originalMessage, this.originalData}) {
|
||||||
if(originalData?.containsKey('file') ?? false) {
|
if(originalData?.containsKey('file') ?? false) {
|
||||||
file = originalData?['file'];
|
file = originalData?['file'];
|
||||||
|
content = file?.name ?? 'Datei';
|
||||||
|
} else {
|
||||||
|
content = RichObjectStringProcessor.parseToString(originalMessage, originalData);
|
||||||
}
|
}
|
||||||
content = RichObjectStringProcessor.parseToString(originalMessage, originalData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget getWidget() {
|
Widget getWidget() {
|
||||||
|
|
||||||
var contentWidget = Linkify(
|
if(file == null) {
|
||||||
text: content,
|
return Linkify(
|
||||||
onOpen: onOpen,
|
text: content,
|
||||||
);
|
onOpen: onOpen,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if(file == null) return contentWidget;
|
return Padding(padding: const EdgeInsets.only(top: 5), child: CachedNetworkImage(
|
||||||
|
errorWidget: (context, url, error) => Row(
|
||||||
return Padding(
|
mainAxisSize: MainAxisSize.min,
|
||||||
padding: const EdgeInsets.only(top: 5),
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
CachedNetworkImage(
|
const Icon(Icons.file_open_outlined, size: 35),
|
||||||
errorWidget: (context, url, error) => Row(
|
const SizedBox(width: 10),
|
||||||
mainAxisSize: MainAxisSize.min,
|
Flexible(child: Text(file!.name, maxLines: 2, overflow: TextOverflow.ellipsis, style: const TextStyle(fontWeight: FontWeight.bold))),
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
const SizedBox(width: 10),
|
||||||
children: [
|
|
||||||
const Icon(Icons.file_open_outlined, size: 35),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
Flexible(child: Text(file!.name, maxLines: 2, overflow: TextOverflow.ellipsis, style: const TextStyle(fontWeight: FontWeight.bold))),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
placeholder: (context, url) => const Padding(padding: EdgeInsets.all(15), child: SizedBox(width: 50, child: LinearProgressIndicator())),
|
|
||||||
fadeInDuration: Duration.zero,
|
|
||||||
fadeOutDuration: Duration.zero,
|
|
||||||
errorListener: (value) {},
|
|
||||||
imageUrl: 'https://${AccountData().buildHttpAuthString()}@${EndpointData().nextcloud().full()}/index.php/core/preview?fileId=${file!.id}&x=100&y=-1&a=1',
|
|
||||||
),
|
|
||||||
SizedBox(height: 5),
|
|
||||||
contentWidget
|
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
);
|
alignment: Alignment.center,
|
||||||
|
placeholder: (context, url) => const Padding(padding: EdgeInsets.all(15), child: SizedBox(width: 50, child: LinearProgressIndicator())),
|
||||||
|
fadeInDuration: Duration.zero,
|
||||||
|
fadeOutDuration: Duration.zero,
|
||||||
|
errorListener: (value) {},
|
||||||
|
imageUrl: 'https://${AccountData().buildHttpAuthString()}@${EndpointData().nextcloud().full()}/index.php/core/preview?fileId=${file!.id}&x=100&y=-1&a=1',
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> onOpen(LinkableElement link) async {
|
Future<void> onOpen(LinkableElement link) async {
|
||||||
|
Reference in New Issue
Block a user