Add e2ee settings
This commit is contained in:
parent
178e50a564
commit
c6c419f76d
15 changed files with 357 additions and 50 deletions
36
lib/components/dialogs/confirm_dialog.dart
Normal file
36
lib/components/dialogs/confirm_dialog.dart
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import 'package:fluffychat/i18n/i18n.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ConfirmDialog extends StatelessWidget {
|
||||
const ConfirmDialog(
|
||||
this.text,
|
||||
this.confirmText,
|
||||
this.onConfirmed,
|
||||
);
|
||||
final String text;
|
||||
final String confirmText;
|
||||
final Function(BuildContext) onConfirmed;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(text),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
child: Text(I18n.of(context).close.toUpperCase(),
|
||||
style: TextStyle(color: Colors.blueGrey)),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
FlatButton(
|
||||
child: Text(
|
||||
confirmText.toUpperCase(),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
onConfirmed(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:fluffychat/i18n/i18n.dart';
|
||||
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(
|
||||
title: Text(I18n.of(context).messageWillBeRemovedWarning),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
child: Text("Close".toUpperCase(),
|
||||
style: TextStyle(color: Colors.blueGrey)),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
FlatButton(
|
||||
child: Text(
|
||||
I18n.of(context).remove.toUpperCase(),
|
||||
style: TextStyle(color: Colors.red),
|
||||
),
|
||||
onPressed: () => removeAction(context),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue