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

import '../base/context.dart';
6
import '../base/platform.dart';
7
import '../doctor_validator.dart';
8
import '../features.dart';
9 10

/// The [WindowsWorkflow] instance.
11
WindowsWorkflow? get windowsWorkflow => context.get<WindowsWorkflow>();
12

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

  final Platform _platform;
  final FeatureFlags _featureFlags;
26 27

  @override
28
  bool get appliesToHostPlatform => _platform.isWindows && _featureFlags.isWindowsEnabled;
29 30

  @override
31
  bool get canLaunchDevices => _platform.isWindows && _featureFlags.isWindowsEnabled;
32 33

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

  @override
  bool get canListEmulators => false;
}