doctor.dart 831 Bytes
Newer Older
1 2 3 4 5 6 7
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';

import '../artifacts.dart';
8
import '../globals.dart';
9 10 11 12 13
import '../runner/flutter_command.dart';
import '../runner/version.dart';

class DoctorCommand extends FlutterCommand {
  final String name = 'doctor';
14
  final String description = 'Show information about the installed tooling.';
15 16 17 18 19 20

  bool get requiresProjectRoot => false;

  Future<int> runInProject() async {
    // general info
    String flutterRoot = ArtifactStore.flutterRoot;
21
    printStatus('Flutter root: $flutterRoot.');
22 23 24 25 26 27 28 29 30 31 32 33
    printStatus('');

    // doctor
    doctor.diagnose();
    printStatus('');

    // version
    printStatus(getVersion(flutterRoot));

    return 0;
  }
}