extentRatio method

double extentRatio(
  1. BuildContext context
)

获取有效的侧滑按钮数量(限制在1-3个之间)

Implementation

double extentRatio(BuildContext context) {
  if (actions.isEmpty) {
    return 0;
  }
  final screenWidth = MediaQuery.of(context).size.width;
  final actionWidth = actions.length * slideItemSize;
  return actionWidth / screenWidth;
}