resolve static method

TextStyle? resolve(
  1. BuildContext context,
  2. FlyStyle style
)

Resolves text style from FlyStyle and FlyThemeData into TextStyle

Implementation

static TextStyle? resolve(BuildContext context, FlyStyle style) {
  if (style.text == null) return null;

  // If it's already a TextStyle, return it directly
  if (style.text is TextStyle) {
    return style.text as TextStyle;
  }

  // Otherwise, resolve as token
  try {
    final textStyles = FlyTheme.of(context).textStyle;
    return textStyles[style.text];
  } catch (e) {
    throw ArgumentError('Failed to resolve text style "${style.text}": $e');
  }
}