attach method

void attach(
  1. ComponentRuntime runtime
)

Implementation

void attach(ComponentRuntime runtime) {
  if (attached) {
    if (_runtime != runtime) {
      throw StateError('Component already attached to different runtime');
    }
    return;
  }

  attached = true;
  _runtime = runtime;

  for (final style in styles) {
    runtime.styles.use(style);
  }
}