[flutter_tools] add the feature for single widget reloads (#61411)

Implements the flutter config feature for #61407 , but does not implement any of the functionality.
This commit is contained in:
Jonah Williams
2020-07-14 12:24:58 -07:00
committed by GitHub
parent 74f3e6dd63
commit d22d65c6e7
3 changed files with 45 additions and 0 deletions

View File

@@ -34,6 +34,9 @@ class FeatureFlags {
/// Whether flutter desktop for Windows is enabled.
bool get isWindowsEnabled => isEnabled(flutterWindowsDesktopFeature);
/// Whether fast single widget reloads are enabled.
bool get isSingleWidgetReloadEnabled => isEnabled(singleWidgetReload);
/// Whether a particular feature is enabled for the current channel.
///
/// Prefer using one of the specific getters above instead of this API.
@@ -65,6 +68,7 @@ const List<Feature> allFeatures = <Feature>[
flutterLinuxDesktopFeature,
flutterMacOSDesktopFeature,
flutterWindowsDesktopFeature,
singleWidgetReload,
];
/// The [Feature] for flutter web.
@@ -127,6 +131,28 @@ const Feature flutterWindowsDesktopFeature = Feature(
),
);
/// The fast hot reload feature for https://github.com/flutter/flutter/issues/61407.
const Feature singleWidgetReload = Feature(
name: 'Hot reload optimization for changes to class body of a single widget',
configSetting: 'single-widget-reload-optimization',
master: FeatureChannelSetting(
available: true,
enabledByDefault: false,
),
dev: FeatureChannelSetting(
available: true,
enabledByDefault: false,
),
beta: FeatureChannelSetting(
available: true,
enabledByDefault: false,
),
stable: FeatureChannelSetting(
available: true,
enabledByDefault: false,
),
);
/// A [Feature] is a process for conditionally enabling tool features.
///
/// All settings are optional, and if not provided will generally default to