-
Notifications
You must be signed in to change notification settings - Fork 132
Description
Is there an existing issue for this?
- I have searched the existing issues and found no duplicates.
What plugin is this bug for?
Firebase UI Auth
What platform(s) does this bug affect?
iOS / macOS
List of dependencies used.
flutter pub deps -s list
Not relevant
Steps to reproduce
Wrap your ProfileScreen() in a MaterialApp() and see this popup on iOS/macOS:
This is unclickable because of the AlertDialog parameters given adaptiveAction() function:
FirebaseUI-Flutter/packages/firebase_ui_shared/lib/src/universal_alert.dart
Lines 53 to 71 in 98a4f0d
| Widget buildMaterial(BuildContext context) { | |
| return AlertDialog( | |
| title: Text(title), | |
| content: Text(message), | |
| actions: [ | |
| adaptiveAction( | |
| context: context, | |
| onPressed: onConfirm, | |
| child: Text(confirmButtonText), | |
| isDestructiveAction: true, | |
| ), | |
| adaptiveAction( | |
| context: context, | |
| onPressed: onCancel, | |
| child: Text(cancelButtonText), | |
| ), | |
| ], | |
| ); | |
| } |
Expected Behavior
Expected that AlertDialog() should be clickable if you decide to use MaterialApp() for iOS/macOS.
Wrap the ProfileScreen() in CupertinoApp() and everything works fine. And looks like this:
Reason for it working as expected is because of these parameters:
FirebaseUI-Flutter/packages/firebase_ui_shared/lib/src/universal_alert.dart
Lines 42 to 49 in 98a4f0d
| case TargetPlatform.iOS: | |
| case TargetPlatform.macOS: | |
| return CupertinoDialogAction( | |
| onPressed: onPressed, | |
| isDestructiveAction: isDestructiveAction, | |
| child: child, | |
| ); | |
| } |
Actual Behavior
Forces the developer to use CupertinoApp() for iOS/macOS and MaterialApp() on other devices if you want to use the UI-package.
Additional Information
It could be fixed by adding the adaptive handling by AlertDialog() here:
| return AlertDialog( |
Replace with:
return AlertDialog.adaptive(
But I have seen other PRs removing this feature earlier, so I did not want to push a new PR for "fixing" this.
If it suppose to force developers to use CupertinoApp() for iOS/macOS.