Texture texture

The texture that the sprite will render to screen. Cannot be null.

my9Sprite.texture = myTexture;

Source

Texture get texture => _texture;
void texture=(Texture texture)

Source

set texture(Texture texture) {
  _texture = texture;
  _isDirty = true;
  if (texture == null) {
    _cachedPaint = new Paint();
  } else {
    Matrix4 matrix = new Matrix4.identity();
    ImageShader shader = new ImageShader(texture.image,
      TileMode.repeated, TileMode.repeated, matrix.storage);

    _cachedPaint = new Paint()
      ..shader = shader;
  }
}