Rom*_*ine 17 android-appbarlayout flutter flutter-appbar
我遇到了一些问题。我想制作一个图像、一个文本和两个图标,AppBar
但我不能让它按我想要的方式工作。
我试图在图像和文本之后连续制作一些字体。图像和文本成功显示在 my 中AppBar
,但其余 2 种字体(手推车和通知)显示一些错误。
Widget build(BuildContext context) {
return new Scaffold(
backgroundColor: Colors.amber,
appBar: new AppBar
(
title: new Row
(
mainAxisAlignment: MainAxisAlignment.start,
children:
[
Image.asset('images/logoapp.png',fit: BoxFit.contain,height: 32,),
Container(padding: const EdgeInsets.all(8.0), child: Text('Solid Shop'))
],
)
),
Run Code Online (Sandbox Code Playgroud)
....
Tir*_*tel 35
用于leading
在 appBar 标题之前设置一个小部件,并actions
用于指定 appBar 中出现在 appBar 标题右侧的小部件列表。
AppBar(
leading: Image.asset('yourImage'), // you can put Icon as well, it accepts any widget.
title: Text ("Your Title"),
actions: [
Icon(Icons.add),
Icon(Icons.add),
],
);
Run Code Online (Sandbox Code Playgroud)
在此处阅读更多相关信息
Cop*_*oad 10
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Solid Shop"),
leading: Image.asset("your_image_asset"),
actions: <Widget>[
IconButton(icon: Icon(Icons.shopping_cart), onPressed: () {}),
IconButton(icon: Icon(Icons.message), onPressed: () {}),
],
),
);
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
26532 次 |
最近记录: |