gpt-3.5-turbo-0301· OpenAI
WildChat-4.8M (AI2)
flutter 3.7 how to set background color for disabled inputformtext() widget?
- User
flutter 3.7 how to set background color for disabled inputformtext() widget?
- Assistant
To set the background color for a disabled
InputFormTextwidget, you can use thedecorationproperty and provide aBoxDecorationwith the desired background color. Here's an example:codeInputFormText( enabled: false, decoration: InputDecoration( filled: true, fillColor: Colors.grey[200], // set background color labelText: 'Disabled input', ), )In the above code, the
enabledproperty is set tofalseto disable the input, and thedecorationproperty is used to provide the background color using aBoxDecorationwith a grey color ofColors.grey[200]. You can adjust the color to your preference.