popupFontWeight function

FontWeight? popupFontWeight(
  1. Object? w
)

weight 100..900 → FontWeight.

Implementation

FontWeight? popupFontWeight(Object? w) {
  if (w is! num) return null;
  final i = (w / 100).round().clamp(1, 9) - 1;
  return FontWeight.values[i];
}