ConnectionHandler mixin

ConnectionHandler listens to analysis server notifications and detects when a connection has been established with the server.

Clients may override onFailedToConnect, onProtocolNotSupported, and onServerError to display connection failure information.

Clients may mix-in this class, but may not extend or implement it.





server Server
Clients should implement this method to return the server being managed. This mixin will stop the server process if a connection cannot be established or if a server error occurs after connecting.
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited


checkServerProtocolVersion(Version version) → bool
Return true if the server's protocol is compatible.
onFailedToConnect() → void
onProtocolNotSupported(Version version) → void
onServerConnected(ServerConnectedParams params) → void
Reports that the server is running. This notification is issued once after the server has started running but before any requests are processed to let the client know that it started correctly. [...]
onServerError(ServerErrorParams params) → void
Reports that an unexpected error has occurred while executing the server. This notification is not used for problems with specific requests (which are returned as part of the response) but is used for exceptions that occur while performing other tasks, such as analysis or preparing notifications. [...]
serverConnected({Duration timeLimit }) → Future<bool>
Return a future that completes with a bool indicating whether a connection was successfully established with the server.
handleEvent(Notification notification) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
onAnalysisAnalyzedFiles(AnalysisAnalyzedFilesParams params) → void
Reports the paths of the files that are being analyzed. [...]
onAnalysisClosingLabels(AnalysisClosingLabelsParams params) → void
Reports closing labels relevant to a given file. [...]
onAnalysisErrors(AnalysisErrorsParams params) → void
Reports the errors associated with a given file. The set of errors included in the notification is always a complete list that supersedes any previously reported errors.
onAnalysisFlushResults(AnalysisFlushResultsParams params) → void
Reports that any analysis results that were previously associated with the given files should be considered to be invalid because those files are no longer being analyzed, either because the analysis root that contained it is no longer being analyzed or because the file no longer exists. [...]
onAnalysisFolding(AnalysisFoldingParams params) → void
Reports the folding regions associated with a given file. Folding regions can be nested, but will not be overlapping. Nesting occurs when a foldable element, such as a method, is nested inside another foldable element such as a class. [...]
onAnalysisHighlights(AnalysisHighlightsParams params) → void
Reports the highlight regions associated with a given file. [...]
onAnalysisImplemented(AnalysisImplementedParams params) → void
Reports the classes that are implemented or extended and class members that are implemented or overridden in a file. [...]
onAnalysisInvalidate(AnalysisInvalidateParams params) → void
Reports that the navigation information associated with a region of a single file has become invalid and should be re-requested. [...]
onAnalysisNavigation(AnalysisNavigationParams params) → void
Reports the navigation targets associated with a given file. [...]
onAnalysisOccurrences(AnalysisOccurrencesParams params) → void
Reports the occurrences of references to elements within a single file. [...]
onAnalysisOutline(AnalysisOutlineParams params) → void
Reports the outline associated with a single file. [...]
onAnalysisOverrides(AnalysisOverridesParams params) → void
Reports the overriding members in a file. [...]
onCompletionResults(CompletionResultsParams params) → void
Reports the completion suggestions that should be presented to the user. The set of suggestions included in the notification is always a complete list that supersedes any previously reported suggestions.
onExecutionLaunchData(ExecutionLaunchDataParams params) → void
Reports information needed to allow a single file to be launched. [...]
onFlutterOutline(FlutterOutlineParams params) → void
Reports the Flutter outline associated with a single file. [...]
onSearchResults(SearchResultsParams params) → void
Reports some or all of the results of performing a requested search. Unlike other notifications, this notification contains search results that should be added to any previously received search results associated with the same search id.
onServerStatus(ServerStatusParams params) → void
Reports the current status of the server. Parameters are omitted if there has been no change in the status represented by that parameter. [...]
onUnknownNotification(String event, dynamic params) → void
Reports a notification that is not processed by any other notification handlers.
toString() → String
Returns a string representation of this object.


operator ==(dynamic other) → bool
The equality operator.