Minor fixes

This commit is contained in:
Christian Pauly 2020-03-13 21:42:05 +01:00
parent 3b574b047f
commit 01b1b56852
4 changed files with 13 additions and 8 deletions

View File

@ -11,9 +11,15 @@ class Avatar extends StatelessWidget {
final String name; final String name;
final double size; final double size;
final Function onTap; final Function onTap;
static const double defaultSize = 44;
const Avatar(this.mxContent, this.name, {this.size = 40, this.onTap, Key key}) const Avatar(
: super(key: key); this.mxContent,
this.name, {
this.size = defaultSize,
this.onTap,
Key key,
}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

View File

@ -140,7 +140,7 @@ class Message extends StatelessWidget {
), ),
]; ];
final Widget avatarOrSizedBox = sameSender final Widget avatarOrSizedBox = sameSender
? SizedBox(width: 40) ? SizedBox(width: Avatar.defaultSize)
: Avatar( : Avatar(
event.sender.avatarUrl, event.sender.avatarUrl,
event.sender.calcDisplayname(), event.sender.calcDisplayname(),

View File

@ -2,7 +2,6 @@ import 'package:bubble/bubble.dart';
import 'package:famedlysdk/famedlysdk.dart'; import 'package:famedlysdk/famedlysdk.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluffychat/utils/event_extension.dart'; import 'package:fluffychat/utils/event_extension.dart';
import 'package:link_text/link_text.dart';
class StateMessage extends StatelessWidget { class StateMessage extends StatelessWidget {
final Event event; final Event event;
@ -21,10 +20,10 @@ class StateMessage extends StatelessWidget {
elevation: 0, elevation: 0,
color: Theme.of(context).backgroundColor.withOpacity(0.5), color: Theme.of(context).backgroundColor.withOpacity(0.5),
alignment: Alignment.center, alignment: Alignment.center,
child: LinkText( child: Text(
text: event.getLocalizedBody(context), event.getLocalizedBody(context),
textAlign: TextAlign.center, textAlign: TextAlign.center,
textStyle: TextStyle( style: TextStyle(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
decoration: event.redacted ? TextDecoration.lineThrough : null, decoration: event.redacted ? TextDecoration.lineThrough : null,
), ),

View File

@ -1048,7 +1048,7 @@
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}
}, },
"Tuesday": "Tuesday", "Tuesday": "Dienstag",
"@Tuesday": { "@Tuesday": {
"type": "text", "type": "text",
"placeholders": {} "placeholders": {}