Manipulating position and size: Applying a linear gradient

  • To apply a linear gradient to a widget’s background, nest it in a Container widget.
  • Then use the Container widget’s decoration property to create a BoxDecoration object, and use BoxDecoration’s gradient property to transform the background fill.
  • Vertical gradient.
  • Horizontal gradient.

Manipulating position and size: Applying a linear gradient — Structure map

Clickable & Draggable!

Manipulating position and size: Applying a linear gradient — Related pages: