getMaxWidth static method

double getMaxWidth(
  1. String sizes, {
  2. required BuildContext context,
  3. bool isOffset = false,
  4. double? width,
})

Returns what is the current prefix based on width

Implementation

static double getMaxWidth(String sizes,
    {required BuildContext context, bool isOffset = false, double? width}) {
  double maxWidth = width ?? context.width;
  Map<String, int> sizeMap = isOffset
      ? getAllOffsetsValue(
          sizes,
        )
      : getAllColValues(sizes);
  String getCurrentPrefix = getPrefixByWidth(maxWidth);
  if (isOffset) {
    return maxWidth * ((sizeMap[getCurrentPrefix] ?? 0.0) / 12);
  } else {
    return maxWidth * ((sizeMap[getCurrentPrefix] ?? 1.0) / 12);
  }
}