flutter实现自定义头部导航公共组件
代码实现
class CustomAppBar extends AppBar {
final Color color;
final String titleText;
final List<Widget> actions;
final PreferredSizeWidget bottom;
final double toolbarHeight;
CustomAppBar(
{this.titleText,
this.color,
this.actions,
this.bottom,
this.toolbarHeight})
: super(
title: Text(
titleText ?? '',
style: TextStyle(fontSize: 16.0),
),
backgroundColor: color ?? CustomColor.loginForm,
centerTitle: true,
actions: actions ?? [Container()],
bottom: bottom,
);
}
版权声明:本文为my_love_download原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。