diff --git a/lib/business_logic/chat/chat.dart b/lib/business_logic/chat/chat.dart index 9c753ed..ef74f61 100644 --- a/lib/business_logic/chat/chat.dart +++ b/lib/business_logic/chat/chat.dart @@ -39,10 +39,18 @@ class ConversationModel implements Comparable { @override int compareTo(other) { if (lastStatus == null && other.lastStatus == null) return 0; - ; + if (lastStatus == null) return -1; return lastStatus!.createdAt.compareTo(other.lastStatus!.createdAt); } + + String getAccountsString() { + String ret = ""; + for (var acc in accounts) { + ret = "$ret${acc.acct}"; + } + return ret; + } } class ConversationModelResult { diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 60b08b5..395fdb7 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:localization/localization.dart'; import 'package:loris/business_logic/chat/chat.dart'; +import 'package:loris/partials/post_text_renderer.dart'; import 'package:loris/themes/themes.dart' as themes; import 'package:loris/global.dart' as global; @@ -68,19 +69,28 @@ class ConversationButton extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - color: Theme.of(context).colorScheme.surface, + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(themes.defaultRadius), + color: Theme.of(context).colorScheme.surface, + ), margin: const EdgeInsets.fromLTRB(themes.defaultSeperatorHeight * 2, 0, themes.defaultSeperatorHeight * 2, 0), width: global.getWidth(context), constraints: global.getConstraints(context), - child: InkWell( + child: Padding( + padding: themes.defaultInsideMargins, child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Wrap( + alignment: WrapAlignment.spaceBetween, children: [ - SelectableText("${"you-are".i18n()} ${model.identity}") + SelectableText(model.getAccountsString()), + SelectableText("${"you-are".i18n()} ${model.identity}"), ], - ) + ), + if (model.lastStatus != null) + PostTextRenderer(input: model.lastStatus!.content), ], ), ),