我正在尝试做,但是我不知道怎么做
我想摆脱绿色空间。 我正在尝试使用PreferedSize小部件,但是它不起作用,我的代码是...
@override
Widget build(BuildContext context) {
return SafeArea(
child: PreferredSize(
preferredSize: Size.fromHeight(SizeConfig.heightMultiplier * 6.2),
// it's pretty narrow size but doesn't work in this screen but others
child: Scaffold(
appBar: AppBar(
centerTitle: true,
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'hello',
style: TextStyle(fontWeight: FontWeight.bold),
),
Text(
'world',
),
Text(
'!',
style: TextStyle(fontWeight: FontWeight.bold),
),
],
),
actions: <Widget>[
Icon(
Icons.add,
color: Colors.transparent,
),
],
backgroundColor: Theme.of(context).primaryColor,
bottom: TabBar(
controller: tabController,
indicatorColor: Colors.white,
tabs: myTabs,
),
),
...
我需要你的帮助☑
答案 0 :(得分:1)
用高度为0(或较小高度)的TabBar
小部件包裹PreferredSize
:
bottom: PreferredSize(
preferredSize: Size.fromHeight(0),
child: TabBar(
controller: tabController,
indicatorColor: Colors.white,
tabs: myTabs,
),
),