|
|
|
|
@ -6,18 +6,25 @@ import 'package:fluffychat/widgets/adaptive_dialogs/show_ok_cancel_alert_dialog.
|
|
|
|
|
import 'package:fluffychat/widgets/future_loading_dialog.dart';
|
|
|
|
|
import 'package:fluffychat/widgets/matrix.dart';
|
|
|
|
|
|
|
|
|
|
void pLogoutAction(BuildContext context, {bool? isDestructiveAction}) async {
|
|
|
|
|
if (await showOkCancelAlertDialog(
|
|
|
|
|
useRootNavigator: false,
|
|
|
|
|
context: context,
|
|
|
|
|
title: L10n.of(context).areYouSureYouWantToLogout,
|
|
|
|
|
message: L10n.of(context).dontForgetPassword,
|
|
|
|
|
okLabel: L10n.of(context).logout,
|
|
|
|
|
cancelLabel: L10n.of(context).cancel,
|
|
|
|
|
) ==
|
|
|
|
|
OkCancelResult.cancel) {
|
|
|
|
|
return;
|
|
|
|
|
void pLogoutAction(
|
|
|
|
|
BuildContext context, {
|
|
|
|
|
bool? isDestructiveAction,
|
|
|
|
|
bool bypassWarning = false,
|
|
|
|
|
}) async {
|
|
|
|
|
if (!bypassWarning) {
|
|
|
|
|
if (await showOkCancelAlertDialog(
|
|
|
|
|
useRootNavigator: false,
|
|
|
|
|
context: context,
|
|
|
|
|
title: L10n.of(context).areYouSureYouWantToLogout,
|
|
|
|
|
message: L10n.of(context).dontForgetPassword,
|
|
|
|
|
okLabel: L10n.of(context).logout,
|
|
|
|
|
cancelLabel: L10n.of(context).cancel,
|
|
|
|
|
) ==
|
|
|
|
|
OkCancelResult.cancel) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final matrix = Matrix.of(context);
|
|
|
|
|
|
|
|
|
|
// before wiping out locally cached construct data, save it to the server
|
|
|
|
|
|