代码:

Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('搜索条'),
actions: <Widget>[//导航条右方 类似rightBarItem
IconButton(
icon: Icon(Icons.search),
onPressed: (){
print('点击了搜索');
},
)
],
 
),
);
}
总结:
 

//导航栏上的搜索条

AppBar(

actions:<widget>{//类似于OC的rightBarItem

IconButton(

icon:Icon(Icons.xx)

Onpress(){

print(‘xxx’)//控制台输出

}

)

 

}

 

)

相关文章:

  • 2021-07-25
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
猜你喜欢
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案