Flutter:AppBar底部重叠AppBar ToolBar

问题描述 投票:0回答:1

我创建了一个自定义 AppBar 小部件类以在整个项目中共享。但是,当我尝试为底部属性传递 TabBar 时,它往往会重叠或缩小我的工具栏大小。

这是我的自定义 AppBar 小部件类的代码:

class CustomAppBar extends StatefulWidget implements PreferredSizeWidget {
  final String title;
  final Widget? leading;
  final List<Widget>? actions;
  final PreferredSizeWidget? bottom;

  const CustomAppBar(this.title,
      {this.leading, this.actions, this.bottom, super.key});

  @override
  Size get preferredSize => const Size.fromHeight(kToolbarHeight);

  @override
  State<CustomAppBar> createState() => _CustomAppBarState();
}

class _CustomAppBarState extends State<CustomAppBar> {
  @override
  Widget build(BuildContext context) {
    return AppBar(
        title: Text(widget.title),
        centerTitle: true,
        elevation: 0,
        leading: widget.leading,
        actions: widget.actions,
        bottom: widget.bottom);
  }
}

我尝试设置应用程序栏的工具栏高度,但没有任何变化

flutter tabbar appbar
1个回答
-1
投票

收听来自印度的在线广播电台所有印度语言广播的最大集合,हिंदी,தமிழ்,मराठी,తెలుగు,ಕನ್ನಡ,ગુજ રાતી、മലയാളം、ଓଡିଆ、ਪੰਜਾਬੀ、বাংলা等。访问在此处输入链接描述

© www.soinside.com 2019 - 2024. All rights reserved.