flutter-alertdialog

Flutter Alert Dialog Not Centered

こ雲淡風輕ζ 提交于 2020-06-17 09:39:52
问题 I'm creating a Flutter mobile application. I have a Scaffold with a Drawer that is Centered in the App Like This: Centered Drawer: https://ibb.co/s5BMdNM When The User Taps on the 2nd ListTile which is "Filter Character / Choose Categories", an AlertDialog popups. The Problem is the Alert Dialog isn't Centered neither vertically nor horizontally in the Landscape Orientation, and It's not centered vertically in the Portrait one. Landscape AlertDialog: https://ibb.co/GtdJ2jZ Portrait

How to make an AlertDialog in Flutter?

戏子无情 提交于 2019-12-18 03:42:16
问题 I am learning to build apps in Flutter. Now I have come to alert dialogs. I have done them before in Android and iOS, but how do I make an alert in Flutter? Here are some related SO questions: How to style AlertDialog Actions in Flutter adding dropdown menu in alert dialog box in flutter Show alert dialog on app main screen load automatically how to refresh alertdialog in flutter Alert Dialog with Rounded corners in flutter I'd like to make a more general canonical Q&A so my answer is below.

How to refresh an AlertDialog in Flutter?

寵の児 提交于 2019-11-30 01:37:12
问题 Currently, I have an AlertDialog with an IconButton . The user can click on the IconButton, I have two colors for each click. The problem is that I need to close the AlertDialog and reopen to see the state change of the color icon. I want to change the IconButton color immediately when the user clicks it. Here is the code: bool pressphone = false; //.... new IconButton( icon: new Icon(Icons.phone), color: pressphone ? Colors.grey : Colors.green, onPressed: () => setState(() => pressphone =