fluffychat/lib/pangea/utils/logout.dart
ggurdin 9ecf4e3bd2
fix: fix dart formatting for CI (#1368)
* fix: fix dart formatting for CI

* fix: sorted imports, updated deprecated flutter functions

* fix: format files

* fix: format files

* feat: replace syncfusion flutter package with excel flutter package

* fix: don't run enable google services patch in CI

* fix: update iOS supported platforms for enable ios build script

* fix: commented out linux build in integrate CI
2025-01-07 08:32:42 -05:00

32 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:adaptive_dialog/adaptive_dialog.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
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).noBackupWarning,
isDestructiveAction: isDestructiveAction ?? false,
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
await MatrixState.pangeaController.putAnalytics
.sendLocalAnalyticsToAnalyticsRoom(onLogout: true);
await showFutureLoadingDialog(
context: context,
future: () => matrix.client.logout(),
);
}