fluffychat/lib/components/dialogs/redact_message_dialog.dart

37 lines
1014 B
Dart
Raw Normal View History

2020-01-01 19:10:13 +01:00
import 'package:famedlysdk/famedlysdk.dart';
2020-01-20 13:46:39 +01:00
import 'package:fluffychat/i18n/i18n.dart';
2020-01-01 19:10:13 +01:00
import 'package:flutter/material.dart';
import '../matrix.dart';
class RedactMessageDialog extends StatelessWidget {
final Event event;
const RedactMessageDialog(this.event);
void removeAction(BuildContext context) {
Matrix.of(context).tryRequestWithLoadingDialog(event.redact());
Navigator.of(context).pop();
}
@override
Widget build(BuildContext context) {
return AlertDialog(
2020-01-20 13:46:39 +01:00
title: Text(I18n.of(context).messageWillBeRemovedWarning),
2020-01-01 19:10:13 +01:00
actions: <Widget>[
FlatButton(
child: Text("Close".toUpperCase(),
style: TextStyle(color: Colors.blueGrey)),
onPressed: () => Navigator.of(context).pop(),
),
FlatButton(
2020-01-05 12:27:03 +01:00
child: Text(
2020-01-20 13:46:39 +01:00
I18n.of(context).remove.toUpperCase(),
2020-01-05 12:27:03 +01:00
style: TextStyle(color: Colors.red),
),
2020-01-01 19:10:13 +01:00
onPressed: () => removeAction(context),
),
],
);
}
}