FlutterProjectDetector class
Detects whether the current directory is a Flutter or Dart project.
Used before running generators to ensure hasPubspec exists and optionally hasFlutterSdk. ensureFlutterProject prints an error and returns false if the project is not valid.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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
- hasFlutterSdk → bool
-
Returns true if pubspec has dependency on Flutter SDK (flutter: sdk: flutter).
no setter
- hasPubspec → bool
-
Returns true if pubspec.yaml exists and contains a valid project (has
name).no setter - isFlutterProject → bool
-
Returns true if this looks like a Flutter project (pubspec has flutter sdk).
no setter
Static Methods
-
ensureFlutterProject(
{bool requireFlutterSdk = true}) → bool - Ensures current directory is a Flutter project. Prints error and returns false if not.