[英]How to get annotation field names in when generating code with source_gen
我正在嘗試實現基於source_gen的生成器。 它將處理使用ClassAnnotation注釋的類並作用於使用各種注釋注釋的字段,所有這些都是“標記”接口FieldAnnotationMarker的子類型。 以下是 2 個此類注釋的示例: @immutable @Target({TargetKin ...
[英]How to get annotation field names in when generating code with source_gen
我正在嘗試實現基於source_gen的生成器。 它將處理使用ClassAnnotation注釋的類並作用於使用各種注釋注釋的字段,所有這些都是“標記”接口FieldAnnotationMarker的子類型。 以下是 2 個此類注釋的示例: @immutable @Target({TargetKin ...
[英]Error using source generator from a source generator package
我正在編寫一個 dart 源代碼生成器,其中一些模型使用json_serializable 。 最初源代碼生成在一段時間內運行良好,但現在當我運行dart run build_runner build --delete-conflicting-outputs時出現錯誤: [INFO] 生成構建腳 ...
[英]Flutter: code analysis and layout explorer in code at build time
我是 flutter 的新手,所以我希望我的問題不會超出 scope 的范圍: 我想在構建時提取有關應用程序的元信息。 這個想法是有一個 JSON map 如何構建小部件,並通過 API 調用將其發送到外部數據庫。 這是我的應用程序結構的簡化示例Scaffold ├─ Page1: homePage ...
[英]Error while running built value generator
嘗試使用內置值生成器時出錯這是我得到的錯誤。 我正在使用的 class 運行內置值生成器 ...
[英]Flutter Gradle Build Failed
以前,我有一個問題。 而不是得到一個 output,我總是遇到這個。 后來我找到了這個解決方案。 不管是什么建議,我得到了這個: 請幫我。 ...
[英]Trying to create a custom builder results in a non unique output error
我正在嘗試為我的 Flutter 項目創建自定義構建器。 我想實現類似於 built_value 代碼生成的東西。 我首先在項目的根文件夾中創建build.yaml 然后在app/db/build/builder.dart實現dbBuilder工廠 DBAccessGenerator是一個空的 c ...
[英]inject-dart Failed to snapshot build script .dart_tool/build/entrypoint/build.dart. This is likely caused by a misconfigured builder definition
我試圖按照這篇文章使用 Google 的inject-dart 但是當我嘗試使用 build-runner 生成代碼時,我看到了這個錯誤。 [嚴重] 無法快照構建 script.dart_tool/build/entrypoint/build.dart。 這可能是由錯誤配置的構建器定義引起的。 ...
[英]dart build: Need to inject an asset from an application into a dependency package
背景:我有一個包含Angular(5.0.0,Dart 2.0.0)組件(我們稱其為my_components )的程序包,我在許多客戶項目( app_1 , app_2 ,...)中使用了該組件。 這些應用程序必須覆蓋我必須反映客戶公司標識的幾乎每個組件的某些CSS屬性(例如顏色)。 顯而 ...
[英]Dart `build_config` rename `buildStep.inputId` file
我想在Builder重命名文件(而不僅僅是擴展名)。 有什么原因我不應該僅基於buildStep.inputId創建自己的File並將其寫入文件嗎? ...
[英]Dart Analyzer: Find instances of a class or its descendants
我正在使用build包來獲取.dart文件,並尋找某個類或其子類的定義。 ClassElement可以用於子類嗎? 我只希望特定類的單個定義位於項目的一個文件中,但是沒有理由客戶不能繼承子類並且變得瘋狂。 ...
[英]Change webdev serve directory
假裝我在.../web/main.dart有一個文件,當我為應用程序提供服務時( webdev serve web:8080 ),它將位於localhost:8080/main.dart.js ,而軟件包位於localhost:8080/packages/是否可以將它們移至localhost:8 ...
[英]Where is build.yaml file in Flutter project?
我在flutter項目中尋找build.yaml文件,但是找不到。 有什么辦法可以編輯這個文件嗎? ...