start static method

Future<StyletInkTrail> start({
  1. required Color color,
  2. required double diameter,
  3. Element? presentationArea,
})

Requests a compositor presenter and starts forwarding trusted pen moves.

Implementation

static Future<StyletInkTrail> start({
  required Color color,
  required double diameter,
  web.Element? presentationArea,
}) async {
  _validateDiameter(diameter);
  final _Ink? ink = _browserInk();
  if (ink == null) {
    throw UnsupportedError('The browser does not support the Ink API.');
  }
  final web.Element area = presentationArea ?? _flutterPresentationArea();
  final _DelegatedInkTrailPresenter presenter = await ink
      .requestPresenter(_InkPresenterOptions(presentationArea: area))
      .toDart;
  return StyletInkTrail._(presenter, area, color, diameter);
}