Closed p-mazhnik closed 1 year ago
The pubspec.yaml
has a specific reference to the asset file. Do you think this has any influence on this issue?
No, this is only to locate asset within the package:
pathInPackage
= packages/flutter_dropzone_web/assets/flutter_dropzone.js
.
Current issue is that code assumes that url for this asset within the app will be
assets/
+ $pathInPackage
= assets/packages/flutter_dropzone_web/assets/flutter_dropzone.js
, which is not always true, because it can be $assetBase
+ assets/
+ $pathInPackage
. That is what getAssetUrl
utility is for:
getAssetUrl(pathInPackage)
=> $assetBase
+ $assetsDirectory
+ $pathInPackage
Let's see, thanks.
In Flutter it is possible to customize the location that assets will be loaded from (e.g. using
assetBase
meta tag or providing this property to engine initializer directly) Current solution assumes that script is always under<rootUrl>/assets/
directory, which is not true ifassetBase
is used. So in the current PR I usegetAssetUrl
utility provided by Flutter that respectsassetBase
https://github.com/flutter/engine/blob/942909b77001b4904e26aa29e3cac63345108a0a/lib/web_ui/lib/ui_web/src/ui_web/asset_manager.dart#L76-L81