windows_workflow.dart 1.22 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
// @dart = 2.8

7 8
import 'package:meta/meta.dart';

9
import '../base/context.dart';
10
import '../base/platform.dart';
11
import '../doctor.dart';
12
import '../features.dart';
13 14

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

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

  final Platform _platform;
  final FeatureFlags _featureFlags;
30 31

  @override
32
  bool get appliesToHostPlatform => _platform.isWindows && _featureFlags.isWindowsEnabled;
33 34

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

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

  @override
  bool get canListEmulators => false;
}