Toolbar constructor

Toolbar({
  1. Key? key,
  2. String titleStr = '',
  3. double height = 48,
  4. bool showBack = true,
  5. PreferredSizeWidget? bottom,
  6. List<Widget> actions = const [],
  7. Function? backButtonAction,
  8. Color? backgroundColor = FXColor.main_white,
  9. int fontWeightDelta = 0,
  10. Color? titleColor = FXColor.main_black1,
  11. bool isWhite = false,
})

Implementation

Toolbar(
    {Key? key,
    this.titleStr = '',
    this.height = 48,
    this.showBack = true,
    this.bottom,
    this.actions = const [],
    this.backButtonAction,
    this.backgroundColor = FXColor.main_white,
    this.fontWeightDelta = 0,
    this.titleColor = FXColor.main_black1,
    this.isWhite = false})
    : super(
          key: key,
          centerTitle: true,
          toolbarHeight: height,
          elevation: 0,
          backgroundColor: backgroundColor,
          title: CenterText(titleStr,
              style: CenterText.title_black.apply(color: titleColor, fontWeightDelta: fontWeightDelta)),
          actions: actions,
          leading: showBack
              ? Builder(builder: (context) {
                  return IconButton(
                      splashColor: Colors.transparent,
                      highlightColor: Colors.transparent,
                      padding: const EdgeInsets.all(6),
                      icon: ImageIcon(AssetImage(ImageUtil.imageFullName('images/icon_back.png')),
                          color: isWhite ? FXColor.main_white : FXColor.black),
                      onPressed: () {
                        backButtonAction?.call();
                        Navigator.maybePop(context);
                      });
                })
              : null,
          bottom: bottom);