Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix onPressed on macOS using CupertinoAlertDialog #1735

Merged
merged 2 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Bitte stell dabei sicher, dass dein Gerät eine Verbindung zum Internet hat.
),
),
actions: <Widget>[
CupertinoActionSheetAction(
CupertinoDialogAction(
child: const Text("Abbrechen"),
onPressed: () => Navigator.pop(context, false),
),
Expand All @@ -112,7 +112,7 @@ Bitte stell dabei sicher, dass dein Gerät eine Verbindung zum Internet hat.
],
),
if (confirmedToDeleteAccount && !isLoading)
CupertinoActionSheetAction(
CupertinoDialogAction(
isDefaultAction: true,
isDestructiveAction: true,
onPressed: () => tryToSignOutAndDeleteUser(context),
Expand Down
10 changes: 3 additions & 7 deletions app/lib/settings/src/subpages/my_profile/my_profile_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:helper_functions/helper_functions.dart';
import 'package:platform_check/platform_check.dart';
import 'package:provider/provider.dart' as pv;
import 'package:sharezone/account/account_page.dart';
import 'package:sharezone/account/change_data_bloc.dart';
Expand Down Expand Up @@ -458,10 +457,7 @@ class _DeleteAccountDialogContentState
final provider = api.user.authUser!.provider;
const text = "Ja, ich möchte mein Konto löschen.";

// Because of https://github.com/flutter/flutter/issues/154793 we shouldn't
// show the CupertinoAlertDialog on macOS. Can be removed when the issue is
// fixed and rolled out to the stable channel.
if (ThemePlatform.isCupertino && !PlatformCheck.isMacOS) {
if (ThemePlatform.isCupertino) {
return CupertinoAlertDialog(
title: const _DeleteAccountDialogTitle(),
content: SingleChildScrollView(
Expand Down Expand Up @@ -516,7 +512,7 @@ class _DeleteAccountDialogContentState
),
),
actions: <Widget>[
CupertinoActionSheetAction(
CupertinoDialogAction(
child: const Text("Abbrechen"),
onPressed: () => Navigator.pop(context),
),
Expand All @@ -533,7 +529,7 @@ class _DeleteAccountDialogContentState
? isNotEmptyOrNull(password)
: signOut!) &&
!isLoading)
CupertinoActionSheetAction(
CupertinoDialogAction(
isDefaultAction: true,
isDestructiveAction: true,
onPressed: () => tryToDeleteUser(context),
Expand Down
Loading