Closed cattlelovegrass closed 9 months ago
Did you import dart:io?
Did you import dart:io?
YES, this library is Imported
Error: dart_eval runtime exception: RangeError (index): Index out of range: no indices are valid: 0 dart-sdk/lib/_internal/js_dev_runtime/private/ddcruntime/errors.dart 294:3 throw dart-sdk/lib/_internal/js_dev_runtime/private/js_array.dart 600:7 _get] packages/dart_eval/src/eval/shared/stdlib/io/file.dart 276:32 $new dart-sdk/lib/_internal/js_dev_runtime/private/ddcruntime/errors.dart 294:3 throw packages/dart_eval/src/eval/runtime/runtime.dart 832:7 execute packages/dart_eval/src/eval/runtime/runtime.dart 810:12 executeLib packages/example/main.dart 146:10
I add breakpoint, It throws error: static $File $new(Runtime runtime, $Value? target, List<$Value?> args) { return $File.wrap(File(args[0]!.$value)); } List<$Value?> args IS Empty, the console shows args size is 0
Yes ok I will fix that.
You cannot use File
when compiling to Web / JS platform though.
Yes ok I will fix that. You cannot use
File
when compiling to Web / JS platform though.
constructors: { '': BridgeConstructorDef(BridgeFunctionDef( returns: BridgeTypeAnnotation($type), params: [ BridgeParameter('path', BridgeTypeAnnotation(BridgeTypeRef(CoreTypes.string)), false), ], namedParams: [])) }, You just add path to Constructor params, then args[0] is not empty,
closed
This fix is now released in version 0.7.7
File("asset/3.0x/battery_box_bg.png");