TabBar on bottom of app with Column - flutter

I am trying to put the TabBar on the bottom of the app.
It worked so far, yet I can't get the pages to work (TabBarView). It just looks black and unresponsive. The TabBar is unresponsive too. Have I taken the wrong approach?
Currently, it looks like that:
And the code looks like this:
import 'package:flutter/material.dart';
void main() => runApp(Bookkeeper());
class Bookkeeper extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
home: DefaultTabController(
length: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
verticalDirection: VerticalDirection.up,
mainAxisSize: MainAxisSize.min,
children: [
AppBar(
backgroundColor: Color(0xFF3F5AA6),
title: Container(
padding: EdgeInsets.only(top: 8.0),
child: menu(),
),
),
TabBarView(
children: [
Icon(Icons.directions_car),
Icon(Icons.directions_transit),
Icon(Icons.directions_bike),
Icon(Icons.directions_bike),
],
),
],
),
),
);
}
Widget menu() {
return TabBar(
tabs: [
Tab(
child: Container(
height: 45.0,
child: Column(
children:
[
Icon(Icons.euro_symbol),
Text(
"Transactions",
style: new TextStyle(
height: 1.5,
fontSize: 9.8,
color: Colors.white,
),
),
],
),
),
),
Tab(
child: Container(
height: 45.0,
child: Column(
children:
[
Icon(Icons.assignment),
Text(
"Bills",
style: new TextStyle(
height: 1.5,
fontSize: 9.5,
color: Colors.white,
),
),
],
),
),
),
Tab(
child: Container(
height: 45.0,
child: Column(
children:
[
Icon(Icons.account_balance_wallet),
Text(
"Balance",
style: new TextStyle(
height: 1.5,
fontSize: 9.5,
color: Colors.white,
),
),
],
),
),
),
Tab(
child: Container(
height: 45.0,
child: Column(
children:
[
Icon(Icons.settings),
Text(
"Options",
style: new TextStyle(
height: 1.5,
fontSize: 9.5,
color: Colors.white,
),
),
],
),
),
),
],
);
}
}

Use bottomNavigationBar to position the Tabs at the bottom of the screen
class Bookkeeper extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
home: DefaultTabController(
length: 4,
child: Scaffold(
appBar: AppBar(
backgroundColor: Color(0xFF3F5AA6),
title: Text("Title text"),
),
bottomNavigationBar: menu(),
body: TabBarView(
children: [
Container(child: Icon(Icons.directions_car)),
Container(child: Icon(Icons.directions_transit)),
Container(child: Icon(Icons.directions_bike)),
Container(child: Icon(Icons.directions_bike)),
],
),
),
),
);
}
Widget menu() {
return Container(
color: Color(0xFF3F5AA6),
child: TabBar(
labelColor: Colors.white,
unselectedLabelColor: Colors.white70,
indicatorSize: TabBarIndicatorSize.tab,
indicatorPadding: EdgeInsets.all(5.0),
indicatorColor: Colors.blue,
tabs: [
Tab(
text: "Transactions",
icon: Icon(Icons.euro_symbol),
),
Tab(
text: "Bills",
icon: Icon(Icons.assignment),
),
Tab(
text: "Balance",
icon: Icon(Icons.account_balance_wallet),
),
Tab(
text: "Options",
icon: Icon(Icons.settings),
),
],
),
);
}
}

Related

Go to specific section when button clicked in flutter

I am trying to navigate the section on the same page when the button is clicked but I can not do it using PageView and Scroll, Does anyone know how to do it?
This is the navigation bar on the top of the page and I want it to go to specific section on the same page when the button is clicked.
this is my code:
Row(
children: [
NavItem(
title: 'Home',
onPreesed: () {},
color: KprimaryColor,
fontWeight: FontWeight.w900,
),
NavItem(
title: 'About',
onPreesed: () {},
color: Colors.black,
fontWeight: FontWeight.normal,
),
NavItem(
title: 'Projects',
onPreesed: () {},
color: Colors.black,
fontWeight: FontWeight.normal,
),
NavItem(
title: 'Contact',
onPreesed: () {},
color: Colors.black,
fontWeight: FontWeight.normal,
),
Please, try this!
class MyAppTabView extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
home: DefaultTabController(
length: 4,
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.white,
title: Text('Flutter Tabs', style: TextStyle(color: Colors.black)),
bottom: const PreferredSize(
preferredSize: Size.fromHeight(40),
child: Align(
alignment: Alignment.centerRight,
child: TabBar(
isScrollable: true,
unselectedLabelStyle: TextStyle(fontWeight: FontWeight.normal),
unselectedLabelColor: Colors.black,
indicatorSize: TabBarIndicatorSize.label,
indicatorColor: Colors.transparent,
labelColor: Colors.red,
labelStyle: TextStyle(fontWeight: FontWeight.bold),
tabs: [
Tab(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Center(
child: Text("Home"),
),
),
),
Tab(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Center(
child: Text("About"),
),
),
),
Tab(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Center(
child: Text("Projects"),
),
),
),
Tab(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Center(
child: Text("Contact"),
),
),
),
]),
),
),
),
body: TabBarView(
children: [
Center(child: Text("Home")),
Center(child: Text("About")),
Center(child: Text("Projects")),
Center(child: Text("Contact")),
],
),
),
),
);
}
}
Enjoy Coding!!

