Dart资源包抛出Flutter中不受支持的操作 [英] Dart resource package throws Unsupported operation in Flutter

查看:97
本文介绍了Dart资源包抛出Flutter中不受支持的操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Flutter项目使用了自己开发的Dart程序包,而该程序包又依赖于资源程序包.在Flutter专案中使用我的套件时,只要碰到使用诸如 resource.readAsString(encoding:utf8) 这样的资源的行,就会抛出 Unsupported operation :

My Flutter project uses an own developed Dart package that in turn depends on the resource package. Using my package in a Flutter project throws an Unsupported operation as soon as it hits a line where resource is used like this resource.readAsString(encoding: utf8):

  Unsupported operation: Isolate.resolvePackageUri
  dart:isolate                              Isolate.resolvePackageUri
  package:resource/src/resolve.dart 11:20   resolveUri
  package:resource/src/resource.dart 74:21  Resource.readAsString

是否有办法使它正常工作?或者,我应该在某处报告错误吗?

Is there a way to get this to work? Or alternatively, should I report a bug somewhere?

推荐答案

在撰写本文时,Flutter仍不支持 Isolate.resolvePackageUri()方法.

At the time of writing, the Isolate.resolvePackageUri() method is still not supported on Flutter.

请参阅GitHub问题#14815:
https://github.com/flutter/flutter/issues/14815

See the GitHub issue #14815:
https://github.com/flutter/flutter/issues/14815

所以:

  • 是否有办法使其正常工作?否.您必须避免使用程序包URI(以及处理它们的所有API/库).
  • 我应该在某处报告错误吗?否.此问题已在GitHub问题跟踪器上提出.
  • Is there a way to get this to work? No. You must avoid package URIs (and all APIs / libraries dealing with them).
  • Should I report a bug somewhere? No. This issue was already raised on the GitHub issue tracker.

这篇关于Dart资源包抛出Flutter中不受支持的操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