resource
resource copied to clipboard
Unsupported scheme when using package: uri
Running the simple test below in dartium gives Unsupported scheme
error. Not an expert but it seems the :
is unwillingly encoded?
test("broken http scheme", () async {
var loadInfoText = await new Resource('package:test.txt').readAsString();
expect(loadInfoText, equals('text'));
});
for example:
Unsupported operation: Unsupported scheme: http%3A//localhost:43551/mcJCoZomCMCstSKrssXwPq90z9HKv%252B50/test/scanner/packages/test.txt
package:resource/src/io_html.dart 50:3 readAsString.<async>
===== asynchronous gap ===========================
dart:async _Completer.completeError
package:resource/src/io_html.dart 53:1 readAsString.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
package:resource/src/io_html.dart readAsString
package:resource/src/resource_loader.dart 69:7 DefaultLoader.readAsString
package:resource/src/resource.dart 74:20 Resource.readAsString.<async>
===== asynchronous gap ===========================
dart:async _asyncThenWrapperHelper
package:resource/src/resource.dart Resource.readAsString
res_test.dart 8:63 main.<fn>.<async>
===== asynchronous gap ===========================
dart:async Future.Future.microtask
res_test.dart main.<fn>
While debugging, it seems Isolate.resolvePackageUri(uri)
is returning this. It looks like a bug in dartium to me.
Any movement on this issue?
See: https://github.com/flutter/flutter/issues/14815