Unverified Commit ffc56026 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Dedupe (and update) the --track-widget-creation documentation (#58206)

parent 54524a7f
...@@ -1519,9 +1519,11 @@ mixin WidgetInspectorService { ...@@ -1519,9 +1519,11 @@ mixin WidgetInspectorService {
/// object that `diagnosticsNodeId` references only including children that /// object that `diagnosticsNodeId` references only including children that
/// were created directly by user code. /// were created directly by user code.
/// ///
/// {@template widgets.inspector.trackCreation}
/// Requires [Widget] creation locations which are only available for debug /// Requires [Widget] creation locations which are only available for debug
/// mode builds when the `--track-widget-creation` flag is passed to /// mode builds when the `--track-widget-creation` flag is enabled on the call
/// `flutter_tool`. /// to the `flutter` tool. This flag is enabled by default in debug builds.
/// {@endtemplate}
/// ///
/// See also: /// See also:
/// ///
...@@ -1803,10 +1805,7 @@ mixin WidgetInspectorService { ...@@ -1803,10 +1805,7 @@ mixin WidgetInspectorService {
/// Returns whether [Widget] creation locations are available. /// Returns whether [Widget] creation locations are available.
/// ///
/// [Widget] creation locations are only available for debug mode builds when /// {@macro widgets.inspector.trackCreation}
/// the `--track-widget-creation` flag is passed to `flutter_tool`. Dart 2.0
/// is required as injecting creation locations requires a
/// [Dart Kernel Transformer](https://github.com/dart-lang/sdk/wiki/Kernel-Documentation).
bool isWidgetCreationTracked() { bool isWidgetCreationTracked() {
_widgetCreationTracked ??= _WidgetForTypeTests() is _HasCreationLocation; _widgetCreationTracked ??= _WidgetForTypeTests() is _HasCreationLocation;
return _widgetCreationTracked; return _widgetCreationTracked;
...@@ -2704,11 +2703,7 @@ const TextStyle _messageStyle = TextStyle( ...@@ -2704,11 +2703,7 @@ const TextStyle _messageStyle = TextStyle(
/// Interface for classes that track the source code location the their /// Interface for classes that track the source code location the their
/// constructor was called from. /// constructor was called from.
/// ///
/// A [Dart Kernel Transformer](https://github.com/dart-lang/sdk/wiki/Kernel-Documentation). /// {@macro widgets.inspector.trackCreation}
/// adds this interface to the [Widget] class when the
/// `--track-widget-creation` flag is passed to `flutter_tool`. Dart 2.0 is
/// required as injecting creation locations requires a
/// [Dart Kernel Transformer](https://github.com/dart-lang/sdk/wiki/Kernel-Documentation).
// ignore: unused_element // ignore: unused_element
abstract class _HasCreationLocation { abstract class _HasCreationLocation {
_Location get _location; _Location get _location;
...@@ -2841,10 +2836,7 @@ Iterable<DiagnosticsNode> _describeRelevantUserCode(Element element) { ...@@ -2841,10 +2836,7 @@ Iterable<DiagnosticsNode> _describeRelevantUserCode(Element element) {
/// Returns if an object is user created. /// Returns if an object is user created.
/// ///
/// This function will only work in debug mode builds when /// {@macro widgets.inspector.trackCreation}
/// the `--track-widget-creation` flag is passed to `flutter_tool`. Dart 2.0 is
/// required as injecting creation locations requires a
/// [Dart Kernel Transformer](https://github.com/dart-lang/sdk/wiki/Kernel-Documentation).
/// ///
/// Currently is local creation locations are only available for /// Currently is local creation locations are only available for
/// [Widget] and [Element]. /// [Widget] and [Element].
...@@ -2859,10 +2851,7 @@ bool _isLocalCreationLocation(Object object) { ...@@ -2859,10 +2851,7 @@ bool _isLocalCreationLocation(Object object) {
/// ///
/// ex: "file:///path/to/main.dart:4:3" /// ex: "file:///path/to/main.dart:4:3"
/// ///
/// Creation locations are only available for debug mode builds when /// {@macro widgets.inspector.trackCreation}
/// the `--track-widget-creation` flag is passed to `flutter_tool`. Dart 2.0 is
/// required as injecting creation locations requires a
/// [Dart Kernel Transformer](https://github.com/dart-lang/sdk/wiki/Kernel-Documentation).
/// ///
/// Currently creation locations are only available for [Widget] and [Element]. /// Currently creation locations are only available for [Widget] and [Element].
String _describeCreationLocation(Object object) { String _describeCreationLocation(Object object) {
...@@ -2872,10 +2861,7 @@ String _describeCreationLocation(Object object) { ...@@ -2872,10 +2861,7 @@ String _describeCreationLocation(Object object) {
/// Returns the creation location of an object if one is available. /// Returns the creation location of an object if one is available.
/// ///
/// Creation locations are only available for debug mode builds when /// {@macro widgets.inspector.trackCreation}
/// the `--track-widget-creation` flag is passed to `flutter_tool`. Dart 2.0 is
/// required as injecting creation locations requires a
/// [Dart Kernel Transformer](https://github.com/dart-lang/sdk/wiki/Kernel-Documentation).
/// ///
/// Currently creation locations are only available for [Widget] and [Element]. /// Currently creation locations are only available for [Widget] and [Element].
_Location _getCreationLocation(Object object) { _Location _getCreationLocation(Object object) {
......
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