我正在开发一个颤振插件,当使用这个插件时,我会得到Unable to load asset错误。当我使用插件的时候,我需要做一些特别的事情吗?
在主应用程序中加载图像没有问题。
来自pubspec.yaml:
flutter:
# To add assets to your plugin package, add an assets section, like this:
assets:
- icons/
- icons/myimage.png # << Just to show, that this also is not not working
uses
我正在用C#开发智能设备应用程序。我可以通过共享文件夹将图像添加到我的应用程序中。我通过在模拟器中做一些设置来共享文件夹。在模拟器中,通过设置->shared folder,我可以使用Bitmap()检索应用程序中的图像。但我想要显示应用程序文件夹中的这些图像。在我的应用程序中,我使用add -> New Folder添加了一个文件夹。因为我保留了我的图像。但是当我使用位图添加它们时,我得到了错误。如何从应用程序的本地文件夹添加图像?有什么办法吗?如果像我上面提到的那样只有一种方法,那么在不同的移动设备上部署应用程序后,我的应用程序能否成功地在这些设备上显示图像?
当我运行这个函数时,我得到了“无法访问资源”的错误。所有的.wav文件都存在于资产/音频文件夹中。
和我在lib/main.dart文件中编写了这个函数
所有文件都在音频文件夹中,如下所示
**i also added the assets in pubspc.yml file**
name: flutter_audio
description: Demonstrates how to use the flutter_audio_recorder plugin.
publish_to: 'none'
environment:
我更改sdk文件,然后在运行项目时显示此错误。
Warning! The 'flutter' tool you are currently running is from a different Flutter repository than the one last used by this package. The repository from which the 'flutter' tool is currently executing will be used instead.
running Flutter tool: C:\Users\LENO
我有图像,我想将它们加载到我的应用程序中。my_app/lib/... -这里是我的源文件my_app/assets/ images /... -这里是我的图像
我需要获取assets/images/中的文件列表,然后显示其中的一些文件(根据其他逻辑),我尝试这样做
final dir = Directory("assets/images/");
print(dir.existsSync()); // <---- it also print: false
var files = dir.listSync().toList();
files.forEach((e) =
我正在尝试一个简单的颤振应用程序。它在网上运行得很好。但是在android上,图像不能加载。
这是我的pubspec.yaml
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your applicat