Conversation
Contributor
Reviewer's GuideAdds a Flutter DevTools extension for Talker logs and wires it into talker_flutter so DevTools can pull log history via a VM service extension in debug mode, plus minor example and platform updates. Sequence diagram for DevTools fetching Talker logs via VM service extensionsequenceDiagram
actor DevToolsUser
participant DevToolsUI
participant TalkerDevToolsExtension
participant DevToolsExtensionFramework
participant ServiceManager
participant VmServiceExtension
participant TalkerDevTools
participant Talker
DevToolsUser->>DevToolsUI: Open DevTools and select Talker tab
DevToolsUI->>TalkerDevToolsExtension: Build TalkerLogsScreen
TalkerDevToolsExtension->>ServiceManager: callServiceExtensionOnMainIsolate(ext.talker_flutter.getLogs, since)
ServiceManager->>VmServiceExtension: ext.talker_flutter.getLogs(since)
VmServiceExtension->>TalkerDevTools: _serviceExtensionHandler(method, params)
TalkerDevTools->>Talker: Read history
Talker-->>TalkerDevTools: List<TalkerData>
TalkerDevTools-->>VmServiceExtension: ServiceExtensionResponse.result(jsonEncode({logs,total}))
VmServiceExtension-->>ServiceManager: Response.json
ServiceManager-->>TalkerDevToolsExtension: Map result
TalkerDevToolsExtension->>TalkerLogsScreen: setState with new _logs and _lastSeenIndex
DevToolsUI-->>DevToolsUser: Render updated log list
Class diagram for Talker DevTools integration and extension UIclassDiagram
class Talker {
List~TalkerData~ history
}
class TalkerData {
String message
String key
TalkerLogLevel logLevel
String title
DateTime time
StackTrace stackTrace
Object exception
Object error
}
class TalkerDevTools {
<<static>>
-TalkerDevTools_()
-static Talker _devToolsTalker
-static bool _extensionRegistered
-static const String _extensionMethodName
+static void register(Talker talker)
-static void _ensureExtensionRegistered()
-static Future serviceExtensionHandler(String method, Map~String,String~ params)
-static Map~String,dynamic~ _talkerDataToJson(TalkerData data, int index)
}
class TalkerFlutterExtension {
<<extension on Talker>>
+static Talker init(TalkerLogger logger, TalkerObserver observer, TalkerSettings settings, TalkerFilter filter)
}
class TalkerDevToolsExtension {
<<StatelessWidget>>
+TalkerDevToolsExtension()
+Widget build(BuildContext context)
}
class DevToolsExtensionWidget {
<<Widget from devtools_extensions>>
+Widget child
}
class TalkerLogsScreen {
<<StatefulWidget>>
+TalkerLogsScreen()
+State createState()
}
class TalkerLogsScreenState {
<<State>>
-List~Map~String,dynamic~~ _logs
-int _lastSeenIndex
-Timer _pollTimer
-String _error
-bool _loading
+void initState()
+void dispose()
-Future _fetchLogs()
+Widget build(BuildContext context)
-Widget _buildBody(BuildContext context)
}
class LogEntryTile {
<<StatefulWidget>>
+LogEntryTile(Map~String,dynamic~ log)
+Map~String,dynamic~ log
+State createState()
}
class LogEntryTileState {
<<State>>
-bool _expanded
+Widget build(BuildContext context)
-Color _colorForLevel(String level)
}
class DetailBlock {
<<StatelessWidget>>
+DetailBlock(String title, String content)
+Widget build(BuildContext context)
}
TalkerDevTools ..> Talker : uses for history
TalkerDevTools ..> TalkerData : serializes
TalkerFlutterExtension ..> TalkerDevTools : calls register in kDebugMode
TalkerDevToolsExtension ..|> StatelessWidget
TalkerLogsScreen ..|> StatefulWidget
TalkerLogsScreenState ..|> State
LogEntryTile ..|> StatefulWidget
LogEntryTileState ..|> State
DetailBlock ..|> StatelessWidget
TalkerDevToolsExtension o--> DevToolsExtensionWidget : wraps as child
DevToolsExtensionWidget o--> TalkerLogsScreen : child
TalkerLogsScreen o--> TalkerLogsScreenState : creates
LogEntryTile o--> LogEntryTileState : creates
LogEntryTileState o--> DetailBlock : displays details
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Any way to change the title from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Add a Flutter DevTools extension for Talker and wire Talker instances to expose their logs to the extension in debug mode.
New Features:
Enhancements:
Tests: