10

I am trying to create a tab bar which contains icon and text in the same row in tab.

I have tried below code to implement the same , due to which the icon and text are shown in column manner in tab.

 bottom: TabBar( tabs: [ Tab(icon: new Image.asset("assets/images/[email protected]",width: 18,height: 18), child: Text("Policies") ), Tab( child: Container( child: Align( alignment: Alignment.center, child: Text("Policy Payments")), ), ) 

Can anyone guide me how to achieve the same. My tabbar currently looks as below.

enter image description here

I want to design something like below :-

enter image description here

2
  • here is your solution stackoverflow.com/a/51125324/11033305 ... Please let me know if it not works Commented Jul 12, 2021 at 6:25
  • I have already gone through the link, that is not what I want to craete. You can refer both the links of image I have shared in the question. @Why_So_Ezz Commented Jul 12, 2021 at 6:37

1 Answer 1

30

why don't you define tabs like this?

Tab( child: Row( mainAxisSize: MainAxisSize.min, children: [ Image.asset('assets/images/[email protected]', width: 18, height: 18), const SizedBox(width: 8), Text('Policies'), ], ), ), 
Sign up to request clarification or add additional context in comments.

2 Comments

The text property is required though.
it's not required

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.