TitleBar.imTitle constructor

TitleBar.imTitle({
  1. String? title,
  2. TextStyle textStyle = const TextStyle(fontSize: 22.0, color: Color(0xFF1B72EC)),
  3. dynamic result,
  4. double height = 56.0,
  5. double elevation = 0.0,
  6. Color? shadowColor,
  7. Color backgroundColor = Colors.white,
  8. dynamic onSearch()?,
  9. List<PopMenuInfo> menus = const [],
})

Implementation

TitleBar.imTitle({
  String? title,
  TextStyle textStyle = const TextStyle(
    fontSize: 22.0,
    color: Color(0xFF1B72EC),
  ),
  dynamic result,
  double height = 56.0,
  double elevation = 0.0,
  Color? shadowColor,
  Color backgroundColor = Colors.white,
  Function()? onSearch,
  List<PopMenuInfo> menus = const [],
})  : result = result,
      height = height,
      elevation = elevation,
      backgroundColor = backgroundColor,
      shadowColor = shadowColor,
      onBack = null,
      center = null,
      right = Container(
        padding: EdgeInsets.only(right: 12),
        child: Row(
          mainAxisSize: MainAxisSize.min,
          children: [
            Visibility(
              visible: null != onSearch,
              child: GestureDetector(
                onTap: onSearch,
                behavior: HitTestBehavior.translucent,
                child: Container(
                  padding: EdgeInsets.only(left: 10, right: 10),
                  child: ImageUtil.search(),
                ),
              ),
            ),
            Visibility(
              visible: menus.length > 0,
              child: PopButton(
                menus: menus,
                child: Container(
                  padding: EdgeInsets.only(left: 10, right: 10),
                  child: ImageUtil.add(),
                ),
              ),
            ),
          ],
        ),
      ),
      left = Container(
        padding: EdgeInsets.symmetric(horizontal: 22),
        child: Text(
          title ?? '',
          style: textStyle,
        ),
      );