You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FilePickerResult? result = await FilePicker.platform.pickFiles(allowMultiple: true);
if (result != null) {
for(int x = 0; x < result.files.length; x++) {
print(result.files[x].name);
Uint8List bytes = result.files[x].bytes as Uint8List;
final metadata = await MetadataRetriever.fromBytes(bytes); // throws the error
String? trackName = metadata.trackName;
print(trackName);
[...]
I checked this with mp3, m4a and wmv files. It only occurs on Flutter web. If the audio files contain an album art everything works fine. If they do not contain an album art, I get the following error message:
let metadata = new (T.IdentityMapOfString$dynamic()).from(["metadata", new _js_helper.LinkedMap.new(), "albumArt", convert.base64Decode(core.String.as(dart.dsend(rawMetadataJson, '_get', ["Cover_Data"]))), "filePath", null]);
I cannot read nor write .js :) but it looks like a null check is missing?
What else do you need?
Thanks,
Michael
The text was updated successfully, but these errors were encountered:
Error: Expected a value of type 'String', but got one of type 'Null'
dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49 throw
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 99:3 castError
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 452:10 cast
dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 705:17 as
packages/flutter_media_metadata/src/flutter_media_metadata_web.dart 111:31
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 334:14 _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 339:39 dcall
Application finished.
Hi,
Following piece of code:
[...]
I checked this with mp3, m4a and wmv files. It only occurs on Flutter web. If the audio files contain an album art everything works fine. If they do not contain an album art, I get the following error message:
Error: Expected a value of type 'String', but got one of type 'Null'
at Object.throw_ [as throw] (http://localhost:50323/dart_sdk.js:5067:11)
at Object.castError (http://localhost:50323/dart_sdk.js:5026:15)
at Object.cast [as as] (http://localhost:50323/dart_sdk.js:5351:17)
at Function.as (http://localhost:50323/dart_sdk.js:46170:19)
at http://localhost:50323/packages/flutter_media_metadata/src/flutter_media_metadata_web.dart.lib.js:89:159
at Object._checkAndCall (http://localhost:50323/dart_sdk.js:5274:16)
at Object.dcall (http://localhost:50323/dart_sdk.js:5279:17)
at ret (http://localhost:50323/dart_sdk.js:62346:21)
Afaik this relates to the following line of code:
let metadata = new (T.IdentityMapOfString$dynamic()).from(["metadata", new _js_helper.LinkedMap.new(), "albumArt", convert.base64Decode(core.String.as(dart.dsend(rawMetadataJson, '_get', ["Cover_Data"]))), "filePath", null]);
I cannot read nor write .js :) but it looks like a null check is missing?
What else do you need?
Thanks,
Michael
The text was updated successfully, but these errors were encountered: