Compare commits
7 Commits
develop-fi
...
develop-gr
Author | SHA1 | Date | |
---|---|---|---|
421ee9179d | |||
0a66858d93 | |||
49428680de | |||
0c676dc3d6 | |||
c702b610c5 | |||
5938c6b3c3 | |||
c44b0464a4 |
@ -18,7 +18,7 @@ class AutocompleteResponseObject {
|
|||||||
String label;
|
String label;
|
||||||
String? icon;
|
String? icon;
|
||||||
String? source;
|
String? source;
|
||||||
List<String>? status;
|
String? status;
|
||||||
String? subline;
|
String? subline;
|
||||||
String? shareWithDisplayNameUniqe;
|
String? shareWithDisplayNameUniqe;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ AutocompleteResponseObject _$AutocompleteResponseObjectFromJson(
|
|||||||
json['label'] as String,
|
json['label'] as String,
|
||||||
json['icon'] as String?,
|
json['icon'] as String?,
|
||||||
json['source'] as String?,
|
json['source'] as String?,
|
||||||
(json['status'] as List<dynamic>?)?.map((e) => e as String).toList(),
|
json['status'] as String?,
|
||||||
json['subline'] as String?,
|
json['subline'] as String?,
|
||||||
json['shareWithDisplayNameUniqe'] as String?,
|
json['shareWithDisplayNameUniqe'] as String?,
|
||||||
);
|
);
|
||||||
|
@ -55,12 +55,15 @@ class GetParticipantsResponseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum GetParticipantsResponseObjectParticipantType {
|
enum GetParticipantsResponseObjectParticipantType {
|
||||||
@JsonValue(1) owner,
|
@JsonValue(1) owner('Besitzer'),
|
||||||
@JsonValue(2) moderator,
|
@JsonValue(2) moderator('Moderator'),
|
||||||
@JsonValue(3) user,
|
@JsonValue(3) user('Benutzer'),
|
||||||
@JsonValue(4) guest,
|
@JsonValue(4) guest('Gast'),
|
||||||
@JsonValue(5) userFollowingPublicLink,
|
@JsonValue(5) userFollowingPublicLink('Link Nutzer'),
|
||||||
@JsonValue(6) guestWithModeratorPermissions
|
@JsonValue(6) guestWithModeratorPermissions('Gast Moderator');
|
||||||
|
|
||||||
|
const GetParticipantsResponseObjectParticipantType(this.prettyName);
|
||||||
|
final String prettyName;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum GetParticipantsResponseObjectParticipantsInCallFlags {
|
enum GetParticipantsResponseObjectParticipantsInCallFlags {
|
||||||
|
@ -1,28 +1,52 @@
|
|||||||
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../../../../../api/marianumcloud/talk/getParticipants/getParticipantsResponse.dart';
|
import '../../../../../api/marianumcloud/talk/getParticipants/getParticipantsResponse.dart';
|
||||||
import '../../../../../widget/userAvatar.dart';
|
import '../../../../../widget/userAvatar.dart';
|
||||||
|
|
||||||
class ParticipantsListView extends StatefulWidget {
|
class ParticipantsListView extends StatelessWidget {
|
||||||
final GetParticipantsResponse participantsResponse;
|
final GetParticipantsResponse participantsResponse;
|
||||||
const ParticipantsListView(this.participantsResponse, {super.key});
|
const ParticipantsListView(this.participantsResponse, {super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ParticipantsListView> createState() => _ParticipantsListViewState();
|
Widget build(BuildContext context) {
|
||||||
}
|
// final participants = participantsResponse.data.map((participant) => ListTile(
|
||||||
|
// leading: UserAvatar(id: participant.actorId),
|
||||||
|
// title: Text(participant.displayName),
|
||||||
|
// subtitle: participant.statusMessage != null ? Text(participant.statusMessage!) : null,
|
||||||
|
// )).toList();
|
||||||
|
|
||||||
class _ParticipantsListViewState extends State<ParticipantsListView> {
|
lastname(participant) => participant.displayName.toString().split(' ').last;
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) => Scaffold(
|
final participants = participantsResponse.data
|
||||||
|
.sorted((a, b) => lastname(a).compareTo(lastname(b)))
|
||||||
|
.sorted((a, b) => a.participantType.index.compareTo(b.participantType.index));
|
||||||
|
var groupedParticipants = participants.groupListsBy((participant) => participant.participantType);
|
||||||
|
|
||||||
|
// Map<GetParticipantsResponseObjectParticipantType, List<GetParticipantsResponseObject>>
|
||||||
|
|
||||||
|
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: [
|
||||||
leading: UserAvatar(id: participant.actorId),
|
...groupedParticipants.entries.map((entry) => Column(
|
||||||
title: Text(participant.displayName),
|
children: [
|
||||||
subtitle: participant.statusMessage != null ? Text(participant.statusMessage!) : null,
|
ListTile(
|
||||||
)).toList(),
|
title: Text(entry.key.prettyName),
|
||||||
),
|
titleTextStyle: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
...entry.value.map((participant) => ListTile(
|
||||||
|
leading: UserAvatar(id: participant.actorId),
|
||||||
|
title: Text(participant.displayName),
|
||||||
|
subtitle: participant.statusMessage != null ? Text(participant.statusMessage!) : null,
|
||||||
|
)),
|
||||||
|
Divider(),
|
||||||
|
],
|
||||||
|
))
|
||||||
|
],
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ class _ChatBubbleState extends State<ChatBubble> with SingleTickerProviderStateM
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: widget.bubbleData.message != '{file}',
|
visible: !message.containsFile,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: const Icon(Icons.copy),
|
leading: const Icon(Icons.copy),
|
||||||
title: const Text('Nachricht kopieren'),
|
title: const Text('Nachricht kopieren'),
|
||||||
|
@ -21,53 +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: [
|
||||||
Row(
|
const Icon(Icons.file_open_outlined, size: 35),
|
||||||
mainAxisSize: MainAxisSize.max,
|
const SizedBox(width: 10),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
Flexible(child: Text(file!.name, maxLines: 2, overflow: TextOverflow.ellipsis, style: const TextStyle(fontWeight: FontWeight.bold))),
|
||||||
children: [
|
const SizedBox(width: 10),
|
||||||
CachedNetworkImage(
|
|
||||||
errorWidget: (context, url, error) => Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
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 {
|
||||||
|
@ -101,6 +101,7 @@ dependencies:
|
|||||||
time_range_picker: ^2.3.0
|
time_range_picker: ^2.3.0
|
||||||
url_launcher: ^6.3.1
|
url_launcher: ^6.3.1
|
||||||
uuid: ^4.5.1
|
uuid: ^4.5.1
|
||||||
|
collection: ^1.19.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
Reference in New Issue
Block a user