搜索插件、代码仓与 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 应用以及服务器、命令行工具和 Web 应用等非 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 项

源码仓库

使用此插件的项目