precache static method

Future<void> precache()

预编译着色器,避免使用首帧卡顿。建议在 main() 中 runApp 之前调用。

Implementation

static Future<void> precache() async {
  if (!ui.ImageFilter.isShaderFilterSupported) return;
  _program ??= await ui.FragmentProgram.fromAsset(shaderAssetKey);
}