Print DevTools inspector links in RenderFlex Overflow errors#74251
Print DevTools inspector links in RenderFlex Overflow errors#74251fluttergithubbot merged 15 commits intoflutter:masterfrom
Conversation
| import 'dart:ui' as ui; | ||
|
|
||
| import 'package:flutter/foundation.dart'; | ||
| import 'package:flutter/src/widgets/framework.dart'; |
There was a problem hiding this comment.
This is a layering violation - rendering shouldn't know about widgets. I would ask the framework folks what a better way to structure this would be.
There was a problem hiding this comment.
@goderbauer do you have some guidance here? we need access to some of the code in widget_inspector.dart
There was a problem hiding this comment.
Could you utilise a DiagnosticPropertiesTransformer (added to FlutterErrorDetails.propertiesTransformers [1]) to change the information collected in a lower level to something more actionable in a higher level?
We use this mechanism to enrich errors in the rendering layer with additional information from the widget layer.
[1] https://master-api.flutter.dev/flutter/foundation/FlutterErrorDetails/propertiesTransformers.html
There was a problem hiding this comment.
It looks like this method already dips into that mechanism: line 265 below adds a DiagnosticsDebugCreator, which gets processed by the widget_insepctor (via one of those transformers) here:
You may be able to reuse that transformer (or add a new one for your purposes).
There was a problem hiding this comment.
Moved error diagnostic code into property transformer. @goderbauer PTAL
1492b03 to
7ac18e9
Compare
packages/flutter_tools/test/integration.shard/flutter_attach_test.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/test/integration.shard/flutter_run_test.dart
Outdated
Show resolved
Hide resolved
|
I'm going to try to fix run_cold.dart so that run always calls attach |
packages/flutter/lib/src/rendering/debug_overflow_indicator.dart
Outdated
Show resolved
Hide resolved
| /// * [BindingBase.initServiceExtensions], which explains when service | ||
| /// extensions can be used. | ||
| void initServiceExtensions(_RegisterServiceExtensionCallback registerServiceExtensionCallback) { | ||
| developer.Service.getInfo().then((developer.ServiceProtocolInfo info) { |
There was a problem hiding this comment.
This will need to be conditionally disabled on the web.
| } | ||
| vmService.onExtensionEvent.listen((vm_service.Event event) { | ||
| if (event.json['extensionKind'] == 'Flutter.FrameworkInitialization') { | ||
| completer.complete(); |
There was a problem hiding this comment.
It looks like there can be more than one of these.
There was a problem hiding this comment.
See - #74407. Working on a fix now. Have the fix - just working on the test.
activeDevToolsServerAddressservice extension to Flutter. flutter_tools will invoke this on run and attach, at which point the value will be the address of the server flutter_tools launched or the address that was provided via the--devtools-server-addressflag.@helin24 @jacob314 @jonahwilliams