diff --git a/packages/flutter/lib/src/widgets/binding.dart b/packages/flutter/lib/src/widgets/binding.dart index 5b4d4b2e2260f..bcfe883dfe204 100644 --- a/packages/flutter/lib/src/widgets/binding.dart +++ b/packages/flutter/lib/src/widgets/binding.dart @@ -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. - // Use ext.flutter.inspector.show instead. - registerBoolServiceExtension( - name: 'debugWidgetInspector', - getter: () async => WidgetsApp.debugShowWidgetInspectorOverride, - setter: (bool value) { - if (WidgetsApp.debugShowWidgetInspectorOverride == value) - return new Future.value(); - WidgetsApp.debugShowWidgetInspectorOverride = value; - return _forceRebuild(); - } - ); + assert(() { + // This service extension is deprecated and will be removed by 7/1/2018. + // Use ext.flutter.inspector.show instead. + registerBoolServiceExtension( + name: 'debugWidgetInspector', + getter: () async => WidgetsApp.debugShowWidgetInspectorOverride, + setter: (bool value) { + if (WidgetsApp.debugShowWidgetInspectorOverride == value) + return new Future.value(); + WidgetsApp.debugShowWidgetInspectorOverride = value; + return _forceRebuild(); + } + ); - WidgetInspectorService.instance.initServiceExtensions(registerServiceExtension); + WidgetInspectorService.instance.initServiceExtensions(registerServiceExtension); + return true; + }()); } Future _forceRebuild() {