Comments (1)
@lozthiensu Hello,
Now that I'm looking at this code, I believe the initial null check for state (FormFieldState) is not necessary. In previous versions, there was
- MultiSelectField - not a FormField and by default not drawn with a bottom border
- MultiSelectFormField - FormField and drawn with bottom border
and now there's only the FormField version, so state shouldn't be null.
However it has always been possible to override this default bottom border by providing a decoration parameter to the MultiSelectDialogField or MultiSelectBottomSheetField.
I am able to override the default black border with this example
MultiSelectDialogField(
onConfirm: (val) {
_selectedAnimals = val;
},
items: _items,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.blue,
),
),
),
),
Doing this removes the default behavior of switching to a red underline when the FormFieldState has an error. If you wanted to retain that, you'd have to do something like
border: Border(
bottom: BorderSide(
color: _multiSelectKey.currentState != null &&
_multiSelectKey.currentState.hasError
? Colors.red
: Colors.blue,
),
),
and then setState after you call validate on the _multiSelectKey.
Can you provide an example where you are unable to achieve what you want?
from multi_select_flutter.
Related Issues (20)
- `__MultiSelectChipFieldViewState` `_selectedValues` wrong typing
- How to display image instead of name in MultiSelectItem
- InitialValue does not work using partial array items HOT 2
- How to get value of input search, to consume api to search?
- onSelectionChanged value issue HOT 2
- Target kernel_snapshot failed: Exception After using this package
- Can't reduce the spacing between chips
- MultiSelectChipField - selectedTextStyle fontSize not respected
- Bug: trying to setState after dispose()
- Error: The argument type 'List<V>?' can't be assigned to the parameter type 'List<V>' HOT 4
- Select only single field HOT 1
- MultiSelectChipDisplay : custom icon doesn't replace default icon(Icons.checked). HOT 5
- Transform widget to be more modular
- Drag to order selected items
- Example: compiling and runtime errors
- MultiSelectBottomSheetField runtime TypeError
- Error with MultiSelectChipField(), HOT 1
- Can't remove an item with using chipDisplay.
- items parameter ignores item order
- Can we mark items of checklist already checked at initially in MultiSelectDialogField?
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 multi_select_flutter.