Search
 
SCRIPT & CODE EXAMPLE
 

DART

How to change background color of TabBar without changing the AppBar in flutter?

return MaterialApp(
      theme: ThemeData(
        brightness: Brightness.light,
      // add tabBarTheme 
      tabBarTheme: const TabBarTheme(
        labelColor: Colors.pink[800],
        labelStyle: TextStyle(color: Colors.pink[800]), // color for text
        indicator: UnderlineTabIndicator( // color for indicator (underline)
          borderSide: BorderSide(color: ConstColor.primary))),
        primaryColor: Colors.pink[800], // outdated and has no effect to Tabbar
        accentColor: Colors.cyan[600] // deprecated,
      ),
      home: DefaultTabController(
        length: 3,
        child: Scaffold(
          appBar: AppBar(
            bottom: TabBar(
              indicatorColor: Colors.lime,
              tabs: [
                Tab(icon: Icon(Icons.directions_car)),
                Tab(icon: Icon(Icons.directions_transit)),
                Tab(icon: Icon(Icons.directions_bike)),
              ],
            ),
            title: Text('Tabs Demo'),
          ),
          body: TabBarView(
            children: [
              Icon(Icons.directions_car),
              Icon(Icons.directions_transit),
              Icon(Icons.directions_bike),
            ],
          ),
        ),
      ),
    );
Comment

how to change tab color in flutter

bottom: TabBar( indicatorColor: Colors.lime )
Comment

change color icon tabbar flutter

appBar: AppBar(
        brightness: Brightness.dark,
        iconTheme: IconThemeData(color: Colors.white),
        title: Text("Title TabBar"),
)
Comment

tab color in flutter

TabBar get _tabBar => TabBar(
  tabs: [
    Tab(icon: Icon(Icons.call)),
    Tab(icon: Icon(Icons.message)),
  ],
);
  
@override
Widget build(BuildContext context) {
  return DefaultTabController(
    length: 2,
    child: Scaffold(
      appBar: AppBar(
        title: Text('AppBar'),
        bottom: PreferredSize(
          preferredSize: _tabBar.preferredSize,
          child: ColoredBox(
            color: Colors.red,
            child: _tabBar,
          ),
        ),
      ),
    ),
  );
}
Comment

PREVIOUS NEXT
Code Example
Dart :: Wraps Text Flutter 
Dart :: animation in flutter 
Dart :: flutter sqflite foreign keyy 
Dart :: flutter assign modify theme 
Dart :: dart map list to map 
Dart :: dart async map 
Dart :: flutter sliver app bar remove top padding 
Dart :: desing patters para Flutter 
Dart :: Cannot remove from an unmodifiable list dart 
Dart :: loob in dart 
Dart :: what is map in dart 
Dart :: flutter when to use methods 
Swift :: time formats swift 
Swift :: double to string swift 
Swift :: get device height and width wift 
Swift :: swift enum all cases 
Swift :: swift compare string to button title 
Swift :: detect end of scroll in UICollectionView ios swift 
Swift :: switches xcode 
Swift :: Save class in userdefaults ios swift 
Swift :: swift change status bar color 
Swift :: post request in swift 
Swift :: swift enum 
Swift :: array swift 
Swift :: Swift Basic Input 
Swift :: check enumatted arrray last item swift 
Swift :: ios get device id 
Swift :: declaring optionals swift 
Swift :: How to convert String into Array of character 
Swift :: float vs double in swift 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =