草庐IT

assets-library

全部标签

flutter - 如何使用视频播放器插件播放存储在作为数组引用的 Assets 文件夹中的视频列表

import'package:video_player/video_player.dart';import'package:flutter/material.dart';voidmain()=>runApp(VideoApp());classVideoAppextendsStatefulWidget{@override_VideoAppStatecreateState()=>_VideoAppState();}class_VideoAppStateextendsState{varvidlist=['assets/videos/1.mp4','assets/videos/2.m4','a

flutter - 如何找到 Flutter 应用程序的 "assets"文件夹的绝对路径?

这是我的设置pubspec.yaml...path_provider:^0.4.1assets:-assets/-assets/a.txt...我试图找到访问“assets”目录的方法来读取名为“a.txt”的文本文件的内容,它应该以相对方式读取为“assets/a.txt”。这是我的代码主Dart:DirectoryappDocDir=awaitgetApplicationDocumentsDirectory();StringappDocPath=appDocDir.path;StringfPath='${appDocDir.parent.path}/assets/a.txt';ne

android-studio - 错误 : unable to locate asset entry in pubspec. yaml: "assets/CupertinoIcons.ttf"

将androidstudio升级到3.2.1和flutter插件后,我无法运行我的应用程序,出现以下错误:Error:unabletolocateassetentryinpubspec.yaml:"assets/CupertinoIcons.ttf".Errorbuildingassetsflutterdoctor-v[√]Flutter(Channeldev,v0.10.1,onMicrosoftWindows[Versión10.0.17763.134],localees-ES)•Flutterversion0.10.1atc:\flutter•Frameworkrevision

dart - Flutter - 从 Assets 中读取文本文件

我有一个文本文件(.txt),我希望它成为我可以稍后扫描的Assets。在pubspec.yaml中,我确保:flutter:assets:-res/my_file.txt存在。该文件位于我创建的res/文件夹中,与lib/android/和ios/处于同一级别我正在尝试从自定义类而不是小部件中读取文件。根据文档,我要使用这个导入:import'package:flutter/services.dart'showrootBundle;然后像这样开始阅读:///Assumesthegivenpathisatext-file-asset.FuturegetFileData(Stringpa

android - Flutter 插件开发 : importing libraries

我正在尝试为Flutter创建一个Facebook登录插件,并且已经运行了native代码。不过有一件事我不明白。依赖项、使用权限和元数据去哪里了?我想可以将依赖项和权限添加到插件的android文件夹中。但是元数据需要一个只有用户才能提供的key。所以我不能把它放在我的插件的android文件夹中,只能放在使用该插件的项目中的android文件夹中。但我需要元数据才能使插件正常工作。所以我有点卡住了。谁有这方面的经验? 最佳答案 可以在插件的build.gradle和podspec中添加依赖。尽管如果它依赖于非标准的Maven或C

android - Flutter Assets 包位于何处?

docs说Duringabuild,Flutterplacesassetsintoaspecialarchivecalledtheassetbundle,whichappscanreadfromatruntime.如果我想在像webviews这样的地方引用Assets文件夹,我不能这样做,因为我不知道Assets文件夹在设备上的路径。我尝试了file:///android_assets网址,但它不起作用。具体来说,我希望获得this工作。 最佳答案 您可以从native代码访问flutterAssets。参见Sharingasset

android - 必须设置图像 Assets 图标名称

将图像Assets添加到我的flutter应用程序时,无论我设置什么名称,错误仍然相同并拒绝添加图像我的flutterdoctor输出/home/ahmed/flutter/bin/flutter--no-colordoctorDoctorsummary(toseealldetails,runflutterdoctor-v):[✓]Flutter(Channelbeta,v0.5.1,onLinux,localeen_US.UTF-8)[✓]Androidtoolchain-developforAndroiddevices(AndroidSDK27.0.3)[✓]AndroidStud

android - Flutter release app native crash, abort error [FATAL :flutter/shell/platform/android/library_loader. cc(24)] 检查失败:结果

以下是崩溃日志:Buildfingerprint:'google/walleye/walleye:9/PPR2.181005.003/4984323:user/release-keys'Revision:'MP1'ABI:'arm'pid:17914,tid:17914,name:yapp.mobile.app>>>myapp.mobile.app我意识到yapp.mobile.app与我的applicationId(myapp.mobile.app)不匹配,我想知道是否这会导致问题。另外,从它的外观来看,它可能是我的sqlite库,它来自使用sflite进行flutter的flutt

android - Flutter/Dart,无法将变量设置为 json Assets 中的值

我的Assets文件夹中有一个json文件。json文件保存我的设置页面上开关的状态。我有一些代码可以读取t5hejson文件并对其进行解码。JSON:{"ThemeColour":"blue","HighlightState":false,"DisplayState":true}代码:classSettings{finalStringthemeColour;finalboolhighlightState;finalbooldisplayState;Settings(this.themeColour,this.highlightState,this.displayState);}cla

java - 访问flutter assets时出现File not Found异常

我正在尝试编写一个插件来播放存储在flutter包的assets文件夹中的音频文件,并且这样做了if(call.method.equals("playMusic")){Log.d(TAG,"onMethodCall:playmusicfunctioncalled");StringfileLocation=call.argument("file");Log.d(TAG,"onMethodCall:filerequestedis"+fileLocation);AssetManagerassetManager=registrar.context().getAssets();Stringkey