【发布时间】:2021-04-21 21:34:47
【问题描述】:
【问题讨论】:
-
你好,你有没有试过解决问题,你有代码sn-p吗?还是您希望从这里得到答案?
-
@SARANSURYA 大多数在问答网站上提问的人通常都希望得到答案,是的。毕竟,这就是重点。
【问题讨论】:
Make your own custom app bar.
Here I have included both the texts as desired in your case. You can customize more
according to your design.
class CustomAppBar extends PreferredSize {
final String text1;
final String text2;
final double preferredSize;
CustomAppBar({
this.text1,
this.text2,
this.preferredSize
});
@override
final Size preferredSize;
@override
Widget build(BuildContext context) {
return Container(
height: preferredSize.height,
color: Colors.orange,
alignment: Alignment.center,
child: Row(
children:[
Text(text1),
Text(text2)
]),
);
}
}
【讨论】:
查看作为 AppBar 小部件一部分的 TabBar 小部件。
【讨论】: