Skip to main content

Overview

Presentum provides InheritedPresentumItem to pass presentation items down the widget tree without prop drilling. Outlets automatically wrap your builder widgets with InheritedPresentumItem, giving all descendant widgets access to the current item.

Automatic wrapping

When you create an outlet:
Presentum automatically wraps it:

Accessing the item

Descendants can access the item via context:
Use context.presentumItem<T, S, V>() to access the item. No need to pass it as a prop!

Benefits

No prop drilling

Before (manual passing):
After (inherited):

Cleaner component APIs

Components don’t need to know about Presentum items:

Custom observer widgets

If you build custom widgets that observe Presentum state (not using PresentumOutlet), you must wrap descendants manually:
Forgetting to wrap? Child widgets will throw when trying to access the item:
Fix: Wrap with InheritedPresentumItem or pass the item explicitly.

Alternative: Explicit props

If you prefer explicit props over inherited widgets, pass items manually:
Both approaches work. Choose based on your preference.

InheritedPresentum vs InheritedPresentumItem

Presentum provides two inherited widgets:
Provides the Presentum controller instance.
Used for: Calling markShown, markDismissed, markConverted, etc.

Extension methods

Presentum provides convenient extension methods:
Use watchPresentumItem to rebuild when the item changes:

Next steps

Outlets

Learn about outlet widgets

Build context extension

API reference