-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
defaultDialog cancel: Widget is not of type bool #85
Comments
Stacktrace:
|
Lol, the Dart compiler is crazy and returning before the end of the statement. I'm going to open an issue at Dart-lang and do some alternative work for that, like wrapping everything up in parentheses. Get.defaultDialog(
title: "Logout",
content: Text("Möchtest du dich ausloggen?"),
textCancel: "Abbrechen",
textConfirm: "Ok",
onConfirm: () {
storage.delete(key: _jwtKey);
storage.delete(key: _refreshKey);
RequestQueueTimer.stopTimer();
Get.off(LoginScreen());
},
); |
Hey, thank you for the really quick reply! I am going to do that then. Hoped there would be a faster solution than to rewrite all the default dialogs though, but seems like it can't be helped! Thanks! |
Fix on 2.2.6 |
Describe the bug
Hello, since I upgraded to the latest version of Get (2.2.2) all my defaultDialogs stopped working.
More specifically the cancel: and confirm: properties which used to take widgets before are throwing errors that whatever was passed is not of type bool.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A dialog should pop up with a flatbutton that allows to execute a function when pressed
Flutter Version:
1.17.0
Get Version:
2.2.2
Describe on which device you found the bug:
Pixel 3a
Minimal reproduce code
Provide a minimum reproduction code for the problem
Get.defaultDialog( title: "Logout", content: Text("Möchtest du dich ausloggen?"), cancel: FlatButton( onPressed: () { Get.back(); }, child: Text("Abbrechen")), confirm: FlatButton( onPressed: () { storage.delete(key: _jwtKey); storage.delete(key: _refreshKey); RequestQueueTimer.stopTimer(); Get.off(LoginScreen()); }, child: Text("OK"), ), );
The text was updated successfully, but these errors were encountered: