📦 Packages

Deal with name conflicts when importing packages

Namespace packages

The easiest way to deal with name conflicts is to use a namespace package.

file_type_dartlang packages.dart
import 'somewhere.dart' as External;

Exclude code from a package

Exclude code from a package with the hide keyword.

file_type_dartlang packages.dart
import 'somewhere.dart' hide Circle;

Isolate code from a package

Import individual classes from a package with the show keyword.

file_type_dartlang packages.dart
import 'somewhere.dart' show Rectangle;

Questions? Let's chat

Open Discord