fixed some bugs

This commit is contained in:
Kima
2023-06-10 22:38:01 +02:00
parent 67aea46c06
commit 9cfa8296b8
26 changed files with 517 additions and 252 deletions

View File

@@ -22,16 +22,21 @@ class MessageViewTile extends StatelessWidget {
UserProvider user = Provider.of<UserProvider>(context, listen: false);
String recipientLabel = "";
if (message.recipients.any((r) => r.name == user.student?.name)) recipientLabel = "me".i18n;
if (message.recipients.any((r) => r.name == user.student?.name))
recipientLabel = "me".i18n;
if (recipientLabel != "" && message.recipients.length > 1) {
recipientLabel += " +";
recipientLabel += message.recipients.where((r) => r.name != user.student?.name).length.toString();
recipientLabel += message.recipients
.where((r) => r.name != user.student?.name)
.length
.toString();
}
if (recipientLabel == "") {
// note: convertint to set to remove duplicates
recipientLabel += message.recipients.map((r) => r.name).toSet().join(", ");
recipientLabel +=
message.recipients.map((r) => r.name).toSet().join(", ");
}
List<Widget> attachments = [];
@@ -75,9 +80,9 @@ class MessageViewTile extends StatelessWidget {
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
trailing: Row(
trailing: const Row(
mainAxisSize: MainAxisSize.min,
children: const [
children: [
// IconButton(
// onPressed: () {},
// icon: Icon(FeatherIcons.cornerUpLeft, color: AppColors.of(context).text),