I have a Column
with an Image and below it a DefaultTabController
. The TabBar basically does not display the tabs, but the children of the TabBarView
are displayed.
That's the error:
Null check operator used on a null value The relevant error-causing widget was TabBar lib/…/screens/specific_launch.dart:132 The following RenderObject was being processed when the exception was fired: RenderCustomPaint#83c8d relayoutBoundary=up10 RenderObject: RenderCustomPaint#83c8d relayoutBoundary=up10 parentData: offset=Offset(0.0, 0.0); flex=null; fit=null (can use size) constraints: BoxConstraints(0.0<=w<=336.0, 0.0<=h<=Infinity) size: Size(336.0, 100000.0) child: RenderErrorBox#daadf NEEDS-PAINT parentData: (can use size) constraints: BoxConstraints(0.0<=w<=336.0, 0.0<=h<=Infinity) size: Size(336.0, 100000.0)
That's the code:
return Scaffold(
appBar: AppBar(
title: Text(
'Launch',
style: GoogleFonts.poppins(fontWeight: FontWeight.w600),
),
actions: [
IconButton(icon: Icon(Icons.share_outlined), onPressed: () {})
],
),
body: Padding(
padding: EdgeInsets.only(
top: getHeight(context) / 30.0,
left: getWidth(context) / 30.0,
right: getWidth(context) / 30.0),
child: Column(
children: [
// ...first child
SizedBox(
width: getWidth(context),
height: getHeight(context),
child: DefaultTabController(
length: 3,
initialIndex: 0,
child: Scaffold(
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(
text: 'State',
),
Tab(
text: 'Mission',
),
Tab(
text: 'Rocket',
)
],
),
),
body: TabBarView(
children: [
Text(
'Tab 1',
),
Text('Tab 2'),
Text('Tab 3')
],
),
)),
)
],
),
));
That's the result I'm trying to achieve:
Scaffold
widgets? - Riwen