show static method

void show(
  1. List<ActionSheetModel> list,
  2. dynamic clickBlock(
    1. ActionSheetModel
    )
)

Implementation

static void show(List<ActionSheetModel> list, Function(ActionSheetModel) clickBlock) {
  double bottomHeight = MediaQuery.of(Global.appContext()).padding.bottom;
  double actionSheetHeight = list.fold(0.0, (sum, item) => sum + item.cellHeight);
  debugPrint("showActionSheet:$actionSheetHeight");
  showModalBottomSheet(
    context: Global.appContext(),
    builder: (context) => Container(
      decoration: const BoxDecoration(
        borderRadius: BorderRadius.only(
          topLeft: Radius.circular(20),
          topRight: Radius.circular(20),
        ),
        color: LivekitColors.livekitDesignStandardG2,
      ),
      height: actionSheetHeight + bottomHeight,
      child: ListView.builder(
        itemCount: list.length,
        itemBuilder: (context, index) {
          return _buildCell(list[index], clickBlock);
        },
      ),
    ),
  );
}