TabBarView inside Sliver with StickyHeader

I have made this layout so far using CustomScrollView and Sticky Header
https://imgur.com/a/Xo4AfAM
What I want to achieve is that the content below the tabs should not scroll unless there is extra content available. Also, after scrolling, the content should not go behind the sticky header.
My Code so far.
Scaffold(
backgroundColor: Colors.white,
extendBodyBehindAppBar: true,
appBar: AppBar(
toolbarHeight: getHeight() * (1 / 11),
),
body: Padding(
padding: getPaddings(),
child: DefaultTabController(
length: 3,
child: CustomScrollView(
slivers: [
SliverToBoxAdapter(
child: Container(
height: getHeight() * (3 / 11),
color: Colors.blue,
),
),
SliverStickyHeader(
header: Column(
children: [
Container(
height: getHeight() * (1 / 11),
width: double.infinity,
color: kPrimaryColor,
child: Center(
child: Text(
"TEXT",
style: TextStyle(
fontSize: 32,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
),
Container(
height: getHeight() * (1 / 11),
color: kPrimaryColor,
child: TabBar(
tabs: [
Tab(
child: Text(
'TITLE1',
style: TextStyle(color: Colors.black),
),
),
Tab(
child: Text(
'TITLE2',
style: TextStyle(color: Colors.black),
),
),
Tab(
child: Text(
'TITLE3',
style: TextStyle(color: Colors.black),
),
),
],
),
),
],
),
sliver: SliverFillRemaining(
child: TabBarView(
children: [
Padding(
padding: EdgeInsets.symmetric(
horizontal: getProportionateScreenWidth(50),
vertical: getProportionateScreenHeight(20)),
child: Column(
children: [
RoundedPicture(),
FittedBox(
child: Text("Hello World",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 40)),
),
SizedBox(
height: getProportionateScreenHeight(20),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 20),
text: 'Info1: ',
children: [
TextSpan(
text: "123",
style: TextStyle(
color: kSecondaryColor,
),
),
]),
),
SizedBox(
height: getProportionateScreenHeight(20),
),
RichText(
text: TextSpan(
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 20),
text: 'Info2: ',
children: [
TextSpan(
text: "abcd",
style: TextStyle(
color: kSecondaryColor,
),
),
]),
),
SizedBox(
height: getProportionateScreenHeight(20),
),
RichText(
text: TextSpan(
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 20),
text: 'Info3: ',
children: [
TextSpan(
text: "xyz",
style: TextStyle(
color: kSecondaryColor,
),
),
]),
),
],
),
],
),
),
Center(
child: Text("TITLE2"),
),
Center(
child: Text("TITLE3"),
),
],
),
),
),
],
),
),
),
To achieve the required layout, I tried using TabBarView inside different slivers i.e SliverList and SliverToBoxAdapter but they all resulted in an error because TabBarView doesn't have a predefined height.
Here is my implementation.
Because there are no method related to size, I just set a value myself.
Stack
DefaultTabController
NestedScrollView
SliverAppBar
SliverPersistentHeader
SliverPersistentHeader
TabBarView
Container // For back button
import 'package:flutter/material.dart';
import 'dart:math' as math;
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
#override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage>
with SingleTickerProviderStateMixin {
TabController _tabController;
#override
void initState() {
super.initState();
_tabController = TabController(initialIndex: 0, length: 3, vsync: this);
}
double getHeight() {
return 800;
}
#override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
extendBodyBehindAppBar: true,
body: SafeArea(
child: Stack(
children: [
DefaultTabController(
length: 3,
child: NestedScrollView(
headerSliverBuilder: (context, value) {
return [
SliverAppBar(
expandedHeight: 200.0,
flexibleSpace: FlexibleSpaceBar(),
),
SliverPersistentHeader(
pinned: true,
delegate: _SliverAppBarDelegate(
minHeight: 90,
maxHeight: 90,
child: Container(
height: getHeight() * (1 / 11),
width: double.infinity,
color: Colors.green[200],
child: Center(
child: Text(
"TEXT",
style: TextStyle(
fontSize: 32,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
),
),
),
SliverPersistentHeader(
pinned: true,
delegate: _SliverAppBarDelegate(
minHeight: 90,
maxHeight: 90,
child: Container(
color: Colors.green[200],
child: TabBar(
controller: _tabController,
tabs: [
Tab(
child: Text(
'TITLE1',
style: TextStyle(
color: Colors.black,
),
),
),
Tab(
child: Text(
'TITLE2',
style: TextStyle(color: Colors.black),
),
),
Tab(
child: Text(
'TITLE3',
style: TextStyle(color: Colors.black),
),
),
],
),
),
),
),
];
},
body: TabBarView(
controller: _tabController,
children: [
SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(bottom: 600),
child: Column(
children: [
// RoundedPicture(),
Icon(
Icons.favorite,
color: Colors.pink,
size: 150.0,
semanticLabel:
'Text to announce in accessibility modes',
),
FittedBox(
child: Text("Hello World",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 40)),
),
SizedBox(
height: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 20),
text: 'Info1: ',
children: [
TextSpan(
text: "123",
style: TextStyle(),
),
]),
),
SizedBox(
height: 20,
),
RichText(
text: TextSpan(
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 20),
text: 'Info2: ',
children: [
TextSpan(
text: "abcd",
style: TextStyle(),
),
]),
),
SizedBox(
height: 20,
),
RichText(
text: TextSpan(
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 20),
text: 'Info3: ',
children: [
TextSpan(
text: "xyz",
style: TextStyle(),
),
]),
),
],
),
],
),
),
),
SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(bottom: 600),
child: Column(
children: [
Container(
padding: EdgeInsets.only(bottom: 600),
child: Center(
child: Text("TITLE2"),
),
),
],
),
),
),
SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(bottom: 600),
child: Column(
children: [
Container(
padding: EdgeInsets.only(bottom: 600),
child: Center(
child: Text("TITLE3"),
),
),
],
),
),
),
],
),
),
),
Container(
height: 90,
padding: EdgeInsets.symmetric(horizontal: 15),
child: InkWell(
onTap: () {},
child: Icon(Icons.arrow_back),
),
),
],
),
),
);
}
}
class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
_SliverAppBarDelegate({
#required this.minHeight,
#required this.maxHeight,
#required this.child,
});
final double minHeight;
final double maxHeight;
final Widget child;
#override
double get minExtent => minHeight;
#override
double get maxExtent => math.max(maxHeight, minHeight);
#override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return SizedBox.expand(child: child);
}
#override
bool shouldRebuild(_SliverAppBarDelegate oldDelegate) {
return maxHeight != oldDelegate.maxHeight ||
minHeight != oldDelegate.minHeight ||
child != oldDelegate.child;
}
}
After finding no possible solution, I decided to implement my own tab bar view instead of using the default one. The solution isn't as fancy since the transition of tabs is done by changing the current page number and rebuilding the widget but solves the issue. I used a gesture detector for allowing users to swipe the page.
GestureDetector(
onHorizontalDragEnd: (dragDetails) {
if (dragDetails.primaryVelocity != 0) {
final int val = dragDetails.primaryVelocity.sign.toInt();
if (currentPage - val >= 0 &&
currentPage - val < tabController.length)
tabController.animateTo(currentPage - val);
}
},
child: CustomScrollView(
shrinkWrap: true,
controller: scrollController,
slivers: [
SliverToBoxAdapter(
child: LogoContainer(),
),
SliverStickyHeader(
header: Column(
children: [
NameContainer(text: 'TEXT'),
Container(
height: 60,
color: kSecondaryColor,
child: TabBar(
controller: tabController,
tabs: [
Tab(
child: Text(
'TITLE1',
style: TextStyle(color: Colors.black),
),
),
Tab(
child: Text(
'TITLE2',
style: TextStyle(color: Colors.black),
),
),
Tab(
child: Text(
'TITLE3',
style: TextStyle(color: Colors.black),
),
),
],
),
),
],
),
sliver: SliverToBoxAdapter(
child: ConstrainedBox(
constraints:
BoxConstraints(minHeight: getHeight() * (6 / 11)),
child: [
Column(
children: [
RoundedPicture(),
FittedBox(
child: Text(
'HELLO WORLD',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 40),
),
),
SizedBox(
height: getProportionateScreenHeight(20),
),
Column(
children: [
ProfileInfoText(
title: 'INFO1',
text: 'abcd',
),
SizedBox(
height: getProportionateScreenHeight(20),
),
ProfileInfoText(
title: 'INFO2',
text: '123',
),
SizedBox(
height: getProportionateScreenHeight(20),
),
ProfileInfoText(
title: 'INFO3',
text: 'xyz',
),
],
),
],
),
Center(
child: Text("TITLE2"),
),
Center(
child: Text("TITLE3"),
),
].elementAt(currentPage),
),
),
),
],
),
),
I also used scroll controller to animate the list back to top when changing the tabs to give it a smooth look.
#override
void initState() {
super.initState();
tabController = TabController(length: 3, vsync: this)
..addListener(() async {
await scrollController.animateTo(
0,
duration: Duration(seconds: 1),
curve: Curves.ease,
);
setState(() {
currentPage = tabController.index;
});
});
}

