TextSymbol constructor

TextSymbol({
  1. String text = '',
  2. Color color = const Color(0xFF000000),
  3. double size = 8.0,
  4. HorizontalAlignment horizontalAlignment = HorizontalAlignment.center,
  5. VerticalAlignment verticalAlignment = VerticalAlignment.middle,
})

Creates a text symbol with the given size, text, and color along with the horizontal and vertical alignment relative to the mid-point of this symbol.

Parameters:

  • text — The text to be displayed.
  • color — The color of the text symbol.
  • size — The size of the text symbol.
  • horizontalAlignment — The horizontal alignment of the text.
  • verticalAlignment — The vertical alignment of the text.

Implementation

factory TextSymbol({
  String text = '',
  Color color = const Color(0xFF000000),
  double size = 8.0,
  HorizontalAlignment horizontalAlignment = HorizontalAlignment.center,
  VerticalAlignment verticalAlignment = VerticalAlignment.middle,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreText = _CString(text);
  final coreColor = color.toArcGIS();
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_TextSymbol_createWith(
      coreText.bytes,
      coreColor._handle,
      size,
      horizontalAlignment.coreValue,
      verticalAlignment.coreValue,
      errorHandler,
    );
  });
  final TextSymbol object = ArcGISSymbol._instanceCache.instanceWith(handle);
  object._color.cache(color);
  return object;
}