resolveWidth static method

double? resolveWidth(
  1. BuildContext context,
  2. FlyStyle style
)

Resolves width from FlyStyle and FlyTheme into double

Implementation

static double? resolveWidth(BuildContext context, FlyStyle style) {
  if (style.w == null) return null;

  // Check if it's an intrinsic width keyword first
  final intrinsicWidth = FlyValue.resolveIntrinsicWidth(style.w);
  if (intrinsicWidth != null) {
    return null; // Intrinsic width is handled separately
  }

  try {
    final spacing = FlyTheme.of(context).spacing;
    return _resolveValue(style.w, context, spacing);
  } catch (e) {
    throw ArgumentError('Failed to resolve width: $e');
  }
}