Comments (4)
Clicking the same dropdownitem multiple times will cause the page to go back to the previous page
from dropdown_button2.
I think this can't happen as the removeDropdownRoute
method just dismiss _dropdownRoute
. It doesn't call navigator.pop()
.
Can you post a sample code clarify how this issue happen?
from dropdown_button2.
Closing this issue due to lack of information. Feel free to reopen with more details if you still have trouble.
from dropdown_button2.
``> 我认为这不可能发生,因为removeDropdownRoute
方法只是 dismiss `_dropdownRoute`。它不叫`navigator.pop()`。
你能发布一个示例代码来澄清这个问题是如何发生的吗?
f108e606d833fd6a8855d3283ce7375b.mp4
String? selectedValue;
List<String> items = [
'Item1',
'Item2',
'Item3',
'Item4',
];
StickyPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
final width = size.width;
return Scaffold(
appBar: AppBar(title: Text("select demo")),
body: Stack(
children: [
CustomScrollView(
slivers: <Widget>[
_selectMean(context, width),
],
),
],
),
);
}
Widget _selectMean(context, width) {
return SliverToBoxAdapter(
child: DropdownButtonHideUnderline(
child: DropdownButtonFormField2(
onTap: () {},
offset: const Offset(10, 50),
alignment: AlignmentDirectional.centerStart,
// selectedItemHighlightColor: Colors.blue,
dropdownWidth: width - 20.w,
decoration: InputDecoration(
isDense: true,
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
),
),
hint: const Text(
'Choose Text',
style: TextStyle(fontSize: 14, color: Colors.blue),
),
icon: const Icon(
Icons.arrow_drop_down,
color: Colors.black45,
),
iconSize: 30,
buttonHeight: 60,
buttonPadding: const EdgeInsets.only(left: 20, right: 10),
dropdownDecoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: const [],
),
items: items
.map((item) => DropdownMenuItem<String>(
value: item,
child: Text(
item,
style: const TextStyle(fontSize: 14, color: Colors.red),
),
))
.toList(),
validator: (value) {
if (value == null) {
return 'Please select gender.';
}
},
dropdownFullScreen: true,
onChanged: (value) {},
onSaved: (value) {
selectedValue = value.toString();
},
),
),
);
}
}```
from dropdown_button2.
Related Issues (20)
- Question about searchMatchFn HOT 2
- Possibly unnecessary row for single child HOT 2
- itemHeight intrinsic HOT 4
- Does DropdownButton2 support keyboard for desktop apps HOT 5
- Leading icon HOT 1
- wrong drop menu postion HOT 4
- dropdown btn inside a dialog has problem HOT 4
- Unsupported operation: Cannot modify an unmodifiable list. Error thrown during performLayout(). HOT 2
- The issue with the position of the dropdown button. HOT 2
- Validator helper text position and style
- Either zero or 2 or more [DropdownMenuItem]s were detected with the same value this happen when i have three drop downs get from api and two of them depend of what i will choose from the first one when schoose from the three drop downs and select from the first one again got this error HOT 12
- DropdownButtonFormField2 with Form - Align Text
- Drop-Down opens very slowly after one of the last items has been selected in a large list (2500 entries)
- is the dropdown_button two have validator? HOT 1
- How to make the item height adaptive? HOT 1
- Is it possible to search typing directly in the main control without showing the dropdown list? HOT 5
- The named parameter 'dropdownSeparator' isn't defined. HOT 2
- 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
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.