Object Position
Use object position utilities like object-top-left and object-bottom-right to specify how a replaced element’s content should be positioned within its container. These map to Flutter’s FittedBox.alignment (or the alignment parameter of Image when used directly) so that images and other replaced content align inside a cropped viewport.
Style('object-top-left ...', child: Image.network('/img/mountains.jpg'))Style('object-top ...', child: Image.network('/img/mountains.jpg'))Style('object-top-right ...', child: Image.network('/img/mountains.jpg'))Style('object-left ...', child: Image.network('/img/mountains.jpg'))Style('object-center ...', child: Image.network('/img/mountains.jpg'))Style('object-right ...', child: Image.network('/img/mountains.jpg'))Style('object-bottom-left ...', child: Image.network('/img/mountains.jpg'))Style('object-bottom ...', child: Image.network('/img/mountains.jpg'))Style('object-bottom-right ...', child: Image.network('/img/mountains.jpg'))Class reference
Section titled “Class reference”| Class | Alignment |
|---|---|
object-top-left | Alignment.topLeft |
object-top | Alignment.topCenter |
object-top-right | Alignment.topRight |
object-left | Alignment.centerLeft |
object-center | Alignment.center |
object-right | Alignment.centerRight |
object-bottom-left | Alignment.bottomLeft |
object-bottom | Alignment.bottomCenter |
object-bottom-right | Alignment.bottomRight |
Custom values
Section titled “Custom values”- Keyword, e.g.
object-[top-left]— resolves to the namedAlignment. - Percentage pair, e.g.
object-[25%_75%]— normalized to[-1..1].25%_75%→Alignment(-0.5, 0.5).
Pixel values (e.g. object-[4px_8px]) are not supported — Flutter’s Alignment is normalized rather than pixel-based.