getAssetAbsolutePath method Null safety

Future<String?> getAssetAbsolutePath(
  1. String assetPath
)

通过 asset 的相对路径获取绝对路径。

  • assetPathpubspec.yamlflutter -> assets 字段中配置的 asset 路径, 例如: assets/Sound_Horizon.mp3
  • 返回绝对路径的地址。

Implementation

Future<String?> getAssetAbsolutePath(String assetPath) {
  return RtcEngine.methodChannel
      .invokeMethod('getAssetAbsolutePath', assetPath);
}