SizeCopy constructor

SizeCopy({
  1. Key? key,
  2. BoxConstraints binder(
    1. Size
    ) = SizeCopierBinders.identical,
  3. Widget builder(
    1. BuildContext,
    2. Widget
    )?,
  4. Widget? child,
})

Implementation

SizeCopy({
  Key? key,
  BoxConstraints Function(Size) binder = SizeCopierBinders.identical,
  Widget Function(BuildContext, Widget)? builder,
  Widget? child,
}) : this.builder(
        key: key,
        builder: (context, size) {
          final copy = ConstrainedBox(constraints: binder(size), child: child);
          if (builder != null) return builder(context, copy);
          return copy;
        },
      );