You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fluffychat/lib/components/list_items/state_message.dart

35 lines
984 B
Dart

5 years ago
import 'package:bubble/bubble.dart';
import 'package:famedlysdk/famedlysdk.dart';
5 years ago
import 'package:fluffychat/l10n/l10n.dart';
5 years ago
import 'package:flutter/material.dart';
class StateMessage extends StatelessWidget {
final Event event;
const StateMessage(this.event);
@override
Widget build(BuildContext context) {
5 years ago
if (event.type == EventTypes.Redaction) return Container();
5 years ago
return Padding(
5 years ago
padding: const EdgeInsets.only(
left: 8.0,
right: 8.0,
bottom: 8.0,
),
child: Bubble(
elevation: 0,
5 years ago
color: Theme.of(context).backgroundColor.withOpacity(0.66),
alignment: Alignment.center,
5 years ago
child: Text(
5 years ago
event.getLocalizedBody(L10n.of(context)),
textAlign: TextAlign.center,
5 years ago
style: TextStyle(
5 years ago
color: Theme.of(context).textTheme.bodyText2.color,
decoration: event.redacted ? TextDecoration.lineThrough : null,
),
),
5 years ago
),
);
}
}