Pylon<T>.withChild constructor

const Pylon<T>.withChild({
  1. Key? key,
  2. required T value,
  3. required Widget? child,
  4. bool local = false,
})

Creates a Pylon widget with a child widget.

Use this constructor when you want to pass a value to a single child widget and don't need a builder function. Note that if you need to use the value immediately in the child widget, it won't be available until either a builder function is used or the child widget's build method uses it.

The value parameter is the value to be provided to descendant widgets. The child parameter is the widget that will have access to the pylon value. If local is true, the pylon won't be transferred across navigation routes.

Implementation

const Pylon.withChild(
    {super.key, required this.value, required this.child, this.local = false})
    : builder = null;