Panel.forContent constructor
Create a Panel that is sized for the given content width
and height
,
taking the given padding
into consideration. The resulting panel will be
positioned at (0, 0), so use a child Terminal to render it at the
desired location.
Implementation
factory Panel.forContent(int width, int height,
{Color? background, int padding = 0}) {
var bounds =
Rect(Vec2(0, 0), Vec2(width + (padding * 2), height + (padding * 2)));
return Panel(bounds, background: background, padding: padding);
}