Commit f7d50102 authored by Devon Carew's avatar Devon Carew Committed by GitHub

share a common default for enabling hot reload (#6081)

parent c5567a5f
......@@ -293,7 +293,7 @@ class AppDomain extends Domain {
String route = _getStringArg(args, 'route');
String mode = _getStringArg(args, 'mode');
String target = _getStringArg(args, 'target');
bool hotMode = _getBoolArg(args, 'hot') ?? false;
bool enableHotReload = _getBoolArg(args, 'hot') ?? kHotReloadDefault;
Device device = daemon.deviceDomain._getOrLocateDevice(deviceId);
if (device == null)
......@@ -323,7 +323,7 @@ class AppDomain extends Domain {
ResidentRunner runner;
if (hotMode) {
if (enableHotReload) {
runner = new HotRunner(
device,
target: target,
......@@ -339,7 +339,7 @@ class AppDomain extends Domain {
);
}
bool supportsRestart = hotMode ? device.supportsHotMode : device.supportsRestart;
bool supportsRestart = enableHotReload ? device.supportsHotMode : device.supportsRestart;
AppInstance app = new AppInstance(_getNextAppId(), runner);
_apps.add(app);
......
......@@ -66,7 +66,7 @@ class RunCommand extends RunCommandBase {
// Option to enable hot reloading.
argParser.addFlag('hot',
negatable: true,
defaultsTo: true,
defaultsTo: kHotReloadDefault,
help: 'Run with support for hot reloading.');
// Option to write the pid to a file.
......
......@@ -25,6 +25,8 @@ import 'vmservice.dart';
import 'resident_runner.dart';
import 'toolchain.dart';
const bool kHotReloadDefault = true;
String getDevFSLoaderScript() {
return path.absolute(path.join(Cache.flutterRoot,
'packages',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment