When ever I run the following code, I receive the error: A RenderFlex overflowed by 99523 pixels on the bottom.
. I have tried various fixes to error like putting expanded widgets as children of the TabView and other combinations but none seems to work. I am trying to achieve the picture below. I have seen various solutions where the TabView widget is wrapped in an expanded widget but nothing is working.
below is my current code.
class Discover extends StatefulWidget {
@override
_DiscoverState createState() => _DiscoverState();
}
class _DiscoverState extends State<Discover> {
final _auth = FirebaseAuth.instance;
String request;
FirebaseUser loggedInUser;
@override
void initState() {
// TODO: implement initState
super.initState();
getCurrentUser();
}
void getCurrentUser () async {
try{
final user = await _auth.currentUser();
if (user != null){
loggedInUser = user;
print(loggedInUser.email);
}
} catch (e){
print(e);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: kSnow,//Color(0xffDCE3E5),
appBar: AppBar(
backgroundColor: kSnow,
leading: IconButton(
icon: Icon(Icons.menu),
iconSize: 30.0,
color: kOnyx,
onPressed: () {},
),
elevation: 0.0,
actions: <Widget>[
FlatButton.icon(
icon: Icon(
Icons.person,
color: kOnyx,
size: 30.0,
),
label: Text('Log Out'),
onPressed: () {
_auth.signOut();
Navigator.push(context, MaterialPageRoute(builder: (context) => Authentication()));
},
),
],
),
body: Column(
children: <Widget>[
Container(
color: kSnow,
padding: EdgeInsets.only(left: 15.0, top: 15.0, bottom: 30.0),
child: FractionallySizedBox(
widthFactor: 1.0,
child: Text(
'DISCOVER',
style: TextStyle(
color: kOnyx,
fontSize: 30.0,
//fontWeight: FontWeight.w600,
fontFamily: 'Baukasten'),
),
),
),
DefaultTabController(
length: 4,
child: Column(
children: <Widget>[
TabBar(
isScrollable: true,
labelColor: kOnyx,
unselectedLabelColor: kFossil,
indicatorSize: TabBarIndicatorSize.label,
indicator: BoxDecoration(
color: kSnow),
tabs: [Tab(text: 'HOME'), Tab(text: 'CREATE'), Tab(text: 'PROFILE'), Tab(text: 'SETTINGS')],
indicatorColor: kOnyx,
labelStyle: TextStyle(
//ntSize: 10.0,
fontFamily: 'Baukasten'
),
),
TabBarView(
children: <Widget>[
Text('hello'),
Text('hello'),
Text('hello'),
Text('hello')
],
)
],
),
),
//Container(height: 45, color: kOnyx,),
],
),
);
}
}