|
@@ -2,7 +2,6 @@ import 'dart:async';
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_sodium/flutter_sodium.dart';
|
|
|
-import 'package:photos/ente_theme_data.dart';
|
|
|
import 'package:photos/services/local_authentication_service.dart';
|
|
|
import 'package:photos/services/user_service.dart';
|
|
|
import 'package:photos/theme/ente_theme.dart';
|
|
@@ -157,45 +156,13 @@ class AccountSectionWidget extends StatelessWidget {
|
|
|
}
|
|
|
|
|
|
Future<void> _onLogoutTapped(BuildContext context) async {
|
|
|
- final AlertDialog alert = AlertDialog(
|
|
|
- title: const Text(
|
|
|
- "Logout",
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.red,
|
|
|
- ),
|
|
|
- ),
|
|
|
- content: const Text("Are you sure you want to logout?"),
|
|
|
- actions: [
|
|
|
- TextButton(
|
|
|
- child: const Text(
|
|
|
- "Yes, logout",
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.red,
|
|
|
- ),
|
|
|
- ),
|
|
|
- onPressed: () async {
|
|
|
- Navigator.of(context, rootNavigator: true).pop('dialog');
|
|
|
- await UserService.instance.logout(context);
|
|
|
- },
|
|
|
- ),
|
|
|
- TextButton(
|
|
|
- child: Text(
|
|
|
- "No",
|
|
|
- style: TextStyle(
|
|
|
- color: Theme.of(context).colorScheme.greenAlternative,
|
|
|
- ),
|
|
|
- ),
|
|
|
- onPressed: () {
|
|
|
- Navigator.of(context, rootNavigator: true).pop('dialog');
|
|
|
- },
|
|
|
- ),
|
|
|
- ],
|
|
|
- );
|
|
|
-
|
|
|
- await showDialog(
|
|
|
- context: context,
|
|
|
- builder: (BuildContext context) {
|
|
|
- return alert;
|
|
|
+ showChoiceActionSheet(
|
|
|
+ context,
|
|
|
+ title: "Are you sure you want to logout?",
|
|
|
+ firstButtonLabel: "Yes, logout",
|
|
|
+ isCritical: true,
|
|
|
+ firstButtonOnTap: () async {
|
|
|
+ await UserService.instance.logout(context);
|
|
|
},
|
|
|
);
|
|
|
}
|