NIB / DOCUMENTATION
Cards and flip cards — NibComponents
Group content in a surface or reveal a second face with an explicit flip contract.
Open interactive viewStart with a surface
NibCard has header, child, and footer slots. Padding, backgroundColor, borderColor, and borderRadius override its NibTheme defaults. A plain card groups content without implying that it can be pressed.
Turn on interactive and supply onTap when the entire surface opens something. The preview increments an activation count so the callback outcome is observable. disabled blocks the action. animated opts into the hover and press treatment for an interactive card.
Use NibFlipCard for a two-face interaction
Choose Flip to render the actual NibFlipCard. Tap the visible face to request the other one. front and back are independent widget subtrees; isFlipped and onFlippedChanged make the host the state owner. Omit isFlipped to use the widget’s local flip state.
NibFlipCard has no animated parameter. Its duration defaults to 600 milliseconds, and flipAxis selects the rotation: Axis.horizontal rotates around Y, while Axis.vertical rotates around X. The duration control changes that real duration. A zero duration settles immediately in the selected motion candidate.
Keep the visible face meaningful
Give tappable faces useful frontSemanticLabel and backSemanticLabel values. tappable: false removes the built-in face action; the host can still change a controlled isFlipped value. The demo’s Disabled switch disables tapping without discarding the requested face.
The selected local NibFlip dependency respects reduced motion and gates focus and semantics by the face actually visible during a flip. Test interruption and keyboard activation with your resolved dependency version. Those repaired behaviors are not an assertion about every older hosted release.
Give both faces useful bounds
Both faces need a stable, bounded layout. This preview gives the flip 180 logical pixels of height and lets the surrounding column set the width. Test the larger of your two content states, long text, and text scaling.
Switching between the plain-card and flip-card examples changes the demonstrated widget. They have different APIs; the plain-card animated control does not secretly change the flip duration. The copied source contains both branches and the exact selected settings.