hasAsset property

Future<bool> get hasAsset

是否包含asset文件

Implementation

Future<bool> get hasAsset async {
  if (this.isEmptyString) {
    return false;
  }
  final encoded = utf8.encoder.convert(Uri(path: Uri.encodeFull(this!)).path);
  final asset =
      await ServicesBinding.instance.defaultBinaryMessenger.send('flutter/assets', encoded.buffer.asByteData());
  return asset != null;
}