how to reduce height of Tab Bar in flutter

I am using Scaffold to show my bottom tab navigator, but it shows too high, is there a way to reduce size of height in my Tab Bar. here is the code
Scaffold(
bottomNavigationBar: Material(
child: new TabBar(
tabs: <Widget>[
Tab(icon: Icon(Icons.home),text: 'Home'),
Tab(icon: Icon(Icons.settings),text: 'Settings')
],
labelColor: Colors.blue,
unselectedLabelColor: Colors.grey,
),
),
body: TabBarView(
children: [
MainScreen(),
FirstPage(),
],
),
)
You can wrap the child: new TabBar() in a container. And also change height of icon and text.
import 'package:flutter/material.dart';
class MyButtomTabBar extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
home: DefaultTabController(
length: 2,
child: Scaffold(
bottomNavigationBar: Material(
child: Container(
height: 40,
child: new TabBar(
tabs: <Widget>[
Tab(
icon: Icon(
Icons.home,
size: 15,
),
child: Text(
'Home',
style: TextStyle(fontSize: 10),
),
),
Tab(
icon: Icon(
Icons.settings,
size: 15,
),
child: Text(
'Settings',
style: TextStyle(fontSize: 10),
),
),
],
labelColor: Colors.blue,
unselectedLabelColor: Colors.grey,
),
),
),
),
),
);
}
}

