10 Commits

10 changed files with 58 additions and 27 deletions

View File

@ -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;

View File

@ -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?,
); );

View File

@ -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 {

View File

@ -110,6 +110,7 @@ enum GetRoomResponseObjectConversationType {
@JsonValue(3) public, @JsonValue(3) public,
@JsonValue(4) changelog, @JsonValue(4) changelog,
@JsonValue(5) deleted, @JsonValue(5) deleted,
@JsonValue(6) noteToSelf,
} }
enum GetRoomResponseObjectParticipantNotificationLevel { enum GetRoomResponseObjectParticipantNotificationLevel {

View File

@ -102,6 +102,7 @@ const _$GetRoomResponseObjectConversationTypeEnumMap = {
GetRoomResponseObjectConversationType.public: 3, GetRoomResponseObjectConversationType.public: 3,
GetRoomResponseObjectConversationType.changelog: 4, GetRoomResponseObjectConversationType.changelog: 4,
GetRoomResponseObjectConversationType.deleted: 5, GetRoomResponseObjectConversationType.deleted: 5,
GetRoomResponseObjectConversationType.noteToSelf: 6,
}; };
const _$GetRoomResponseObjectParticipantNotificationLevelEnumMap = { const _$GetRoomResponseObjectParticipantNotificationLevelEnumMap = {

View File

@ -58,11 +58,9 @@ abstract class TalkApi<T extends ApiResponse?> extends ApiRequest {
assembled?.headers = data.headers; assembled?.headers = data.headers;
return assembled; return assembled;
} catch (e) { } catch (e) {
// TODO report error var message = 'Error assembling Talk API ${T.toString()} message: ${e.toString()} response with request body: $body and request headers: ${headers.toString()}';
log('Error assembling Talk API ${T.toString()} message: ${e.toString()} response on ${endpoint.path} with request body: $body and request headers: ${headers.toString()}'); log(message);
throw Exception(message);
} }
throw Exception('Error assembling Talk API response');
} }
} }

View File

@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
import '../../api/apiResponse.dart'; import '../../api/apiResponse.dart';
@ -12,6 +13,8 @@ class BreakerProps extends DataHolder {
PackageInfo? packageInfo; PackageInfo? packageInfo;
String? isBlocked(BreakerArea? type) { String? isBlocked(BreakerArea? type) {
if(kDebugMode) return null;
if(packageInfo == null) { if(packageInfo == null) {
PackageInfo.fromPlatform().then((value) => packageInfo = value); PackageInfo.fromPlatform().then((value) => packageInfo = value);
return null; return null;

View File

@ -62,7 +62,7 @@ class AppModule {
), ),
Modules.files: AppModule( Modules.files: AppModule(
Modules.files, Modules.files,
name: 'Files', name: 'Dateien',
icon: () => Icon(Icons.folder), icon: () => Icon(Icons.folder),
breakerArea: BreakerArea.files, breakerArea: BreakerArea.files,
create: Files.new, create: Files.new,

View File

@ -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: [
...groupedParticipants.entries.map((entry) => Column(
children: [
ListTile(
title: Text(entry.key.prettyName),
titleTextStyle: TextStyle(fontWeight: FontWeight.bold),
),
...entry.value.map((participant) => ListTile(
leading: UserAvatar(id: participant.actorId), leading: UserAvatar(id: participant.actorId),
title: Text(participant.displayName), title: Text(participant.displayName),
subtitle: participant.statusMessage != null ? Text(participant.statusMessage!) : null, subtitle: participant.statusMessage != null ? Text(participant.statusMessage!) : null,
)).toList(), )),
), Divider(),
],
))
],
)
); );
}
} }

View File

@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 0.1.1+39 version: 0.1.3+41
environment: environment:
sdk: '>3.0.0' sdk: '>3.0.0'
@ -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: