parent method

Widget parent(
  1. Widget parent({
    1. required Widget child,
    })
)

Applies a parent to a child

final parentWidget = ({required Widget child}) => Styled.widget(child: child)
  .alignment(Alignment.center)

final childWidget = Text('some text')
  .padding(all: 10)

Widget build(BuildContext) => childWidget
  .parent(parentWidget);

Implementation

Widget parent(Widget Function({required Widget child}) parent) =>
    parent(child: this);