ActionBar constructor

ActionBar({
  1. required List<ActionItem> data,
  2. int itemLimit = item_max,
  3. required OnActionTap onActionTap,
})

Implementation

ActionBar(
    {required this.data,
    this.itemLimit = item_max,
    required this.onActionTap}) {
  if (data.length > itemLimit) {
    normalItems = data.getRange(0, itemLimit - 1).toList();
    normalItems.add(ActionItem("more", "更多", Icons.more_horiz));
    otherItems =
        data.getRange(itemLimit - 1, data.length).toList().reversed.toList();
  } else {
    normalItems = data;
  }
}