getOpenTarget method

double? getOpenTarget(
  1. ActionPosition position
)

calculate the target ratio when we want to open the panel at position if there is no SlideActionPanel at position, return null

Implementation

double? getOpenTarget(ActionPosition position) {
  if (position == ActionPosition.pre && !hasPreAction) {
    return null;
  } else if (position == ActionPosition.post && !hasPostAction) {
    return null;
  }

  return switch (position) {
    ActionPosition.pre => 1,
    ActionPosition.post => -1,
  };
}