buildInitializeWrapper method

Widget buildInitializeWrapper({
  1. required Widget builder(
    1. CameraValue,
    2. Widget?
    ),
  2. bool isInitialized()?,
  3. Widget? child,
})

Implementation

Widget buildInitializeWrapper({
  required Widget Function(CameraValue, Widget?) builder,
  bool Function()? isInitialized,
  Widget? child,
}) {
  if (innerController == null) {
    return const SizedBox.shrink();
  }
  return ValueListenableBuilder<CameraValue>(
    valueListenable: controller,
    builder: (_, CameraValue value, Widget? w) {
      if (isInitialized?.call() ?? value.isInitialized) {
        return builder(value, w);
      }
      return const SizedBox.shrink();
    },
    child: child,
  );
}