I want to create below tab like rounded buttons named Vehicle & Key in flutter which is selectable and de-selectable. I can use Tab but its part of scaffold. Is there any other way to achieve as below?
I want to create below tab like rounded buttons named Vehicle & Key in flutter which is selectable and de-selectable. I can use Tab but its part of scaffold. Is there any other way to achieve as below?
2
Answers
You can create two widgets simultaneously and then provide them a
flag
for visibility :This can help you create two buttons which
onPressing
will change yourflag
which in turn will change the content you are providing on the screen.You can use the
toggle_switch 2.0.1
(https://pub.dev/packages/toggle_switch) package which is inFlutter favorite program
.Its simple to use : –
Complete Code : –
Output : –