Google is committed to advancing racial equity for Black communities. See how.

ComponentContext class

*[<Null safety>](https://dart.dev/null-safety)*

Context information that this component received at startup.

The ComponentContext holds references to the services and connections that the component was launched with. Authors can use the component context to access useful information for connecting to other components and interacting with the framework.

Constructors

ComponentContext ({required Incoming svc, required Outgoing outgoing})

This constructor is used by the modular test harness, but should not be used elsewhere. ComponentContext.create() and ComponentContext.createAndServe() should typically be used instead.

ComponentContext.create ()

Creates the component context. Users need to make sure that they call serve after they have finished adding all their public services. ... factory

ComponentContext.createAndServe ()

Creates a ComponentContext and immediately serves the outgoing. This method is useful for simple programs who do not have to do any complicated setup. ... factory

Properties

hashCode → int

The hash code for this object. ...
read-only, inherited

outgoingOutgoing

Services and data exposed to other components. ...
final

runtimeType → Type

A representation of the runtime type of the object.
read-only, inherited

svcIncoming

Services that are available to this component. ...
final

Methods

noSuchMethod(Invocation invocation) dynamic

Invoked when a non-existent method or property is accessed. ...
inherited

toString() String

A string representation of this object. ...
inherited

Operators

operator ==(Object other) bool

The equality operator. ...
inherited