Class TokenPadding


public class TokenPadding extends Padding
A Padding whose insets follow the resolved ControlSize step, uniform on all four edges. Page and panel padding is the widest thing the spacing ramp moves (12 / 16 / 20 / 26 / 32 at Tokens.Role.LARGE), and a literal here is what makes a step change read as "the controls shrank" rather than "the density changed".
  • Constructor Details

    • TokenPadding

      public TokenPadding(Widget child)
      Page padding at spacingLarge.
    • TokenPadding

      public TokenPadding(Tokens.Role role, Widget child)
      Padding that follows role at the resolved size step.
  • Method Details

    • onMeasure

      protected Size onMeasure(Constraints constraints)
      Description copied from class: Widget
      Reports the size this widget wants within constraints. Called once per layout pass, and the result is cached against the constraints and the resolved axes (size step, layout direction, locale), so it must be a pure function of them and of this widget's own state.

      Resolve the ControlSize and the LayoutDirection once each here and thread them down; never read either in a constructor. The locale needs no threading: it is in scope, and I18n.locale() answers it wherever text is resolved.

      Overrides:
      onMeasure in class Padding