How to change tab bar highlighted color

Note:
Solution from stackoverflow about this question not solved my issue
My full code
import 'package:flutter/material.dart';
class BookingHistory extends StatefulWidget {
BookingHistory({Key key}) : super(key: key);
#override
_BookingHistoryState createState() => _BookingHistoryState();
}
class _BookingHistoryState extends State<BookingHistory> {
#override
Widget build(BuildContext context) {
return MaterialApp(
home: DefaultTabController(
length: 3,
child: Scaffold(
// backgroundColor: Colors.white,
appBar: AppBar(
flexibleSpace: Container(
color: Colors.green,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
TabBar(indicatorColor: Colors.blue,
labelColor: Colors.red,
unselectedLabelColor: Colors.green,
tabs: [
Tab(
child: Text(
"Completed",
style: TextStyle(color: Colors.white),
),
),
Tab(
child: Text(
"Requested",
style: TextStyle(color: Colors.white),
),
),
Tab(
child: Text(
"Accepted",
style: TextStyle(color: Colors.white),
),
)
])
],
),
),
),
body: TabBarView(children: [
Container(
child: Center(
child: Text("i am tab 1"),
),
),
Container(
child: Center(
child: Text("i am tab 2"),
),
),
Container(
child: Center(
child: Text("i am tab 3"),
),
)
]),
)),
);
}
}
Answer
To make effecting indicatorColor,labelColor or unselectedLabelColor we need wrap Widget with Material Widget(Solution suggested by Ravinder Kumar) or if we need only to change indicatorColor color then use indicatorColor: Colors.blueAccent color with ending with name Accent (Solution suggested by Amazing Aidan)
Bizarrely, changing the code to
indicatorColor: Colors.blueAccent
works but not Colors.blue
Wrap your TabBar inside Material widget,
Material(
color: Colors.green,
child:
TabBar(
indicatorColor: Colors.red,
labelColor: Colors.red,
unselectedLabelColor: Colors.green,
.....
Output:
Complete Code
class BookingHistory extends StatefulWidget {
BookingHistory({Key key}) : super(key: key);
#override
_BookingHistoryState createState() => _BookingHistoryState();
}
class _BookingHistoryState extends State<BookingHistory> {
#override
Widget build(BuildContext context) {
return MaterialApp(
home: DefaultTabController(
length: 3,
child: Scaffold(
// backgroundColor: Colors.white,
appBar: AppBar(
flexibleSpace: Container(
color: Colors.green,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Material(
color: Colors.green,
child:
TabBar(
indicatorColor: Colors.red,
labelColor: Colors.red,
unselectedLabelColor: Colors.green,
tabs: [
Tab(
child: Text(
"Completed",
style: TextStyle(color: Colors.white),
),
),
Tab(
child: Text(
"Requested",
style: TextStyle(color: Colors.white),
),
),
Tab(
child: Text(
"Accepted",
style: TextStyle(color: Colors.white),
),
)
]))
],
),
),
),
body: TabBarView(children: [
Container(
child: Center(
child: Text("i am tab 1"),
),
),
Container(
child: Center(
child: Text("i am tab 2"),
),
),
Container(
child: Center(
child: Text("i am tab 3"),
),
)
]),
)),
);
}
}
UPDATE: strangely any colors other than seems to work, for example use indicatorColor: Colors.black,
The Container in the AppBar is unncessary, instead directly set backgroundColor: Colors.green in AppBar.
And in the TabBar set indicatorColor, labelColor, unselectedLabelColor properly.
In each Tab you don't need to specify TextStyle. It will override labelColor and unselectedLabelColor from the TabBar.
AppBar(
backgroundColor: Colors.green,
flexibleSpace: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
TabBar(
indicatorColor: Colors.white,
labelColor: Colors.white,
unselectedLabelColor: Colors.white70,
tabs: [
Tab(child: Text("Completed")),
Tab(child: Text("Requested")),
Tab(child: Text("Accepted"))
])
],
),
)

