initResources method

Future<void> initResources(
  1. SymbolCache? symbolCache
)

Implementation

Future<void> initResources(SymbolCache? symbolCache) async {
  await initBitmap(symbolCache);
  if (fill == null && fillColor != null) {
    this.fill = GraphicFactory().createPaint();
    this.fill!.setColorFromNumber(fillColor!);
    this.fill!.setStyle(Style.FILL);
    if (bitmap != null) {
      // make sure the color is not transparent
      if (fill!.isTransparent()) fill!.setColorFromNumber(0xff000000);
      fill!.setBitmapShader(bitmap!);
    }
  }
  if (stroke == null && strokeWidth > 0) {
    this.stroke = GraphicFactory().createPaint();
    this.stroke!.setColorFromNumber(strokeColor);
    this.stroke!.setStyle(Style.STROKE);
    this.stroke!.setStrokeWidth(strokeWidth);
    this.stroke!.setStrokeDasharray(strokeDasharray);
    if (bitmap != null) {
      // make sure the color is not transparent
      if (stroke!.isTransparent()) stroke!.setColorFromNumber(0xff000000);
      stroke!.setBitmapShader(bitmap!);
    }
  }
}