estimateExtent static method

double estimateExtent(
  1. FPickerStyle style,
  2. BuildContext context
)

Estimates the extent of each item in the picker based on the given style and context.

Implementation

static double estimateExtent(FPickerStyle style, BuildContext context) {
  final defaultTextStyle = DefaultTextStyle.of(context);
  final scale = MediaQuery.textScalerOf(context);

  final height = style.textStyle.height ?? defaultTextStyle.style.height;
  final fontSize = style.textStyle.fontSize ?? defaultTextStyle.style.fontSize ?? 0;
  return scale.scale(height == null ? fontSize : height * fontSize);
}