YAppBarWidget function

Stack YAppBarWidget({
  1. String? title,
  2. Widget? leftWidget,
  3. dynamic onLeftClick()?,
  4. Widget? rightWidget,
  5. dynamic onRightClick()?,
  6. Widget? leftContainer,
  7. Widget? rightContainer,
  8. Widget? centerContainer,
})

导航条组件

Implementation

Stack YAppBarWidget({String? title, Widget? leftWidget, Function()? onLeftClick, Widget? rightWidget, Function()? onRightClick, Widget? leftContainer, Widget? rightContainer, Widget? centerContainer}) {
  return Stack(children: <Widget>[
    Row(children: <Widget>[
      leftContainer ?? SizedBox(width: yNavBarHeight(), height: yNavBarHeight(), child: _YFlatButton(leftWidget, onClick: () => onLeftClick!())),
      Expanded(child: Container()),
      rightContainer ?? SizedBox(width: yNavBarHeight(), height: yNavBarHeight(), child: _YFlatButton(rightWidget, onClick: () => onRightClick!())),
    ]),
    Row(children: <Widget>[centerContainer == null ? YTitleWidget(title) : Expanded(child: Center(child: centerContainer))]),
  ]);
}