| |
| |
| |
| # ComponentContext.createAndServe constructor |
| |
| |
| |
| |
| *[<Null safety>](https://dart.dev/null-safety)* |
| |
| |
| |
| ComponentContext.createAndServe() |
| |
| |
| <p>Creates a ComponentContext and immediately serves the outgoing. This |
| method is useful for simple programs who do not have to do any complicated |
| setup.</p> |
| <p>Note: ComponentContext can only be constructed once.</p> |
| <p>Example:</p> |
| <pre class="language-dart"><code>void main() { |
| final context = ComponentContext.createAndServe(); |
| ... |
| } |
| </code></pre> |
| |
| |
| |
| ## Implementation |
| |
| ```dart |
| factory ComponentContext.createAndServe() { |
| return ComponentContext.create()..outgoing.serveFromStartupInfo(); |
| } |
| ``` |
| |
| |
| |
| |
| |
| |
| |