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.
hide combinator is a namespace-control modifier applied to import or export directives in Dart. It acts as an exclusion filter, preventing specific top-level identifiers from a target library from being introduced into the current library’s namespace, while allowing all other public identifiers to be resolved.
Syntax
The combinator is appended to the end of animport or export statement, followed by a comma-separated list of the identifiers to be excluded.
Mechanics and Behavior
- Target Scope: The
hidecombinator strictly operates on top-level declarations (e.g.,class,mixin,typedef, top-level variables, and top-level functions). It cannot be used to filter out specific instance members, static methods, or properties encapsulated within a class. - Namespace Resolution: When the Dart analyzer processes a directive with
hide, it constructs the symbol table for the imported/exported library but explicitly drops the symbols listed in thehideclause. Attempting to reference a hidden identifier results in a compile-timeUndefined nameerror, exactly as if the target library did not contain that declaration. - Export Propagation: When applied to an
exportdirective,hideprevents the specified identifiers from being re-exported. This modifies the public API surface of the aggregating library by omitting the hidden symbols from the exported namespace. - Combinator Chaining: Dart allows multiple combinators (
showandhide) to be chained on a single directive. When chained, the Dart compiler evaluates them sequentially from left to right.
Master Dart with Deep Grasping Methodology!Learn More





