getPadding static method

EdgeInsetsGeometry getPadding(
  1. int index,
  2. int total
)

Returns the standard padding for a button at index out of a total number of buttons.

Standard Material TextSelectionToolbars have buttons with different padding depending on their position in the toolbar.

Implementation

static EdgeInsetsGeometry getPadding(int index, int total) {
  assert(total > 0 && index >= 0 && index < total);
  final _TextSelectionToolbarItemPosition position = _getPosition(index, total);
  return EdgeInsetsDirectional.only(
    start: _getStartPadding(position),
    end: _getEndPadding(position),
  );
}