ProjectContext.detect constructor

ProjectContext.detect()

Detects installed modules by the presence of their canonical folders.

Implementation

factory ProjectContext.detect() {
  bool dir(String p) => Directory(p).existsSync();
  return ProjectContext(
    packageName: _readPackageName(),
    hasConfig: dir('lib/app/config'),
    hasUtils: dir('lib/app/utils'),
    hasExtensions: dir('lib/app/extensions'),
    hasWidgets: dir('lib/app/shared_widgets'),
    hasNetwork: dir('lib/data/provider/network'),
    hasStorage: dir('lib/data/provider/local_storage'),
  );
}