change TabBar backgroundcolor

793 views
Skip to first unread message

hechmi dammak

unread,
Jul 23, 2019, 5:23:31 AM7/23/19
to Flutter Development (flutter-dev)
hi i have a tabbar in the position of an appbar inside a scafold and i need to change the background color of it  
Scaffold(
appBar: TabBar(
indicatorWeight: 4,
controller: _tabcont,
tabs: [
Text("Donations",
style: new TextStyle(
color: index != 0
? Theme.of(context).backgroundColor
: Colors.white,
fontSize: 20.0)),
Container(
height: height,
child: Center(
child: Text("Requests",
style: new TextStyle(
color: index != 1
? Theme.of(context).backgroundColor
: Colors.white,
fontSize: 20.0)),
),
)
],
),
body: TabBarView(
physics: new NeverScrollableScrollPhysics(),
controller: _tabcont,
children: <Widget>[
DonationTab(),
RequestTab()
]),
)
Reply all
Reply to author
Forward
0 new messages