fluffychat/lib/components/list_items/state_message.dart

42 lines
1.2 KiB
Dart
Raw Normal View History

2020-01-01 19:10:13 +01:00
import 'package:famedlysdk/famedlysdk.dart';
import 'package:fluffychat/utils/matrix_locals.dart';
2020-01-01 19:10:13 +01:00
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
2020-01-01 19:10:13 +01:00
2021-02-07 08:59:58 +01:00
import '../../app_config.dart';
2020-01-01 19:10:13 +01:00
class StateMessage extends StatelessWidget {
final Event event;
const StateMessage(this.event);
@override
Widget build(BuildContext context) {
return Padding(
2020-01-18 13:22:22 +01:00
padding: const EdgeInsets.only(
left: 8.0,
right: 8.0,
2020-09-21 19:21:24 +02:00
bottom: 8.0,
2020-01-18 13:22:22 +01:00
),
2020-09-21 19:21:24 +02:00
child: Center(
child: Container(
2020-11-22 19:34:19 +01:00
padding: const EdgeInsets.all(8),
2020-09-21 19:21:24 +02:00
decoration: BoxDecoration(
2021-01-31 23:54:33 +01:00
color: Theme.of(context).secondaryHeaderColor,
2020-09-21 19:21:24 +02:00
borderRadius: BorderRadius.circular(7),
),
child: Text(
event.getLocalizedBody(MatrixLocals(L10n.of(context))),
2020-09-21 19:21:24 +02:00
textAlign: TextAlign.center,
style: TextStyle(
2021-02-07 08:59:58 +01:00
fontSize: Theme.of(context).textTheme.bodyText1.fontSize *
AppConfig.fontSizeFactor,
2020-09-21 19:21:24 +02:00
color: Theme.of(context).textTheme.bodyText2.color,
decoration: event.redacted ? TextDecoration.lineThrough : null,
),
2020-01-19 15:07:42 +01:00
),
2020-01-03 11:57:00 +01:00
),
2020-01-01 19:10:13 +01:00
),
);
}
}