API Reference 0.7.1rikulo_layoutLayout

Layout abstract class

A layout controller that arranges the layout of the child views.

abstract class Layout {
 /** Measure the width of the given view.
  */
 int measureWidth(MeasureContext mctx, View view);
 /** Measure the height of the given view.
  */
 int measureHeight(MeasureContext mctx, View view);

 /** Returns whether the subview's profile shall inherit the layout of
  * its parent.
  *
  * For example, it is true for [LinearLayout], since the profile's width and
  * height in the subviews shall inherit from [LayoutDeclaration] of the parent
  * (that is associated with [LinearLayout]).
  */
 bool get isProfileInherited;
 /** Returns whether its dimension depends on the parent.
  * If `true` is returned, the default width of the associate view's
  * [LayoutDeclaration] will be `flex` (rather than `content`).
  *
  * For example, [TileLayout] returns true since there is no way to measure
  * the dimension without knowing the parent's dimension.
  */
 bool get isFlex;

 /** Handles the layout of the given view.
  */
 void doLayout(MeasureContext mctx, View view);
}

Subclasses

AbstractLayout

Properties

final bool isFlex #

Returns whether its dimension depends on the parent. If true is returned, the default width of the associate view's LayoutDeclaration will be flex (rather than content).

For example, TileLayout returns true since there is no way to measure the dimension without knowing the parent's dimension.

bool get isFlex;

final bool isProfileInherited #

Returns whether the subview's profile shall inherit the layout of its parent.

For example, it is true for LinearLayout, since the profile's width and height in the subviews shall inherit from LayoutDeclaration of the parent (that is associated with LinearLayout).

bool get isProfileInherited;

Methods

abstract void doLayout(MeasureContext mctx, View view) #

Handles the layout of the given view.

abstract int measureHeight(MeasureContext mctx, View view) #

Measure the height of the given view.

abstract int measureWidth(MeasureContext mctx, View view) #

Measure the width of the given view.