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

套件詳情v7.1.0

signals_flutter

信號庫公開了四個核心函數,這些函數是構建您所能想到的任何業務邏輯的基石。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
3.7萬
喜歡數
93
Pub 分數
150

安裝套件

flutter pub add signals_flutter

套件介紹

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

Signals Flutter 是一種輕量級的狀態管理解決方案,提供四個核心功能來建模複雜的業務邏輯。它透過允許開發者有效率地建立、觀察和回應資料流中的變更,實現反應式程式設計。基於 Dart 的反應式原則構建,促進了乾淨、可組合且可測試的程式碼。此函式庫設計簡單且效能優異,非常適合需要在多個平台對狀態更新進行細粒度控制的應用程式。

適用情境

  • 即時資料同步
  • 複雜表單狀態管理
  • 跨組件狀態共享
  • 事件驅動的UI更新
  • 基於狀態的動態UI渲染
  • 響應式業務邏輯建模

主要特色

  • 四個核心響應式函數
  • 輕量且最小化 API
  • 高度可組合
  • Platform-agnostic
  • 內建依賴注入支援
  • 高效變更傳播

適合對象

  • 尋求最小狀態管理開銷的開發者
  • 需要細粒度狀態控制的專案
  • 使用響應式程式設計模式的團隊
  • 針對多個平台的應用程式
  • 使用反應式邏輯進行原型設計或建構可擴展的應用程式

使用建議

  • 需要理解響應式程式設計概念
  • 有限的內建除錯工具
  • 不建議用於非常簡單的狀態需求
  • 新手學習訊號範式的學習曲線
  • 大型狀態結構可能需要額外的樣板程式碼

原始 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

所屬分類

依賴

依賴清單 1 項

  • signals_core^7.0.0

原始碼儲存庫

使用此套件的專案