getContext method

  1. @Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')
  2. @Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')
Object? getContext (
  1. String contextId,
  2. [Map? attributes]
)
@Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2'), @Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')

Implementation

@Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')
@Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')
Object? getContext(String contextId, [Map? attributes]) {
  if (attributes != null) {
    var attributes_1 = convertDartToNative_Dictionary(attributes);
    return _getContext_1(contextId, attributes_1);
  }
  return _getContext_2(contextId);
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-html/CanvasElement/getContext.html