[英]How to import a library in flutter?
我對 flutter 非常陌生,我想在我的項目中使用這個庫,但我收到以下錯誤。 請問,有什么建議嗎?
https://pub.dev/packages/bls_signatures_ffi
* What went wrong:
Execution failed for task ':bls_signatures_ffi:generateJsonModelDebug'.
> exception while building Json $C:\Users\razia\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\bls_signatures_ffi-0.1.0\android\.cxx\cmake\debug\armeabi-v7a\_deps\bls-src\.git\objects\pack\pack-a40d22d0092127754e8a2691ff349c3bc271c942.idx
local.properties 文件
sdk.dir=C\:\\Users\\razia\\AppData\\Local\\Android\\sdk
flutter.sdk=C\:\\Program Files\\flutter\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
Depend on it
1.**Open the pubspec.yaml file located inside the app folder, and add css_colors: under dependencies.
Install it**
2.**From the terminal: Run flutter pub get.
OR
From Android Studio/IntelliJ: Click Packages get in the action ribbon at the top of pubspec.yaml.
From VS Code: Click Get Packages located in right side of the action ribbon at the top of pubspec.yaml.**
3.**Import it
Add a corresponding import statement in the Dart code.
Stop and restart the app, if necessary
If the package brings platform-specific code (Kotlin/Java for Android, Swift/Objective-C for iOS), that code must be built into your app. Hot reload and hot restart only update the Dart code, so a full restart of the app might be required to avoid errors like MissingPluginException when using the package.**
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.