compactRoot property

MNode? compactRoot
final

An alternate tree for the smallest sizes — systemSmall on iOS, and a narrow tile on Android.

Without it a 2x2 widget renders exactly what a 4x4 does, which is the usual reason a small widget looks cramped: the same four rows squeezed into a quarter of the space. Give it the one thing worth seeing small.

Optional — when null every size renders root.

Honoured on both platforms. iOS picks the tree at render from @Environment(\.widgetFamily); Android hands the launcher a RemoteViews(Map<SizeF, RemoteViews>) (API 31+) keyed on the widget's own declared minimum size, and falls back to root below API 31.

Implementation

final MNode? compactRoot;