fromString static method
Creates a WidgetSize from a string value.
Returns null if the string doesn't match any enum value.
Implementation
static WidgetSize? fromString(String? value) {
if (value == null) return null;
switch (value.toLowerCase()) {
case 'small':
return WidgetSize.small;
case 'medium':
return WidgetSize.medium;
case 'large':
return WidgetSize.large;
default:
return null;
}
}