fucked up things that nobody shall ever know

This commit is contained in:
zoe 2022-09-28 00:43:59 +02:00
parent d264fc4504
commit d4a6186a35
2 changed files with 23 additions and 5 deletions

View File

@ -39,10 +39,18 @@ class ConversationModel implements Comparable {
@override @override
int compareTo(other) { int compareTo(other) {
if (lastStatus == null && other.lastStatus == null) return 0; if (lastStatus == null && other.lastStatus == null) return 0;
;
if (lastStatus == null) return -1; if (lastStatus == null) return -1;
return lastStatus!.createdAt.compareTo(other.lastStatus!.createdAt); return lastStatus!.createdAt.compareTo(other.lastStatus!.createdAt);
} }
String getAccountsString() {
String ret = "";
for (var acc in accounts) {
ret = "$ret${acc.acct}";
}
return ret;
}
} }
class ConversationModelResult { class ConversationModelResult {

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:localization/localization.dart'; import 'package:localization/localization.dart';
import 'package:loris/business_logic/chat/chat.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/themes/themes.dart' as themes;
import 'package:loris/global.dart' as global; import 'package:loris/global.dart' as global;
@ -68,19 +69,28 @@ class ConversationButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( 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, margin: const EdgeInsets.fromLTRB(themes.defaultSeperatorHeight * 2, 0,
themes.defaultSeperatorHeight * 2, 0), themes.defaultSeperatorHeight * 2, 0),
width: global.getWidth(context), width: global.getWidth(context),
constraints: global.getConstraints(context), constraints: global.getConstraints(context),
child: InkWell( child: Padding(
padding: themes.defaultInsideMargins,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
Wrap( Wrap(
alignment: WrapAlignment.spaceBetween,
children: [ 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),
], ],
), ),
), ),