Please check the above image.
I want to create these two selectable containers that if i i select home container the home container should be selected,and if i select office container, the office container should be selected and the border of selected container should be orange like this in the screen.
I tried it by making a simple container, i can create these statically but i want to make it selectable.
2
Answers
TextFormField has a property for setting the style when the input is Focused
What you need is a value notifier or an attribute to store selected container value and update UI on change.
If you use
ValueNotifier
you can wrap theColumn
that contains both containers withValueListenableBuilder
and add border based on selected value.If you have an attribute, you need to setState() on updating selected index.
You can store the index of selection and show border if