#6744·flet

bug: Interactive Viewer renders grey text when passed alignment

Author: MintOchaCreated Aug 2, 2026Updated Sep 24, 2026
Labelsbug

Duplicate Check

Describe the bug

ft.InteractiveViewer fails to render its content when its alignment property is set to an ft.Alignment value.

The page or containing surface remains blank. Removing only the alignment argument makes the same child render correctly.

This affects images and simple controls such as ft.Text, so it is not related to image loading, paths, sizing, constrained, or boundary margins.

Code sample

Code
python
import flet as ft


def main(page: ft.Page):
    page.add(
        ft.InteractiveViewer(
            content=ft.Text(
                "InteractiveViewer child",
                size=40,
                color=ft.Colors.RED,
            ),
            width=900,
            height=650,
            alignment=ft.Alignment(0, 0),
        )
    )


ft.run(main)

To reproduce

  1. Run the sample.
  2. Observe that the InteractiveViewer is blank and the red text is not rendered.
  3. Remove this line:

alignment=ft.Alignment(0, 0),

  1. Run the sample again.
  2. The red text now renders correctly.

The same behavior occurs with an ft.Image child.

Expected behavior

Setting InteractiveViewer.alignment should position the child using the supplied alignment without preventing the control from rendering.

Screenshots / Videos

CapturesImage

Operating System

Linux

Operating system details

Arch Linux, kernel 7.1.5-arch1-2, x86_64

Flet version

Flet 0.86.4 (Python 3.11.15)

Regression

No, it isn't

Suggestions

import '../extensions/control.dart'; +import '../utils/alignment.dart';

...

  • alignment: widget.control.get("alignment"),
  • alignment: widget.control.getAlignment("alignment"),

Serialize alignment with getAlignment function before passing into the interactive viewer.

Logs

Logs
bash
  No Python-side exception is reported. The control simply fails to render in the Flutter client.

Additional details

The issue was isolated by testing the properties independently:

  • Plain ft.Image: renders.
  • InteractiveViewer without alignment: renders.
  • InteractiveViewer with constrained=True: renders.
  • InteractiveViewer with constrained=False: renders.
  • Adding alignment=ft.Alignment(0, 0): child disappears.
  • Removing only alignment: child renders again.