Overview
The indexed package provides an Indexed widget in Flutter that enables precise control over the stacking order of child widgets within a Stack, similar to CSS's z-index. It allows developers to define the visual layering of overlapping elements with intuitive integer values, making it easier to manage complex layouts involving overlays, animations, or interactive components. This package is particularly useful when fine-grained control over rendering order is required without manually reordering children in the Stack.
Use cases
- Overlapping UI elements with controlled layering
- Creating layered animations
- Managing touch priority in stacked widgets
- Designing complex overlay interfaces
- Implementing drag-and-drop with depth control
Key features
- Simple z-index-like ordering
- Intuitive integer-based layering
- Seamless integration with Stack
- No need to reorder children manually
- Supports all Flutter platforms
Suitable for
- Developers needing precise stacking control
- UI designers working with layered components
- Projects with complex overlay interactions
- Apps requiring dynamic layer management
Considerations
- Limited to Stack context only
- Does not affect hit testing directly
- Requires understanding of Stack rendering order
- Not suitable for non-overlapping layouts
