Flutter 如何删除Appbar下面的小行?
颤振1.12.13+修补程序8 在Appbar的正下方有一条细线。你知道怎么摆脱它吗 代码:Flutter 如何删除Appbar下面的小行?,flutter,Flutter,颤振1.12.13+修补程序8 在Appbar的正下方有一条细线。你知道怎么摆脱它吗 代码: 返回脚手架( 背景颜色:Colors.white, appBar:appBar( 背景颜色:Colors.blue, 标高:0.0, 行动:[ 扁平按钮( onPressed:()异步{ 等待_authService.signOut(); }, 子:图标( Icons.exit_to_应用程序, 颜色:颜色,白色, ), ), ], ), 主体:容器( 高度:MediaQuery.of(context
返回脚手架(
背景颜色:Colors.white,
appBar:appBar(
背景颜色:Colors.blue,
标高:0.0,
行动:[
扁平按钮(
onPressed:()异步{
等待_authService.signOut();
},
子:图标(
Icons.exit_to_应用程序,
颜色:颜色,白色,
),
),
],
),
主体:容器(
高度:MediaQuery.of(context).size.height,
宽度:MediaQuery.of(context).size.width,
颜色:颜色。蓝色),
);
我在网络、iphone模拟器、android模拟器和我的android手机上试过你的代码,但都没有白细线。我现在正在进行颤振测试。也许您的问题可以通过升级颤振或切换频道来解决。将脚手架背景颜色指定为与AppBar backgroundColor解决问题的颜色相同的颜色(在您的情况下,以下代码)
若要为应用程序的其余部分提供所需的颜色,您可以在封装主体的容器的主体颜色中使用该颜色
return Scaffold(
backgroundColor: Colors.blue,//changed background color of scaffold
appBar: AppBar(
backgroundColor: Colors.blue,
elevation: 0.0,
actions: <Widget>[
FlatButton(
onPressed: () async {
await _authService.signOut();
},
child: Icon(
Icons.exit_to_app,
color: Colors.white,
),
),
],
),
body: Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
color: Colors.blue),
);
返回脚手架(
backgroundColor:Colors.blue,//改变了脚手架的背景色
appBar:appBar(
背景颜色:Colors.blue,
标高:0.0,
行动:[
扁平按钮(
onPressed:()异步{
等待_authService.signOut();
},
子:图标(
Icons.exit_to_应用程序,
颜色:颜色,白色,
),
),
],
),
主体:容器(
高度:MediaQuery.of(context).size.height,
宽度:MediaQuery.of(context).size.width,
颜色:颜色。蓝色),
);
我尝试了你的代码,但没有按照你说的得到任何行,你能分享你的完整代码吗?@HardikTalaviya,刚刚从“body”中添加了容器代码。顺便说一句,我在安卓系统上,直接在设备上(不是模拟器),我使用的是1.12.13+修补程序.8版本。
return Scaffold(
backgroundColor: Colors.blue,//changed background color of scaffold
appBar: AppBar(
backgroundColor: Colors.blue,
elevation: 0.0,
actions: <Widget>[
FlatButton(
onPressed: () async {
await _authService.signOut();
},
child: Icon(
Icons.exit_to_app,
color: Colors.white,
),
),
],
),
body: Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
color: Colors.blue),
);