TxButtonBar.more constructor

TxButtonBar.more({
  1. required Widget mainButton,
  2. required List<PopupMenuEntry> menus,
  3. Key? key,
  4. Widget? secondaryButton,
  5. List<Widget>? actions,
  6. EdgeInsetsGeometry? buttonPadding,
  7. ButtonTextTheme? buttonTextTheme,
  8. double? buttonHeight,
  9. double? buttonMinWidth,
  10. ButtonBarLayoutBehavior? layoutBehavior,
  11. bool? buttonAlignedDropdown,
})

创建一个包含PopupMenuButton的操作按钮栏,一般用于操作比较多的情况

Implementation

TxButtonBar.more({
  required this.mainButton,
  required List<PopupMenuEntry> menus,
  super.key,
  this.secondaryButton,
  List<Widget>? actions,
  this.buttonPadding,
  this.buttonTextTheme,
  this.buttonHeight,
  this.buttonMinWidth,
  this.layoutBehavior,
  this.buttonAlignedDropdown,
})  : assert(menus.isNotEmpty),
      actions = [
        PopupMenuButton(
          itemBuilder: (context) {
            return <PopupMenuEntry>[
              for (int i = 0; i < menus.length; i++) ...[
                menus[i],
                if (i != menus.length - 1) const PopupMenuDivider(),
              ]
            ];
          },
          icon: const Icon(Icons.more_horiz),
        ),
        ...?actions,
      ];