maybeHiddenPlaceholder method

Widget? maybeHiddenPlaceholder({
  1. double? height,
  2. double? width,
})

Returns a same-sized SizedBox placeholder when isHiddenForModal is true, else null. Use as an early return at the top of build() so the live UiKitView/AppKitView is never constructed while a modal is up — that's what removes the PlatformView from the iOS shared container and fixes the bleed.

Implementation

Widget? maybeHiddenPlaceholder({double? height, double? width}) {
  if (!isHiddenForModal) return null;
  return SizedBox(height: height, width: width);
}