ProjectContext class
Inspects the current Flutter project so generators can adapt their output to the modules that are actually installed (e.g. use the widget library and design tokens only when those modules exist).
Constructors
- ProjectContext({String? packageName, bool hasConfig = false, bool hasUtils = false, bool hasExtensions = false, bool hasWidgets = false, bool hasNetwork = false, bool hasStorage = false})
-
const
- ProjectContext.detect()
-
Detects installed modules by the presence of their canonical folders.
factory
Properties
- hasConfig → bool
-
final
- hasExtensions → bool
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasNetwork → bool
-
final
- hasStorage → bool
-
final
- hasUtils → bool
-
final
- hasWidgets → bool
-
final
- packageName → String?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- isFlutterRoot → bool
-
True if a
pubspec.yamlis present in the working directory.no setter
Static Methods
-
findFeatures(
) → List< String> -
Finds scaffolded features (folders containing a
views/subfolder) under the common feature roots. Returns paths relative to the project root.