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

套件詳情v7.1.0

signals

反應式變得簡單。少做,卻能成就更多。支援 Flutter 和任何 Dart 項目,包含 HTML/JS、CLI、Shelf 伺服器、VM 等。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
2.6萬
喜歡數
714
Pub 分數
160

安裝套件

flutter pub add signals

套件介紹

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

Signals 是一個輕量級的 Dart 與 Flutter 反應式庫,透過在資料變更時自動更新來簡化狀態管理。它讓開發者能以最少的樣板程式碼建立反應式變數與運算式,輕鬆建構動態 UI 並跨不同平台管理狀態。設計上強調簡潔與效能,Signals 可無縫應用於 Flutter 應用,以及伺服器、命令列工具與網頁應用等非 UI 環境。其 API 直覺易用,專注於以更少的程式碼達成更多功能。

適用情境

  • 即時UI更新
  • 跨平台狀態管理
  • 伺服器端反應式邏輯
  • 簡化依賴追蹤
  • providers 的輕量級替代方案
  • 事件驅動的應用架構

主要特色

  • 零樣板反應式
  • 自動依賴追蹤
  • 適用於所有 Dart 平台
  • 最小 API 表面
  • 支援非同步與同步訊號
  • 可組合的訊號表達式

適合對象

  • 尋求簡單響應式的開發者
  • 需要輕量級狀態的 Flutter 應用
  • 具有反應式需求的非UI Dart專案
  • 避免複雜狀態解決方案的團隊
  • 快速原型設計使用者介面變更
  • 針對多個平台的專案

使用建議

  • 不適合非常大型的狀態樹
  • 有限的內建除錯工具
  • 尚未有官方開發工具整合
  • 最適合中等複雜度
  • 需要理解響應式模式
  • 可能需要搭配其他狀態管理庫以實現進階用法

原始 README

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

Tests Website GitHub stars Coverage GitHub issues GitHub pull-requests melos

Signals.dart

Try chat with CodeWiki!

Features

  • 🪡 Fine grained reactivity: Based on Preact Signals and provides a fine grained reactivity system that will automatically track dependencies and free them when no longer needed
  • ⛓️ Lazy evaluation: Signals are lazy and will only compute values when read. If a signal is not read, it will not be computed
  • 🗜️ Flexible API: Every app is different and signals can be composed in multiple ways. There are a few rules to follow but the API surface is small
  • 🔬 Surgical Rendering: Widgets can be rebuilt surgically, only marking dirty the parts of the Widget tree that need to be updated and if mounted
  • 💙 100% Dart Native: Supports Dart JS (HTML), Shelf Server, CLI (and Native), VM, Flutter (Web, Mobile and Desktop). Signals can be used in any Dart project

To start using signals, check out the full documentation.

VS Code Extension: https://marketplace.visualstudio.com/items?itemName=rodydavis.signals-dart

Packages

Package Pub
signals signals
signals_core signals_core
signals_flutter signals_flutter
signals_lint signals_lint
signals_hooks signals_hooks
preact_signals signals_lint
signals_devtools_extension

AI Developer Skills

To enable AI coding assistants (like Google Antigravity, Gemini, Claude, Cursor, GitHub Copilot, and others) to build high-quality reactive systems with signals.dart, this repository includes prepackaged, high-fidelity developer Skills.

These skills are located under the ./skills directory and are fully modular:

  • signals-preact-dart: Deep knowledge and best practices for core reactive primitives (signal, computed, effect, batch, untracked).
  • signals-dart: Best practices for async signal operations (FutureSignal, StreamSignal), reactive collections, writable computed signals (linkedSignal), and value semantics.
  • signals-flutter: Comprehensive guides on element-level reactive UI integration, high-frequency GPU rendering bypasses, lifecycle side-effects, and .watch(context) extensions.
  • signals-migration-6-to-7: Detailed instructions, patterns, and refactoring techniques to safely upgrade applications from signals v6.x to v7.0.0.
How to use them:
1. One-Command Installation via skills.sh

You can instantly install all available signals skills into your global AI environment using the unified skills.sh registry CLI:

npx skills add rodydavis/signals.dart
2. Manual Reference

Simply reference the path to the desired skill directory in your AI prompt, or load the contents of the relevant SKILL.md files as context for your AI coding assistant.

Contributors

所屬分類

依賴

依賴清單 3 項

原始碼儲存庫

使用此套件的專案