newLayer function
Creates a new Layer from a String or Drawable.
Throws an ArgumentError if content is neither.
Implementation
Layer newLayer(Object content, [List<Layer> layers = const []]) {
if (content is Drawable) {
return Layer(content, layers);
} else if (content is String) {
return Layer(StyledString(content), layers);
} else {
throw ArgumentError('content must be a String or Drawable');
}
}