How to fix Flutter dropdown button overflow issue?
up vote
1
down vote
favorite
I create a Flutter Form and I build a dropdown button with flutter. I am losing local son data into dropdown. Some of my items in dropdown button is long. I use SafeArea and ListView and I am getting overflow on right.
partial solution not mentioned in the other question, and I get the answer here.
Any idea how to fix it?
// TODO: BUILD RUN
return new Scaffold(
key: _scaffoldKey,
body: new SafeArea(
top: false,
bottom: false,
child: new Form(
key: _formKey,
child: new ListView(
padding: const EdgeInsets.symmetric(
horizontal: 16.0, vertical: 32.0),
children: <Widget>[
//TODO: CURRENCY
new FormField<String>(
builder: (FormFieldState<String> state)
return InputDecorator(
decoration: InputDecoration(
labelText: 'CHOOSE CURRENCY',
labelStyle: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
color: Colors.green.shade700),
errorText: state.hasError ? state.errorText : null,
),
isEmpty: _mySelectedCurrency == '',
child: new DropdownButtonHideUnderline(
child: new DropdownButton<String>(
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight: FontWeight.w500,
),
value: _mySelectedCurrency,
isDense: true,
onChanged: (String newValue)
setState(()
_mySelectedCurrency = newValue;
state.didChange(newValue);
);
,
items: _itemsName,
),
),
);
,
validator: (val)
return val != '' ? null : 'Choose Currency...';
,
),
],
))));
add a comment |
up vote
1
down vote
favorite
I create a Flutter Form and I build a dropdown button with flutter. I am losing local son data into dropdown. Some of my items in dropdown button is long. I use SafeArea and ListView and I am getting overflow on right.
partial solution not mentioned in the other question, and I get the answer here.
Any idea how to fix it?
// TODO: BUILD RUN
return new Scaffold(
key: _scaffoldKey,
body: new SafeArea(
top: false,
bottom: false,
child: new Form(
key: _formKey,
child: new ListView(
padding: const EdgeInsets.symmetric(
horizontal: 16.0, vertical: 32.0),
children: <Widget>[
//TODO: CURRENCY
new FormField<String>(
builder: (FormFieldState<String> state)
return InputDecorator(
decoration: InputDecoration(
labelText: 'CHOOSE CURRENCY',
labelStyle: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
color: Colors.green.shade700),
errorText: state.hasError ? state.errorText : null,
),
isEmpty: _mySelectedCurrency == '',
child: new DropdownButtonHideUnderline(
child: new DropdownButton<String>(
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight: FontWeight.w500,
),
value: _mySelectedCurrency,
isDense: true,
onChanged: (String newValue)
setState(()
_mySelectedCurrency = newValue;
state.didChange(newValue);
);
,
items: _itemsName,
),
),
);
,
validator: (val)
return val != '' ? null : 'Choose Currency...';
,
),
],
))));
Possible duplicate of Flutter - DropdownButton overflow in ListView
– chemamolins
Nov 8 at 17:47
yes its similar... And seems GitHub issues not resolved yet. Problem is that work around will not going to fix for me, the dropdown menu item will be more than 3 line sometimes... Looking for fixed and closed solution, thanks
– Nick
Nov 8 at 17:56
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I create a Flutter Form and I build a dropdown button with flutter. I am losing local son data into dropdown. Some of my items in dropdown button is long. I use SafeArea and ListView and I am getting overflow on right.
partial solution not mentioned in the other question, and I get the answer here.
Any idea how to fix it?
// TODO: BUILD RUN
return new Scaffold(
key: _scaffoldKey,
body: new SafeArea(
top: false,
bottom: false,
child: new Form(
key: _formKey,
child: new ListView(
padding: const EdgeInsets.symmetric(
horizontal: 16.0, vertical: 32.0),
children: <Widget>[
//TODO: CURRENCY
new FormField<String>(
builder: (FormFieldState<String> state)
return InputDecorator(
decoration: InputDecoration(
labelText: 'CHOOSE CURRENCY',
labelStyle: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
color: Colors.green.shade700),
errorText: state.hasError ? state.errorText : null,
),
isEmpty: _mySelectedCurrency == '',
child: new DropdownButtonHideUnderline(
child: new DropdownButton<String>(
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight: FontWeight.w500,
),
value: _mySelectedCurrency,
isDense: true,
onChanged: (String newValue)
setState(()
_mySelectedCurrency = newValue;
state.didChange(newValue);
);
,
items: _itemsName,
),
),
);
,
validator: (val)
return val != '' ? null : 'Choose Currency...';
,
),
],
))));
I create a Flutter Form and I build a dropdown button with flutter. I am losing local son data into dropdown. Some of my items in dropdown button is long. I use SafeArea and ListView and I am getting overflow on right.
partial solution not mentioned in the other question, and I get the answer here.
Any idea how to fix it?
// TODO: BUILD RUN
return new Scaffold(
key: _scaffoldKey,
body: new SafeArea(
top: false,
bottom: false,
child: new Form(
key: _formKey,
child: new ListView(
padding: const EdgeInsets.symmetric(
horizontal: 16.0, vertical: 32.0),
children: <Widget>[
//TODO: CURRENCY
new FormField<String>(
builder: (FormFieldState<String> state)
return InputDecorator(
decoration: InputDecoration(
labelText: 'CHOOSE CURRENCY',
labelStyle: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
color: Colors.green.shade700),
errorText: state.hasError ? state.errorText : null,
),
isEmpty: _mySelectedCurrency == '',
child: new DropdownButtonHideUnderline(
child: new DropdownButton<String>(
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight: FontWeight.w500,
),
value: _mySelectedCurrency,
isDense: true,
onChanged: (String newValue)
setState(()
_mySelectedCurrency = newValue;
state.didChange(newValue);
);
,
items: _itemsName,
),
),
);
,
validator: (val)
return val != '' ? null : 'Choose Currency...';
,
),
],
))));
edited Nov 8 at 18:40
asked Nov 8 at 17:11
Nick
1418
1418
Possible duplicate of Flutter - DropdownButton overflow in ListView
– chemamolins
Nov 8 at 17:47
yes its similar... And seems GitHub issues not resolved yet. Problem is that work around will not going to fix for me, the dropdown menu item will be more than 3 line sometimes... Looking for fixed and closed solution, thanks
– Nick
Nov 8 at 17:56
add a comment |
Possible duplicate of Flutter - DropdownButton overflow in ListView
– chemamolins
Nov 8 at 17:47
yes its similar... And seems GitHub issues not resolved yet. Problem is that work around will not going to fix for me, the dropdown menu item will be more than 3 line sometimes... Looking for fixed and closed solution, thanks
– Nick
Nov 8 at 17:56
Possible duplicate of Flutter - DropdownButton overflow in ListView
– chemamolins
Nov 8 at 17:47
Possible duplicate of Flutter - DropdownButton overflow in ListView
– chemamolins
Nov 8 at 17:47
yes its similar... And seems GitHub issues not resolved yet. Problem is that work around will not going to fix for me, the dropdown menu item will be more than 3 line sometimes... Looking for fixed and closed solution, thanks
– Nick
Nov 8 at 17:56
yes its similar... And seems GitHub issues not resolved yet. Problem is that work around will not going to fix for me, the dropdown menu item will be more than 3 line sometimes... Looking for fixed and closed solution, thanks
– Nick
Nov 8 at 17:56
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Though I have flagged the question as possible duplicate, a partial solution not mentioned in the other question is to use the isExpanded property for DropDownButton.
child: new DropdownButton<String>(
isExpanded: true,
...
Thanks, it's working without getting any error or overflow. But I need to ask. What do you mean "partial solution"?
– Nick
Nov 8 at 18:37
Well, reading the last comment in the Github issue, I couldn't but agree with the poster. It works but may not work in all situations.
– chemamolins
Nov 8 at 19:05
thanks, still looking final solution, and I modify my menu item so currently I have no problem...
– Nick
Nov 9 at 2:50
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Though I have flagged the question as possible duplicate, a partial solution not mentioned in the other question is to use the isExpanded property for DropDownButton.
child: new DropdownButton<String>(
isExpanded: true,
...
Thanks, it's working without getting any error or overflow. But I need to ask. What do you mean "partial solution"?
– Nick
Nov 8 at 18:37
Well, reading the last comment in the Github issue, I couldn't but agree with the poster. It works but may not work in all situations.
– chemamolins
Nov 8 at 19:05
thanks, still looking final solution, and I modify my menu item so currently I have no problem...
– Nick
Nov 9 at 2:50
add a comment |
up vote
1
down vote
accepted
Though I have flagged the question as possible duplicate, a partial solution not mentioned in the other question is to use the isExpanded property for DropDownButton.
child: new DropdownButton<String>(
isExpanded: true,
...
Thanks, it's working without getting any error or overflow. But I need to ask. What do you mean "partial solution"?
– Nick
Nov 8 at 18:37
Well, reading the last comment in the Github issue, I couldn't but agree with the poster. It works but may not work in all situations.
– chemamolins
Nov 8 at 19:05
thanks, still looking final solution, and I modify my menu item so currently I have no problem...
– Nick
Nov 9 at 2:50
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Though I have flagged the question as possible duplicate, a partial solution not mentioned in the other question is to use the isExpanded property for DropDownButton.
child: new DropdownButton<String>(
isExpanded: true,
...
Though I have flagged the question as possible duplicate, a partial solution not mentioned in the other question is to use the isExpanded property for DropDownButton.
child: new DropdownButton<String>(
isExpanded: true,
...
answered Nov 8 at 17:57
chemamolins
1,7291610
1,7291610
Thanks, it's working without getting any error or overflow. But I need to ask. What do you mean "partial solution"?
– Nick
Nov 8 at 18:37
Well, reading the last comment in the Github issue, I couldn't but agree with the poster. It works but may not work in all situations.
– chemamolins
Nov 8 at 19:05
thanks, still looking final solution, and I modify my menu item so currently I have no problem...
– Nick
Nov 9 at 2:50
add a comment |
Thanks, it's working without getting any error or overflow. But I need to ask. What do you mean "partial solution"?
– Nick
Nov 8 at 18:37
Well, reading the last comment in the Github issue, I couldn't but agree with the poster. It works but may not work in all situations.
– chemamolins
Nov 8 at 19:05
thanks, still looking final solution, and I modify my menu item so currently I have no problem...
– Nick
Nov 9 at 2:50
Thanks, it's working without getting any error or overflow. But I need to ask. What do you mean "partial solution"?
– Nick
Nov 8 at 18:37
Thanks, it's working without getting any error or overflow. But I need to ask. What do you mean "partial solution"?
– Nick
Nov 8 at 18:37
Well, reading the last comment in the Github issue, I couldn't but agree with the poster. It works but may not work in all situations.
– chemamolins
Nov 8 at 19:05
Well, reading the last comment in the Github issue, I couldn't but agree with the poster. It works but may not work in all situations.
– chemamolins
Nov 8 at 19:05
thanks, still looking final solution, and I modify my menu item so currently I have no problem...
– Nick
Nov 9 at 2:50
thanks, still looking final solution, and I modify my menu item so currently I have no problem...
– Nick
Nov 9 at 2:50
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53212846%2fhow-to-fix-flutter-dropdown-button-overflow-issue%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Possible duplicate of Flutter - DropdownButton overflow in ListView
– chemamolins
Nov 8 at 17:47
yes its similar... And seems GitHub issues not resolved yet. Problem is that work around will not going to fix for me, the dropdown menu item will be more than 3 line sometimes... Looking for fixed and closed solution, thanks
– Nick
Nov 8 at 17:56