dartFlutterProfile top-level constant

ProjectOperationProfile const dartFlutterProfile

A Dart or Flutter project.

The check operation is the analyzer over the project root; the serve operation is the Flutter web-server device on the declared port. Both are the project's own commands — the profile never guesses a script name the project does not publish.

Implementation

const ProjectOperationProfile dartFlutterProfile = ProjectOperationProfile(
  id: 'dart_flutter',
  operations: <ProjectOperation>[
    ProjectOperation(
      id: 'check',
      kind: ProjectOperationKind.check,
      command: ProjectCommand(
        executable: 'dart',
        arguments: <String>['analyze'],
      ),
    ),
    ProjectOperation(
      id: 'build',
      kind: ProjectOperationKind.build,
      command: ProjectCommand(
        executable: 'flutter',
        arguments: <String>['build', 'web', '--release'],
      ),
    ),
    ProjectOperation(
      id: 'serve',
      kind: ProjectOperationKind.serve,
      command: ProjectCommand(
        executable: 'flutter',
        arguments: <String>['run', '-d', 'web-server', '--web-port', '8080'],
        timeout: Duration(minutes: 30),
      ),
      endpoint: ProjectEndpoint(host: '127.0.0.1', port: 8080),
      readiness: ProjectReadiness.tcp(host: '127.0.0.1', port: 8080),
    ),
  ],
);