getContext method
Implementation
CanvasRenderingContext2D getContext(String type, { options }) {
switch (type) {
case '2d':
if (painter.context == null) {
context2d ??= CanvasRenderingContext2D(this);
painter.context = context2d;
}
return painter.context!;
default:
throw FlutterError('CanvasRenderingContext $type not supported!');
}
}