isFlutterApp property

bool isFlutterApp

Returns whether this package is a Flutter app.

This is determined by ensuring all the following conditions are met:

  • a) the package depends on the Flutter SDK.
  • b) the package does not define itself as a Flutter plugin inside pubspec.yaml.
  • c) a lib/main.dart file exists in the package.

Implementation

bool get isFlutterApp {
  // Must directly depend on the Flutter SDK.
  if (!isFlutterPackage) return false;

  // Must not have a Flutter plugin definition in it's pubspec.yaml.
  if (pubSpec.flutter?.plugin != null) return false;

  return fileExists(p.join(path, 'lib', 'main.dart'));
}