sp method
Scale font size proportionally to design reference with optional clamp.
Text('Hello', style: TextStyle(fontSize: context.sp(16)))
Text('Hello', style: TextStyle(fontSize: context.sp(16, min: 12, max: 24)))
Implementation
double sp(double size, {double? min, double? max}) {
final scaled = r(size);
if (min != null && scaled < min) return min;
if (max != null && scaled > max) return max;
return scaled;
}