Skip to content

Layouts

Layout in Fluvie is plain Flutter. Center, Column, Row, Stack, Padding, SizedBox, and Positioned all work inside a Scene, and any widget you lay out can carry .animate(...). Lesson 02 lays out three lines with a Column and staggers them in:

const Column(
mainAxisSize: MainAxisSize.min,
spacing: 32,
children: [
Text('Layout is plain Flutter', style: _line),
Text('Motion is one list', style: _line),
Text('Timing happens for you', style: _line),
],
).animate([
Animation.slideFade(stagger: const Stagger.each(Time.frames(8))),
]),

One slideFade with Stagger.each(Time.frames(8)) animates each child 8 frames after the one before it. The layout knows nothing about the motion.

A Positioned child animates without any ceremony. Lesson 02 pins a badge and chains an ambient float off its pop:

Positioned(
top: 360,
child: const Text('02', style: _badge).animate([
Animation.pop(),
Animation.float(at: Trigger.previous, amplitude: 0.1),
]),
),

A scene stacks its children on a centered, canvas-filling stack. A bare Text lands in the middle of the frame; wrap it in your own layout when you want something else. Scene.centered is a one-child convenience for the same thing.

Box is a rectangle whose size is always a fraction of its parent: Box(color: brand, size: Size(0.5, 0.01)) is half the parent’s width and one percent of its height. Leave size null to fill the parent. For absolute pixels, use SizedBox; Fluvie adds no second sizing system.

Frame wraps a child in a small styled shell:

ConstructorWhat you get
Frame.nonepassthrough, no decoration
Frame.rounded(radius: 24)rounded corner clip
Frame.cardrounded white surface, padding, one soft shadow
Frame.polaroidwhite border, wide at the bottom, one shadow