How to change the Form according to the item selected in the drop Down menu in Flutter - flutter

I have created I method which is showing a dialog and I called it with timer.run() method in order to show the dialog at the start of the screen automatically in which i have created a form (the code snippet is attached in the photos) and the form contains drop-down menu with two items(check and bank) now i want to make the UI as dynamic whenever the user selects the Bank option in the drop-down menu a new drop-down menu is displayed to him otherwise an empty container will be displayed to him.
Solutions I tried
created i variable which holds true if the item selected is bank otherwise false and used it as a condition to either show the 2nd drop-down or not.
Make the variable global but it also didn't worked.
created a function which i called with the variable to return either drop-down or empty container but it also didn't worked.
Created the bank selected variable in other class and access it with provider package but it also didn't worked for me.
The source code is also available at Github-Repo

Thanks all someone at linkedin helped me with the solution. which is
We have to wrap the AlertDialog with StatefulBuilder and have to call setState when option is selected then it will work.

Related

How to create alert dialog on onTap on ListTile and select option to replace listTile value

Greetings everyone I'm new to flutter I need help implementing the simple feature of the Dialog.
I have a listTile consisting of members with different roles (Tressure, Secretary, Chair Person, and Ordinary Member)
Firstly I want to create an Alert dialog so that when I click on each listTile the dialog should pop up with the title "Change Member role" and below it should be the selectable options to set the selected option to the listTile
I need help creating the Alert dialog with these options and how to go about setting the text for the selected option to ListTile.
below is the link where I found the design, now I need the source code to implement the code
Click here for understanding the design
First of all I would make a class to represent a member Member (with fields like id, name, role, whatever else you need).
Then have a Provider for managing the members data. It will contain list of members like List<Member> and methods to make changes for this list. For example: for changing member's role it will contain changeMemberRole(int memberID) method, that will modify data in that list and call notifyListeners(); in the end.
After that on the screen that need to show list of members I would get an instance of this provider, build all list tiles using it's data, and it will automatically rebuild the list once data changes.
Links that should help:
Simple state management (for understanding Providers)
Using modal bottom sheet (for dialog), but you can use AlertDialog as well

Custom Work Item Types don't show in any Board or Backlog?

We've created a new work item type called "Improvement", but found that it does not show in any board or backlog - only search. After some digging in settings, I found this:
Can you really not add new work item types and get them into your workflow along side the default types?
In this page, hover with the mouse on the work item level you want to include your custom item and click "Edit":
In the screen that opens you can add the custom work item.

Popup shrinking when selecting any dropdown

I have developed a popup using Oracle ADF and am now facing an issue with this pop-up screen on deployment environment. This popup is created as on click of Sidebar Navigation which calls a bounded task flow which is launched in a popup window.
The pop-up consists of fields both drop-downs and text boxes and is shrinking to a very small size whenever any drop-down is clicked. I have looked up in on the web for this issue but found only one possible solution that "modal" property of af:dialog of af:popup must be true. But this did not resolve my issue as this property was set to true only.
Any pointers in this regard will be highly helpful.
Finally found the issue with the help of my teammate.
We were using Conditional activation of taskflow using an EL expression and which was in requestScope and hence any click on the dropdown was trying to postback to the server and the EL was evaluated every time, but as we had TaskFlowPageDef active property defined with a request scope variable, it was not available for the next request. Hence the taskflow was shrinking.
Changed the scope to viewScope and now its perfectly working fine.
For more details: refer to this blog

Auto complete a dropdown menu in a cq5 dialog based on input from a previous dialog field

My custom CQ5 component has a dialog which consists of 2 drop down menus. I would like to automatically set a default value to second menu depending on whatever is the value selected from the previous drop down.
How can I achieve this?
you can register handlers for different events triggered by the widgets. You can use the "selectionchanged" event to register a function that will read the new content from the dropdown and then use the setValue() method in the second dropdown to put whatever you want there.
To obtain the second dropdown from the first you can use the nextSibling() method.
The widget documentation will help you a lot. look for "selection"

Programatically change icon for a eclipse RCP command

I have a menu drop down action in the coolbar. It has 3 sub items that form a radio group. I would like to change the icon shown in the coolbar when the user selects one of these options.
I've googled and seen that I should look at:
org.eclipse.ui.commands.ICommandService.refreshElements(String, Map)
and
org.eclipse.ui.commands.IElementUpdater
Its probably the right thing to look at exception its not enough information. One or two small code snippets will be excellent.
Thanks in advance.
Ok basically if you don't want to use a "custom" control the what to do it is to have your handler (handler that is linked to the specific command) implement IElementUpdater. When every the toolbar item gets shown or clicked on (i.e if the user selects on the the radio buttons) the method: updateElement(UIElement element, Map parameters) gets called.
The element has a setIcon() method and this is what i used to change the icon of the menu drop down action.
Every update to the Coolbar points to the specialization of the WorkbenchWindowControlContribution class.
This bug 186800 has some code example in it which can be of interest.