搜尋套件、儲存庫與 APP 分類

套件詳情v1.19.0

meta

用於表達開發人員意圖的註解,這些意圖無法透過靜態分析來推斷來源碼。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
2060萬
喜歡數
481
Pub 分數
150

安裝套件

flutter pub add meta

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

元套件提供 Dart 中的註解,讓開發者能夠表達靜態分析無法推斷的意圖。這些註解(例如 @required 和 @deprecated)透過向編譯器、檢查工具和 IDE 傳遞語義資訊,增強了程式碼的清晰度與工具支援。它們對於記錄行為、強制約束以及實現更好的程式碼維護至關重要。此套件是 Dart SDK 的一部分,在 Dart 與 Flutter 專案中廣泛使用,以提升程式碼品質與開發者體驗。

適用情境

  • 為參數添加元數據以進行必需的驗證
  • 標記API為已棄用,以便將來移除
  • 透過語義提示改進程式碼文件
  • 啟用靜態分析檢查
  • 支援程式碼產生工具
  • 增強 IDE 和工具反饋

主要特色

  • 內建註解,例如 @required 和 @deprecated
  • 與 Dart SDK 無縫整合
  • 支援程式碼分析與工具
  • 輕量且無依賴
  • 在 Flutter 與 Dart 生態系統中廣泛使用
  • 促進更好的程式碼可維護性

適合對象

  • Dart 和 Flutter 庫作者
  • 強制執行代碼品質標準的團隊
  • 使用程式碼產生的開發者
  • 需要強大API文件的專案
  • 需要元資料的工具和框架

使用建議

  • 註釋不會影響執行時行為
  • 需要了解靜態分析工具
  • 僅限編譯時解釋
  • 不是正式文件的替代品
  • 最佳搭配lint工具與分析器使用

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Dart

An approachable, portable, and productive language for high-quality apps on any platform

Dart is:

  • Approachable: Develop with a strongly typed programming language that is consistent, concise, and offers modern language features like null safety and patterns.

  • Portable: Compile to ARM, x64, or RISC-V machine code for mobile, desktop, and backend. Compile to JavaScript or WebAssembly for the web.

  • Productive: Make changes iteratively: use hot reload to see the result instantly in your running app. Diagnose app issues using DevTools.

Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:

  • Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.

  • Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).

Dart platforms illustration

License & patents

Dart is free and open source.

See LICENSE and PATENT_GRANT.

Using Dart

Visit dart.dev to learn more about the language, tools, and to find codelabs.

Browse pub.dev for more packages and libraries contributed by the community and the Dart team.

Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).

Building Dart

If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.

There are more documents in our repo at docs.

Contributing to Dart

The easiest way to contribute to Dart is to file issues.

You can also contribute patches, as described in Contributing.

Roadmap

Future plans for Dart are included in the combined Dart and Flutter roadmap on the Flutter wiki.

所屬分類

原始碼儲存庫

使用此套件的專案