1// Copyright 2014 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5/// Service extension constants for the widgets library.
6///
7/// These constants will be used when registering service extensions in the
8/// framework, and they will also be used by tools and services that call these
9/// service extensions.
10///
11/// The String value for each of these extension names should be accessed by
12/// calling the `.name` property on the enum value.
13enum WidgetsServiceExtensions {
14 /// Name of service extension that, when called, will output a string
15 /// representation of this app's widget tree to console.
16 ///
17 /// See also:
18 ///
19 /// * [WidgetsBinding.initServiceExtensions], where the service extension is
20 /// registered.
21 debugDumpApp,
22
23 /// Name of service extension that, when called, will output a string
24 /// representation of the focus tree to the console.
25 ///
26 /// See also:
27 ///
28 /// * [WidgetsBinding.initServiceExtensions], where the service extension is
29 /// registered.
30 debugDumpFocusTree,
31
32 /// Name of service extension that, when called, will overlay a performance
33 /// graph on top of this app.
34 ///
35 /// See also:
36 ///
37 /// * [WidgetsApp.showPerformanceOverlayOverride], which is the flag
38 /// that this service extension exposes.
39 /// * [WidgetsBinding.initServiceExtensions], where the service extension is
40 /// registered.
41 showPerformanceOverlay,
42
43 /// Name of service extension that, when called, will return whether the first
44 /// 'Flutter.Frame' event has been reported on the Extension stream.
45 ///
46 /// See also:
47 ///
48 /// * [WidgetsBinding.initServiceExtensions], where the service extension is
49 /// registered.
50 didSendFirstFrameEvent,
51
52 /// Name of service extension that, when called, will return whether the first
53 /// frame has been rasterized and the trace event 'Rasterized first useful
54 /// frame' has been sent out.
55 ///
56 /// See also:
57 ///
58 /// * [WidgetsBinding.initServiceExtensions], where the service extension is
59 /// registered.
60 didSendFirstFrameRasterizedEvent,
61
62 /// Name of service extension that, when called, will reassemble the
63 /// application.
64 ///
65 /// See also:
66 ///
67 /// * [WidgetsBinding.initServiceExtensions], where the service extension is
68 /// registered.
69 fastReassemble,
70
71 /// Name of service extension that, when called, will change the value of
72 /// [debugProfileBuildsEnabled], which adds [Timeline] events for every widget
73 /// built.
74 ///
75 /// See also:
76 ///
77 /// * [debugProfileBuildsEnabled], which is the flag that this service extension
78 /// exposes.
79 /// * [WidgetsBinding.initServiceExtensions], where the service extension is
80 /// registered.
81 profileWidgetBuilds,
82
83 /// Name of service extension that, when called, will change the value of
84 /// [debugProfileBuildsEnabledUserWidgets], which adds [Timeline] events for
85 /// every user-created widget built.
86 ///
87 /// See also:
88 /// * [debugProfileBuildsEnabledUserWidgets], which is the flag that this
89 /// service extension exposes.
90 /// * [WidgetsBinding.initServiceExtensions], where the service extension is
91 /// registered.
92 profileUserWidgetBuilds,
93
94 /// Name of service extension that, when called, will change the value of
95 /// [WidgetsApp.debugAllowBannerOverride], which controls the visibility of the
96 /// debug banner for debug mode apps.
97 ///
98 /// See also:
99 ///
100 /// * [WidgetsApp.debugAllowBannerOverride], which is the flag that this service
101 /// extension exposes.
102 /// * [WidgetsBinding.initServiceExtensions], where the service extension is
103 /// registered.
104 debugAllowBanner,
105}
106
107/// Service extension constants for the Widget Inspector.
108///
109/// These constants will be used when registering service extensions in the
110/// framework, and they will also be used by tools and services that call these
111/// service extensions.
112///
113/// The String value for each of these extension names should be accessed by
114/// calling the `.name` property on the enum value.
115enum WidgetInspectorServiceExtensions {
116 /// Name of service extension that, when called, will determine whether
117 /// [FlutterError] messages will be presented using a structured format.
118 ///
119 /// See also:
120 ///
121 /// * [WidgetInspectorService.initServiceExtensions], where the service
122 /// extension is registered.
123 structuredErrors,
124
125 /// Name of service extension that, when called, will change the value of
126 /// [WidgetsApp.debugShowWidgetInspectorOverride], which controls whether the
127 /// on-device widget inspector is visible.
128 ///
129 /// See also:
130 /// * [WidgetsApp.debugShowWidgetInspectorOverride], which is the flag that
131 /// this service extension exposes.
132 /// * [WidgetInspectorService.initServiceExtensions], where the service
133 /// extension is registered.
134 show,
135
136 /// Name of service extension that, when called, determines
137 /// whether a callback is invoked for every dirty [Widget] built each frame.
138 ///
139 /// See also:
140 ///
141 /// * [debugOnRebuildDirtyWidget], which is the nullable callback that is
142 /// called for every dirty widget built per frame
143 /// * [WidgetInspectorService.initServiceExtensions], where the service
144 /// extension is registered.
145 trackRebuildDirtyWidgets,
146
147 /// Name of service extension that, when called, determines whether
148 /// a callback is invoked for every [RenderObject] painted each frame.
149 ///
150 /// See also:
151 ///
152 /// * [debugOnProfilePaint], which is the nullable callback that is called for
153 /// every dirty widget built per frame
154 /// * [WidgetInspectorService.initServiceExtensions], where the service
155 /// extension is registered.
156 trackRepaintWidgets,
157
158 /// Name of service extension that, when called, will clear all
159 /// [WidgetInspectorService] object references in all groups.
160 ///
161 /// See also:
162 ///
163 /// * [WidgetInspectorService.disposeAllGroups], the method that this service
164 /// extension calls.
165 /// * [WidgetInspectorService.initServiceExtensions], where the service
166 /// extension is registered.
167 disposeAllGroups,
168
169 /// Name of service extension that, when called, will clear all
170 /// [WidgetInspectorService] object references in a group.
171 ///
172 /// See also:
173 ///
174 /// * [WidgetInspectorService.disposeGroup], the method that this service
175 /// extension calls.
176 /// * [WidgetInspectorService.initServiceExtensions], where the service
177 /// extension is registered.
178 disposeGroup,
179
180 /// Name of service extension that, when called, returns whether it is
181 /// appropriate to display the Widget tree in the inspector, which is only
182 /// true after the application has rendered its first frame.
183 ///
184 /// See also:
185 ///
186 /// * [WidgetInspectorService.isWidgetTreeReady], the method that this service
187 /// extension calls.
188 /// * [WidgetsBinding.debugDidSendFirstFrameEvent], which stores the
189 /// value of whether the first frame has been rendered.
190 /// * [WidgetInspectorService.initServiceExtensions], where the service
191 /// extension is registered.
192 isWidgetTreeReady,
193
194 /// Name of service extension that, when called, will remove the object with
195 /// the specified `id` from the specified object group.
196 ///
197 /// See also:
198 ///
199 /// * [WidgetInspectorService.disposeId], the method that this service
200 /// extension calls.
201 /// * [WidgetInspectorService.initServiceExtensions], where the service
202 /// extension is registered.
203 disposeId,
204
205 /// Name of service extension that, when called, will set the list of
206 /// directories that should be considered part of the local project for the
207 /// Widget inspector summary tree.
208 ///
209 /// See also:
210 ///
211 /// * [WidgetInspectorService.addPubRootDirectories], which should be used in
212 /// place of this method to add directories.
213 /// * [WidgetInspectorService.removePubRootDirectories], which should be used
214 /// in place of this method to remove directories.
215 /// * [WidgetInspectorService.initServiceExtensions], where the service
216 /// extension is registered.
217 @Deprecated(
218 'Use addPubRootDirectories instead. '
219 'This feature was deprecated after v3.18.0-2.0.pre.',
220 )
221 setPubRootDirectories,
222
223 /// Name of service extension that, when called, will add a list of
224 /// directories that should be considered part of the local project for the
225 /// Widget inspector summary tree.
226 ///
227 /// See also:
228 ///
229 /// * [WidgetInspectorService.addPubRootDirectories], the method that this
230 /// service extension calls.
231 /// * [WidgetInspectorService.removePubRootDirectories], which should be used
232 /// to remove directories.
233 /// * [WidgetInspectorService.pubRootDirectories], which should be used
234 /// to return the active list of directories.
235 /// * [WidgetInspectorService.initServiceExtensions], where the service
236 /// extension is registered.
237 addPubRootDirectories,
238
239 /// Name of service extension that, when called, will remove a list of
240 /// directories that should no longer be considered part of the local project
241 /// for the Widget inspector summary tree.
242 ///
243 /// See also:
244 ///
245 /// * [WidgetInspectorService.removePubRootDirectories], the method that this
246 /// service extension calls.
247 /// * [WidgetInspectorService.addPubRootDirectories], which should be used
248 /// to add directories.
249 /// * [WidgetInspectorService.pubRootDirectories], which should be used
250 /// to return the active list of directories.
251 /// * [WidgetInspectorService.initServiceExtensions], where the service
252 /// extension is registered.
253 removePubRootDirectories,
254
255 /// Name of service extension that, when called, will return the list of
256 /// directories that are considered part of the local project
257 /// for the Widget inspector summary tree.
258 ///
259 /// See also:
260 ///
261 /// * [WidgetInspectorService.pubRootDirectories], the method that this
262 /// service extension calls.
263 /// * [WidgetInspectorService.addPubRootDirectories], which should be used
264 /// to add directories.
265 /// * [WidgetInspectorService.removePubRootDirectories], which should be used
266 /// to remove directories.
267 /// * [WidgetInspectorService.initServiceExtensions], where the service
268 /// extension is registered.
269 getPubRootDirectories,
270
271 /// Name of service extension that, when called, will set the
272 /// [WidgetInspector] selection to the object matching the specified id and
273 /// will return whether the selection was changed.
274 ///
275 /// See also:
276 ///
277 /// * [WidgetInspectorService.setSelectionById], the method that this service
278 /// extension calls.
279 /// * [WidgetInspectorService.initServiceExtensions], where the service
280 /// extension is registered.
281 setSelectionById,
282
283 /// Name of service extension that, when called, will retrieve the chain of
284 /// [DiagnosticsNode] instances form the root of the tree to the [Element] or
285 /// [RenderObject] matching the specified id, passed as an argument.
286 ///
287 /// See also:
288 ///
289 /// * [WidgetInspectorService.getParentChain], which returns a json encoded
290 /// String representation of this data.
291 /// * [WidgetInspectorService.initServiceExtensions], where the service
292 /// extension is registered.
293 getParentChain,
294
295 /// Name of service extension that, when called, will return the properties
296 /// for the [DiagnosticsNode] object matching the specified id, passed as an
297 /// argument.
298 ///
299 /// See also:
300 ///
301 /// * [WidgetInspectorService.getProperties], which returns a json encoded
302 /// String representation of this data.
303 /// * [WidgetInspectorService.initServiceExtensions], where the service
304 /// extension is registered.
305 getProperties,
306
307 /// Name of service extension that, when called, will return the children
308 /// for the [DiagnosticsNode] object matching the specified id, passed as an
309 /// argument.
310 ///
311 /// See also:
312 ///
313 /// * [WidgetInspectorService.getChildren], which returns a json encoded
314 /// String representation of this data.
315 /// * [WidgetInspectorService.initServiceExtensions], where the service
316 /// extension is registered.
317 getChildren,
318
319 /// Name of service extension that, when called, will return the children
320 /// created by user code for the [DiagnosticsNode] object matching the
321 /// specified id, passed as an argument.
322 ///
323 /// See also:
324 ///
325 /// * [WidgetInspectorService.getChildrenSummaryTree], which returns a json
326 /// encoded String representation of this data.
327 /// * [WidgetInspectorService.initServiceExtensions], where the service
328 /// extension is registered.
329 getChildrenSummaryTree,
330
331 /// Name of service extension that, when called, will return all children and
332 /// their properties for the [DiagnosticsNode] object matching the specified
333 /// id, passed as an argument.
334 ///
335 /// See also:
336 ///
337 /// * [WidgetInspectorService.getChildrenDetailsSubtree], which returns a json
338 /// encoded String representation of this data.
339 /// * [WidgetInspectorService.initServiceExtensions], where the service
340 /// extension is registered.
341 getChildrenDetailsSubtree,
342
343 /// Name of service extension that, when called, will return the
344 /// [DiagnosticsNode] data for the root [Element].
345 ///
346 /// See also:
347 ///
348 /// * [WidgetInspectorService.getRootWidget], which returns a json encoded
349 /// String representation of this data.
350 /// * [WidgetInspectorService.initServiceExtensions], where the service
351 /// extension is registered.
352 getRootWidget,
353
354 /// Name of service extension that, when called, will return the
355 /// [DiagnosticsNode] data for the root [Element] of the summary tree, which
356 /// only includes [Element]s that were created by user code.
357 ///
358 /// See also:
359 ///
360 /// * [WidgetInspectorService.getRootWidgetSummaryTree], which returns a json
361 /// encoded String representation of this data.
362 /// * [WidgetInspectorService.initServiceExtensions], where the service
363 /// extension is registered.
364 getRootWidgetSummaryTree,
365
366 /// Name of service extension that, when called, will return the
367 /// [DiagnosticsNode] data for the root [Element] of the summary tree with
368 /// text previews included.
369 ///
370 /// The summary tree only includes [Element]s that were created by user code.
371 /// Text previews will only be available for [Element]s with a corresponding
372 /// [RenderObject] of type [RenderParagraph].
373 ///
374 /// See also:
375 ///
376 /// * [WidgetInspectorService.initServiceExtensions], where the service
377 /// extension is registered.
378 getRootWidgetSummaryTreeWithPreviews,
379
380 /// Name of service extension that, when called, will return the details
381 /// subtree, which includes properties, rooted at the [DiagnosticsNode] object
382 /// matching the specified id and the having a size matching the specified
383 /// subtree depth, both passed as arguments.
384 ///
385 /// See also:
386 ///
387 /// * [WidgetInspectorService.getDetailsSubtree], the method that this service
388 /// extension calls.
389 /// * [WidgetInspectorService.getDetailsSubtree], which returns a json
390 /// encoded String representation of this data.
391 /// * [WidgetInspectorService.initServiceExtensions], where the service
392 /// extension is registered.
393 getDetailsSubtree,
394
395 /// Name of service extension that, when called, will return the
396 /// [DiagnosticsNode] data for the currently selected [Element].
397 ///
398 /// See also:
399 ///
400 /// * [WidgetInspectorService.getSelectedWidget], which returns a json
401 /// encoded String representation of this data.
402 /// * [WidgetInspectorService.initServiceExtensions], where the service
403 /// extension is registered.
404 getSelectedWidget,
405
406 /// Name of service extension that, when called, will return the
407 /// [DiagnosticsNode] data for the currently selected [Element] in the summary
408 /// tree, which only includes [Element]s created in user code.
409 ///
410 /// If the selected [Element] does not exist in the summary tree, the first
411 /// ancestor in the summary tree for the currently selected [Element] will be
412 /// returned.
413 ///
414 /// See also:
415 ///
416 /// * [WidgetInspectorService.getSelectedSummaryWidget], which returns a json
417 /// encoded String representation of this data.
418 /// * [WidgetInspectorService.initServiceExtensions], where the service
419 /// extension is registered.
420 getSelectedSummaryWidget,
421
422 /// Name of service extension that, when called, will return whether [Widget]
423 /// creation locations are available.
424 ///
425 /// See also:
426 ///
427 /// * [WidgetInspectorService.isWidgetCreationTracked], the method that this
428 /// service extension calls.
429 /// * [WidgetInspectorService.initServiceExtensions], where the service
430 /// extension is registered.
431 isWidgetCreationTracked,
432
433 /// Name of service extension that, when called, will return a base64 encoded
434 /// image of the [RenderObject] or [Element] matching the specified 'id`,
435 /// passed as an argument, and sized at the specified 'width' and 'height'
436 /// values, also passed as arguments.
437 ///
438 /// See also:
439 ///
440 /// * [WidgetInspectorService.screenshot], the method that this service
441 /// extension calls.
442 /// * [WidgetInspectorService.initServiceExtensions], where the service
443 /// extension is registered.
444 screenshot,
445
446 /// Name of service extension that, when called, will return the
447 /// [DiagnosticsNode] data for the currently selected [Element] and will
448 /// include information about the [Element]'s layout properties.
449 ///
450 /// See also:
451 ///
452 /// * [WidgetInspectorService.initServiceExtensions], where the service
453 /// extension is registered.
454 getLayoutExplorerNode,
455
456 /// Name of service extension that, when called, will set the [FlexFit] value
457 /// for the [FlexParentData] of the [RenderObject] matching the specified
458 /// `id`, passed as an argument.
459 ///
460 /// See also:
461 ///
462 /// * [WidgetInspectorService.initServiceExtensions], where the service
463 /// extension is registered.
464 setFlexFit,
465
466 /// Name of service extension that, when called, will set the flex value
467 /// for the [FlexParentData] of the [RenderObject] matching the specified
468 /// `id`, passed as an argument.
469 ///
470 /// See also:
471 ///
472 /// * [WidgetInspectorService.initServiceExtensions], where the service
473 /// extension is registered.
474 setFlexFactor,
475
476 /// Name of service extension that, when called, will set the
477 /// [MainAxisAlignment] and [CrossAxisAlignment] values for the [RenderFlex]
478 /// matching the specified `id`, passed as an argument.
479 ///
480 /// The [MainAxisAlignment] and [CrossAxisAlignment] values will be passed as
481 /// arguments `mainAxisAlignment` and `crossAxisAlignment`, respectively.
482 ///
483 /// See also:
484 ///
485 /// * [WidgetInspectorService.initServiceExtensions], where the service
486 /// extension is registered.
487 setFlexProperties,
488}
489