createTexture static method

Texture createTexture(
  1. int textureId,
  2. TextureCreatedCallback textureCreatedCallback
)

Implementation

static Texture createTexture(int textureId, TextureCreatedCallback textureCreatedCallback) {
  if (!textureIds.contains(textureId)) {
    textureIds.add(textureId);
    SchedulerBinding.instance.addPostFrameCallback((_){
      //call the callback after the Texture is attach to the hierarchy
      textureCreatedCallback(textureId);
    });
  }
  return Texture(textureId: textureId);
}