build property

  1. @override
W Function({required W child, required BuildContext context}) get build
override

Build a widget tree with all registered plugins, passing each previous child as input to the next plugin.

Implementation

@override
W Function({
  required BuildContext context,
  required W child,
}) get build {
  // Apply plugins in order, each wrapping the previous result.
  return ({
    required BuildContext context,
    required W child,
  }) {
    return plugins.fold(child, (previousChild, plugin) {
      return plugin.attach(context, previousChild);
    });
  };
}