Comments (5)
Ah, I thought customButton is your own widget not the property in the package.
Let me think if we could make one callback for both onTap & onMenuClose.
from dropdown_button2.
You can achieve that using both onTap & onMenuClose, I don't see better scenario.
I think you can achieve it with single callback. Can you share your both custom widgets so we can find best way to achieve this?
from dropdown_button2.
This is my custom widget.
My concern about about the onTap & onMenuClose is that might exist (or might be implement in the future) a functionality/shortcut on opening/closing the dropdown, where those onTap & onMenuClose callbacks might not be used, which would unsync the real _isMenuOpen value from my own state, which i would like to avoid.
Widget defaultSelectedItem(MyDropdownOption<T> e) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
e.label ?? '',
style: const TextStyle(
backgroundColor: Colors.transparent,
color: SystemColors.neutrals_50,
),
),
Icon(
isOpen ? CustomIcons.arrow_up : CustomIcons.arrow_down,
size: 16,
color: SystemColors.neutrals100,
)
],
);
}
from dropdown_button2.
There's already iconOnClick
parameter that show different icon when dropdown menu is open. I think that's what you're trying to achieve, right?
from dropdown_button2.
There's already
iconOnClick
parameter that show different icon when dropdown menu is open. I think that's what you're trying to achieve, right?
It does not work with customButtonn (and i think it should not).
from dropdown_button2.
Related Issues (20)
- The menus need to be fully displayed, and after selection, the overflow needs to be replaced with ellipsis (...).
- Horizontal line issue under DropdownButtonFormField2 HOT 1
- Example 4 | Multi Select Dropdown HOT 1
- searchData not working in release app (show grey blank dropdown container) this code HOT 1
- Failed assertion: line 991 pos 11 ... There shoiuld be exactly one item with DropdownButtons ...
- somehow i delet class of DropdownButton2 class ,i dont know how to ReCreate or ReAdd it please Share me Solution @AhmedLSayed HOT 1
- Disable dropdown button HOT 1
- button have a shadow
- Using DropdownButton2 above the Navigator
- update selected value when menu is closed.
- Why can't find dropdownSeparator
- Can't change thumb color
- Conflicting paddings in MenuItemStyleData, DropDownStyleData, and ButtonStyleData HOT 11
- Can't open dialog on menu item tap HOT 1
- overlayColor has no effect HOT 6
- Searching item.child not working on release mode but in debug mode run successfully. HOT 1
- `DropdownButtonFormField2` doesn't hide its underline. HOT 1
- How to set MouseCursor
- When the window size changes, the pop-up layer position is incorrect HOT 5
- DropDown button 2 latest beta fails with empty dropdown HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropdown_button2.