Unverified Commit eeebd833 authored by Jacob Richman's avatar Jacob Richman Committed by GitHub

Avoid ever creating the WidgetInspectorService outside of debug mode. (#21648)

parent 9dce4b82
...@@ -293,20 +293,23 @@ abstract class WidgetsBinding extends BindingBase with SchedulerBinding, Gesture ...@@ -293,20 +293,23 @@ abstract class WidgetsBinding extends BindingBase with SchedulerBinding, Gesture
} }
); );
// This service extension is deprecated and will be removed by 7/1/2018. assert(() {
// Use ext.flutter.inspector.show instead. // This service extension is deprecated and will be removed by 7/1/2018.
registerBoolServiceExtension( // Use ext.flutter.inspector.show instead.
name: 'debugWidgetInspector', registerBoolServiceExtension(
getter: () async => WidgetsApp.debugShowWidgetInspectorOverride, name: 'debugWidgetInspector',
setter: (bool value) { getter: () async => WidgetsApp.debugShowWidgetInspectorOverride,
if (WidgetsApp.debugShowWidgetInspectorOverride == value) setter: (bool value) {
return new Future<Null>.value(); if (WidgetsApp.debugShowWidgetInspectorOverride == value)
WidgetsApp.debugShowWidgetInspectorOverride = value; return new Future<Null>.value();
return _forceRebuild(); WidgetsApp.debugShowWidgetInspectorOverride = value;
} return _forceRebuild();
); }
);
WidgetInspectorService.instance.initServiceExtensions(registerServiceExtension); WidgetInspectorService.instance.initServiceExtensions(registerServiceExtension);
return true;
}());
} }
Future<Null> _forceRebuild() { Future<Null> _forceRebuild() {
......
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