How to make a container with tabview & listview occupy space upto bottom

I have implemented tab layout which consists of two tabs, each tab view has a listview, container with tabview & listview should occupy space upto bottom as of now i place static value of 400, so only up to 400 the listview appears, i need the list view to be appeared up to bottom. can you please me to fix this
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left:20.0,right:20.0),
child: Container(
color: Colors.white,
child: new TabBar(
controller: _controller,
labelColor: Colors.deepOrange,
tabs: [
new Tab(
icon: const Icon(Icons.description),
text: 'ABC',
),
new Tab(
icon: const Icon(Icons.assignment),
text: 'XYZ',
),
],
),
),
),
Padding(
padding: const EdgeInsets.only(left:20.0,right:20.0),
child: Container(
color: Colors.white,
height: 400.0,
child: new TabBarView(
controller: _controller,
children: <Widget>[
ListView(
children: <Widget>[
ListTile(
title: Text('Sun'),
),
ListTile(
title: Text('Moon'),
),
ListTile(
title: Text('Star'),
),
],
),
ListView(
children: <Widget>[
ListTile(
title: Text('Sun'),
),
ListTile(
title: Text('Moon'),
),
ListTile(
title: Text('Star'),
),
],
),
],
),
),
),
],
),
);
}
I have Used Expanded & Flex Widgets which solved the problem
#override
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
Expanded(
child: Padding(
padding: const EdgeInsets.only(left:20.0,right:20.0),
child: Container(
color: Colors.white,
child: new TabBar(
controller: _controller,
labelColor: Colors.deepOrange,
tabs: [
new Tab(
icon: const Icon(Icons.description),
text: 'Current Openings',
),
new Tab(
icon: const Icon(Icons.assignment),
text: 'Applied Jobs',
),
],
),
),
),
flex: 1,
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(left:20.0,right:20.0,bottom: 10.0),
child: Container(
color: Colors.white,
child: new TabBarView(
controller: _controller,
children: <Widget>[
ListView(
children: <Widget>[
ListTile(
title: Text('Sun'),
),
],
),
ListView(
children: <Widget>[
ListTile(
title: Text('Sun'),
),
],
),
],
),
),
),
flex: 9,
),
],
),
);
}