Public pages are build into public folder. When public is false, the page is not build. It is still accessible in templates in both cases.
late final bool public = metadata['public'] as bool? ?? true;