getStyle method

WidgetStyle? getStyle(
  1. WidgetStyleType type
)

Gets a style by type.

Returns a WidgetStyle instance for the given type. Returns null if the style type is not supported or not found.

Implementation

WidgetStyle? getStyle(WidgetStyleType type) {
  switch (type) {
    case WidgetStyleType.liquidGlass:
      final styleConfig = config.getStyle('liquidGlass');
      if (styleConfig == null) return null;
      if (styleConfig is LiquidGlassStyleConfig) {
        return LiquidGlassStyle(config: styleConfig);
      }
      return null;
  }
}