windows_workflow.dart 1.21 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
import 'package:meta/meta.dart';

7
import '../base/context.dart';
8
import '../base/platform.dart';
9
import '../doctor.dart';
10
import '../features.dart';
11 12

/// The [WindowsWorkflow] instance.
13
WindowsWorkflow get windowsWorkflow => context.get<WindowsWorkflow>();
14

15
/// The Windows-specific implementation of a [Workflow].
16
///
17 18
/// This workflow requires the host machine to be Windows, and the Windows
/// desktop configuration setting to be enabled.
19
class WindowsWorkflow implements Workflow {
20 21 22 23 24 25 26 27
  const WindowsWorkflow({
    @required Platform platform,
    @required FeatureFlags featureFlags,
  }) : _platform = platform,
       _featureFlags = featureFlags;

  final Platform _platform;
  final FeatureFlags _featureFlags;
28 29

  @override
30
  bool get appliesToHostPlatform => _platform.isWindows && _featureFlags.isWindowsEnabled;
31 32

  @override
33
  bool get canLaunchDevices => _platform.isWindows && _featureFlags.isWindowsEnabled;
34 35

  @override
36
  bool get canListDevices => _platform.isWindows && _featureFlags.isWindowsEnabled;
37 38 39 40

  @override
  bool get canListEmulators => false;
}