Fitted Row

FittedRow (deprecated)

This widget is deprecated. Please use FlexRow instead.

Stretch to fit the parent (the parent is required to have a predetermined width), then distribute the horizontal spaces evenly among its children. You can override the space distribution via 'childrenFits' attribute.

Test in Kitchen Sink (opens in a new tab)

Properties

PropertyTypeDescription
childrenarrayList of widgets
onTapactionCall Ensemble's built-in functions or execute code
stylesobjectSee properties

styles

PropertyTypeDescription
childrenFitsarraySpecify array of numbers to set how space is distributed among the children. Use auto instead of a number in order to have the child widget determin its own width.
mainAxisstringControl our children's layout vertically. start center end spaceBetween spaceAround spaceEvenly
fontSizeintegerSets the size of the text.
fontFamilystring or ObjectSet the font family applicable for all widgets inside this container, see the list of all available font families here (opens in a new tab). You can specify the fontFamily name directly or specify a different fontFamily for each language, see Here.
gapintegerThe gap between the children in the main direction
crossAxisstringControl the horizontal alignment of the children. start center end stretch baseline
borderRadiusstring or integerThe border radius of the widget.This can be specified using CSS-like notation with 1 to 4 integers. Minimum value: 0.
borderColorinteger or stringSets the border color, starting with '0xFF' for full opacity. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange
borderWidthintegerThickness of the border. Minimum value should be 0.
shadowColorinteger or stringSets the box shadow color starting with '0xFF' for full opacity. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange
shadowOffsetarrayThe values in array define the horizontal and vertical offset of the shadow. Example: if the shadowOffset is set to [2, 4], the shadow will be offset by 2 pixels horizontally and 4 pixels vertically from its original position.
shadowRadiusstring or integerThe border radius of the widget.This can be specified using CSS-like notation with 1 to 4 integers. Minimum value: 0.
shadowStylestringThe blur style to apply on the shadow normal, solid, outer, inner
stackPositionTopintegerThe distance of the child's top edge from the top of the stack. This is applicable only for Stack's children.
stackPositionBottomintegerThe distance that the child's bottom edge from the bottom of the stack. This is applicable only for Stack's children.
stackPositionLeftintegerThe distance that the child's left edge from the left of the stack. This is applicable only for Stack's children.
stackPositionRightintegerThe distance that the child's right edge from the right of the stack. This is applicable only for Stack's children.
captureWebPointerbooleanApplicable for Web only. When overlaying widgets on top of certain HTML container (e.g. Maps), the mouse click is captured by the HTML container, causing issue interacting with the widget. Use this to capture and maintain the mouse pointer on your widget.
marginstring or integerMargin with CSS-style notation
paddingstring or integerPadding with CSS-style value
widthintegerThe width property determines the horizontal size of an element, allowing control over its width dimension within the layout.
heightintegerThe height property determines the vertical size of an element, allowing control over its height dimension within the layout.
backgroundImageobjectBackground image of the box. see properties
backgroundGradientobjectBackground gradient of the box see properties
backgroundColorinteger or stringBackground color of the box. which can be represented in different formats. It can be specified as a number, a predefined color name, or a hexadecimal value starting with '0x'. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange
expandedbooleanIf the parent is a Row or Column, this flag will stretch this widget in the appropriate direction. (e.g. stretch horizontally for parent of type Row)
visibilityTransitionDurationnumberSpecify the duration in seconds when a widget animates between visible and not visible state. Note that setting this value will cause the widget to still occupy the UI space even when it is not visible.
elevationintegerThe z-coordinate at which to place this material relative to its parent. A non-zero value will show a shadow, with its size relative to the elevation value. Minimum value: 0, Maximum value: 24
elevationShadowColorinteger or stringThe shadow color for the elevation, which can be represented in different formats. It can be specified as a number, a predefined color name, or a hexadecimal value starting with '0x'. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange
elevationBorderRadiusstring or integerThe border radius of the widget.This can be specified using CSS-like notation with 1 to 4 integers. Minimum value: 0.
alignmentstringThe alignment of the widget relative to its parent. topLeft, topCenter, topRight, centerLeft, center, centerRight, bottomLeft, bottomCenter, bottomRight
visiblebooleanToggle a widget visibility on/off. Note that an invisible widget will not occupy UI space, unless the visibilityTransitionDuration is specified.
enableSplashFeedbackbooleanToggles splash effect feedback for the widget when true.
splashColorstringDefines the color of the splash effect when enableSplashFeedback is true.
splashDurationintegerThis is the duration it takes to fill the widget surface with the splashColor.The duration in ms when tap and release on the widget.
splashFadeDurationintegerThe duration it takes to fade out once tapped. Since a typical tap starts and ends immdiately, this splashFadeDuration executes almost at the same time as the splashDuration, so ideally it should be equal or longer than splashDuration to see the entire effect.
unconfirmedSplashDurationintegerThis happens when the user tap and hold (not yet released). It is called unconfirmed since the tap will be cancelled if the user moves out of the tap area and release. Usually this should be longer (around 1 secs) to signify that the user has not confirmed the tap.
childrenFitsarraySpecify an array of non-zero integers or auto, each corresponding to a child. Setting auto will let the child determines its own size, while setting a non-zero integer will determine the child's size multiple. The auto children will be laid out first and get as much space as they need, then the left-over space will be distributed to the other children based on their size multiples. Otherwise default is 1, After laying out the auto children, the left-over space will be divided up based on this multiple.

styles.backgroundGradient

PropertyTypeDescription
colorsarrayThe list of colors used for the gradient. Colors can be represented in different formats. It can be specified as a number, a predefined color name, or a hexadecimal value starting with '0x'.
startstringThe starting position of the gradient
endstringThe ending position of the gradient

styles.backgroundImage

PropertyTypeDescription
sourcestringThe Image URL to fill the background
fitstringHow to fit the image within our width/height or our parent (if dimension is not specified) . see options
alignmentstringAlignment of the background image

Fit options for styles.backgroundImage

OptionDescription
fillStretch our image to fill the dimension, and distorting the aspect ratio if needed
containScale the image such that the entire image is contained within our dimension
coverScale the image to fill our dimension, clipping the image as needed
fitWidthScale the image to fit the width, and clipping the height if needed
fitHeightScale the image to fit the height, and clipping the width if needed
noneCenter-Align the original image size, clipping the content if needed
scaleDownCenter-Align the image and only scale down to fit. Image will not be scaled up to bigger dimension.