validation/input_shaping_utils library
Input shaping: clamp/normalize numbers, trim/limit strings — roadmap #696.
Functions
-
clampNumber(
{required num value, required num min, required num max, bool isInt = false}) → num -
Clamps
valuetomin, max, then returns as int ifisIntelse double. Audited: 2026-06-12 11:26 EDT -
shapeString(
String s, {int? maxLength, String ellipsis = '...'}) → String -
Trims
sand truncates to at mostmaxLengthcharacters with optionalellipsis. The result never exceedsmaxLength. Audited: 2026-06-12 11:26 EDT