presentation/widgets/common/level_select_grid library

Classes

LevelNodeButton
One round level node — the world-map/level-select building block. Shows the level number, or a lock glyph (and blocks tap) when state is locked, plus a mini StarRating badge underneath once completed.
LevelSelectGrid
Read-only grid of LevelNodeButtons for a world-map/level-select screen — a pure display widget, it holds no progress state itself. states gives each level's LevelState in order (level 1 at index 0); starsEarnedByLevel optionally maps a 1-based level number to its earned star count. onLevelTap fires with the 1-based level number of whichever unlocked/completed node was tapped — locked nodes never fire it.

Enums

LevelState
Progress state of a single level node in a LevelSelectGrid — the grid holds no progress logic of its own, this is what the caller's own save/progress system hands in per level.

Functions

levelStateBorderColor(LevelState state) → Color
Node border color for state.
levelStateFillColor(LevelState state) → Color
Node fill color for state — dim gray for locked, card white for unlocked, gold for completed.
levelStateIcon(LevelState state) → IconData?
Icon shown over a LevelNodeButton for state — only locked gets one (a lock glyph instead of the level number); unlocked/completed just show the number, distinguished from each other by fill/border color.
levelStateTappable(LevelState state) → bool
Whether a node in state can be tapped at all.