Flutter - can't see validation messages for disabled form fields Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!A potentially dangerous Request.Form value was detected from the clientDisable validation of HTML5 form elementsAngularjs prevent form submission when input validation failsPrevent validation messages appeared if fields are disabledshow validation error messages on submit in angularjsDisabled required validator still causes validationFlutter firebase validation of form field inputsLaravel Form Validation Message ViewFlutter Textfield Validation message indexingDisable jsf form int validation
How to get even lighting when using flash for group photos near wall?
What was Apollo 13's "Little Jolt" after MECO?
Book with legacy programming code on a space ship that the main character hacks to escape
How to translate "red flag" into Spanish?
Check if a string is entirely made of the same substring
Why did C use the -> operator instead of reusing the . operator?
Would reducing the reference voltage of an ADC have any effect on accuracy?
Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?
What *exactly* is electrical current, voltage, and resistance?
Protagonist's race is hidden - should I reveal it?
How can I wire a 9-position switch so that each position turns on one more LED than the one before?
What is the best way to deal with NPC-NPC combat?
Why does the Cisco show run command not show the full version, while the show version command does?
Multiple options vs single option UI
Could moose/elk survive in the Amazon forest?
Where did Arya get these scars?
Align column where each cell has two decimals with siunitx
Mistake in years of experience in resume?
Does Feeblemind produce an ongoing magical effect that can be dispelled?
What is the least dense liquid under normal conditions?
How to not starve gigantic beasts
Passing args from the bash script to the function in the script
What is the ongoing value of the Kanban board to the developers as opposed to management
What's parked in Mil Moscow helicopter plant?
Flutter - can't see validation messages for disabled form fields
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!A potentially dangerous Request.Form value was detected from the clientDisable validation of HTML5 form elementsAngularjs prevent form submission when input validation failsPrevent validation messages appeared if fields are disabledshow validation error messages on submit in angularjsDisabled required validator still causes validationFlutter firebase validation of form field inputsLaravel Form Validation Message ViewFlutter Textfield Validation message indexingDisable jsf form int validation
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
For my Flutter
App, I'm using many input form fields for data input, and assigning a validation method for each, for all fields the error message appears normally, just below the field, except for one field that takes value from a picker dialog, so that i made it disabled (enabled=false
) to prevent user input on it
Is it normal that a disabled field doesn't show validation error messages? if yes, should i do something different to prevent user input on that field other than making it disabled?
validation input
![](http://i.stack.imgur.com/EQnZM.png)
add a comment |
For my Flutter
App, I'm using many input form fields for data input, and assigning a validation method for each, for all fields the error message appears normally, just below the field, except for one field that takes value from a picker dialog, so that i made it disabled (enabled=false
) to prevent user input on it
Is it normal that a disabled field doesn't show validation error messages? if yes, should i do something different to prevent user input on that field other than making it disabled?
validation input
![](http://i.stack.imgur.com/EQnZM.png)
add a comment |
For my Flutter
App, I'm using many input form fields for data input, and assigning a validation method for each, for all fields the error message appears normally, just below the field, except for one field that takes value from a picker dialog, so that i made it disabled (enabled=false
) to prevent user input on it
Is it normal that a disabled field doesn't show validation error messages? if yes, should i do something different to prevent user input on that field other than making it disabled?
validation input
![](http://i.stack.imgur.com/EQnZM.png)
For my Flutter
App, I'm using many input form fields for data input, and assigning a validation method for each, for all fields the error message appears normally, just below the field, except for one field that takes value from a picker dialog, so that i made it disabled (enabled=false
) to prevent user input on it
Is it normal that a disabled field doesn't show validation error messages? if yes, should i do something different to prevent user input on that field other than making it disabled?
validation input
![](http://i.stack.imgur.com/EQnZM.png)
validation input
![](http://i.stack.imgur.com/EQnZM.png)
edited Mar 22 at 17:12
Mohamed Selim
asked Mar 22 at 15:47
![](https://i.stack.imgur.com/3cqB7.png?s=32&g=1)
![](https://i.stack.imgur.com/3cqB7.png?s=32&g=1)
Mohamed SelimMohamed Selim
1,7971628
1,7971628
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
If you don't want to default validation in some field than you should be use TextField instant of TextFormField and do validation by controller.
I do need the default validation, and need to prevent user input on it, the problem is that making it disabled, hides the validation message
– Mohamed Selim
Mar 23 at 10:38
add a comment |
I can't imagine that this behavior is intended, I don't know why the disabled field shouldn't show the error message, if it isn't a bug, then the upcoming flutter versions shall provide a readonly
or similar property to use in such case
Any way, for the time being I've edited flutter code to show the disabled field error message
in the file flutterpackagesflutterlibsrcmaterialinput_decorator.dart
change the method
TextStyle _getErrorStyle(ThemeData themeData)
final Color color = decoration.enabled? themeData.errorColor : Colors.transparent;
return themeData.textTheme.caption.copyWith(color: color).merge(decoration.errorStyle);
to be
TextStyle _getErrorStyle(ThemeData themeData)
final Color color = themeData.errorColor;
return themeData.textTheme.caption.copyWith(color: color).merge(decoration.errorStyle);
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2f55303323%2fflutter-cant-see-validation-messages-for-disabled-form-fields%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you don't want to default validation in some field than you should be use TextField instant of TextFormField and do validation by controller.
I do need the default validation, and need to prevent user input on it, the problem is that making it disabled, hides the validation message
– Mohamed Selim
Mar 23 at 10:38
add a comment |
If you don't want to default validation in some field than you should be use TextField instant of TextFormField and do validation by controller.
I do need the default validation, and need to prevent user input on it, the problem is that making it disabled, hides the validation message
– Mohamed Selim
Mar 23 at 10:38
add a comment |
If you don't want to default validation in some field than you should be use TextField instant of TextFormField and do validation by controller.
If you don't want to default validation in some field than you should be use TextField instant of TextFormField and do validation by controller.
answered Mar 23 at 4:58
Nikhil_VadoliyaNikhil_Vadoliya
24445
24445
I do need the default validation, and need to prevent user input on it, the problem is that making it disabled, hides the validation message
– Mohamed Selim
Mar 23 at 10:38
add a comment |
I do need the default validation, and need to prevent user input on it, the problem is that making it disabled, hides the validation message
– Mohamed Selim
Mar 23 at 10:38
I do need the default validation, and need to prevent user input on it, the problem is that making it disabled, hides the validation message
– Mohamed Selim
Mar 23 at 10:38
I do need the default validation, and need to prevent user input on it, the problem is that making it disabled, hides the validation message
– Mohamed Selim
Mar 23 at 10:38
add a comment |
I can't imagine that this behavior is intended, I don't know why the disabled field shouldn't show the error message, if it isn't a bug, then the upcoming flutter versions shall provide a readonly
or similar property to use in such case
Any way, for the time being I've edited flutter code to show the disabled field error message
in the file flutterpackagesflutterlibsrcmaterialinput_decorator.dart
change the method
TextStyle _getErrorStyle(ThemeData themeData)
final Color color = decoration.enabled? themeData.errorColor : Colors.transparent;
return themeData.textTheme.caption.copyWith(color: color).merge(decoration.errorStyle);
to be
TextStyle _getErrorStyle(ThemeData themeData)
final Color color = themeData.errorColor;
return themeData.textTheme.caption.copyWith(color: color).merge(decoration.errorStyle);
add a comment |
I can't imagine that this behavior is intended, I don't know why the disabled field shouldn't show the error message, if it isn't a bug, then the upcoming flutter versions shall provide a readonly
or similar property to use in such case
Any way, for the time being I've edited flutter code to show the disabled field error message
in the file flutterpackagesflutterlibsrcmaterialinput_decorator.dart
change the method
TextStyle _getErrorStyle(ThemeData themeData)
final Color color = decoration.enabled? themeData.errorColor : Colors.transparent;
return themeData.textTheme.caption.copyWith(color: color).merge(decoration.errorStyle);
to be
TextStyle _getErrorStyle(ThemeData themeData)
final Color color = themeData.errorColor;
return themeData.textTheme.caption.copyWith(color: color).merge(decoration.errorStyle);
add a comment |
I can't imagine that this behavior is intended, I don't know why the disabled field shouldn't show the error message, if it isn't a bug, then the upcoming flutter versions shall provide a readonly
or similar property to use in such case
Any way, for the time being I've edited flutter code to show the disabled field error message
in the file flutterpackagesflutterlibsrcmaterialinput_decorator.dart
change the method
TextStyle _getErrorStyle(ThemeData themeData)
final Color color = decoration.enabled? themeData.errorColor : Colors.transparent;
return themeData.textTheme.caption.copyWith(color: color).merge(decoration.errorStyle);
to be
TextStyle _getErrorStyle(ThemeData themeData)
final Color color = themeData.errorColor;
return themeData.textTheme.caption.copyWith(color: color).merge(decoration.errorStyle);
I can't imagine that this behavior is intended, I don't know why the disabled field shouldn't show the error message, if it isn't a bug, then the upcoming flutter versions shall provide a readonly
or similar property to use in such case
Any way, for the time being I've edited flutter code to show the disabled field error message
in the file flutterpackagesflutterlibsrcmaterialinput_decorator.dart
change the method
TextStyle _getErrorStyle(ThemeData themeData)
final Color color = decoration.enabled? themeData.errorColor : Colors.transparent;
return themeData.textTheme.caption.copyWith(color: color).merge(decoration.errorStyle);
to be
TextStyle _getErrorStyle(ThemeData themeData)
final Color color = themeData.errorColor;
return themeData.textTheme.caption.copyWith(color: color).merge(decoration.errorStyle);
answered Mar 23 at 12:22
![](https://i.stack.imgur.com/3cqB7.png?s=32&g=1)
![](https://i.stack.imgur.com/3cqB7.png?s=32&g=1)
Mohamed SelimMohamed Selim
1,7971628
1,7971628
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f55303323%2fflutter-cant-see-validation-messages-for-disabled-form-fields%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