TheDocumentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
show combinator is a directive modifier in Dart used alongside import or export statements to act as an explicit inclusion whitelist. It restricts the visibility of an external library’s API by selectively bringing only the specified top-level declarations (classes, functions, variables, or typedefs) into the current library’s namespace, leaving all unlisted declarations inaccessible.
Mechanics and Syntax Rules
- Comma-Separated Identifiers: Multiple declarations must be separated by commas. The identifiers must exactly match the exported names from the target library.
- Namespace Isolation: Declarations omitted from the
showlist are not bound in the importing library’s scope. Attempting to reference an unlisted declaration results in a static analysis error (undefined_identifier). - Chaining with Prefixes: The
showcombinator can be chained with theasdirective. The filtering occurs before the prefix is applied to the namespace. - Export Re-routing: When used with
export, theshowcombinator restricts which parts of an external library are re-exported as part of the current library’s public API.
Code Illustration
Given an external libraryarithmetic.dart:
show combinator in the importing library:
Combinator Chaining
When combiningshow with a namespace prefix (as), the syntax requires the prefix declaration to precede the combinator:
Master Dart with Deep Grasping Methodology!Learn More





