搜索插件、代码仓与 APP 分类

插件详情v7.0.0

preact_signals

Preact.js Signals 的 Dart 版本

AndroidiOSLinuxmacOSWebWindows
近 30 天下载
10.9万
喜欢数
8
Pub 分数
130

安装插件

flutter pub add preact_signals

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Preact Signals 是 Preact.js Signals 库的 Dart 版本,为 Flutter 应用提供轻量级的响应式状态管理解决方案。它通过信号实现细粒度的响应性,自动追踪依赖关系,并在值发生变化时触发更新。设计简洁且性能优异,可无缝集成到 Flutter 项目中,无需样板代码即可管理状态。该包支持所有主要平台,包括 Web、移动和桌面端,非常适合跨平台开发。它强调极低的开销,并基于实际数据变化实现可预测的重新渲染。

适合场景

  • 实时 UI 更新
  • 细粒度状态更新
  • 跨平台响应式应用
  • 轻量级状态管理
  • 高效的依赖跟踪

主要特点

  • 自动依赖跟踪
  • 最小化重新渲染
  • 无样板代码
  • 跨平台支持
  • 简单的 API 设计

适合对象

  • 小型到中型的 Flutter 应用
  • 寻求轻量级状态管理的开发者
  • 对高响应性要求高且开销低的项目
  • 熟悉 React 类似模式的团队
  • Web 和多平台应用

使用建议

  • 与更大的状态管理工具相比,生态系统有限
  • 不太适合非常复杂的状态树
  • 对不熟悉信号模式的开发人员来说,学习曲线较陡
  • 可能需要额外的工具来调试
  • 比成熟的替代方案社区支持较少

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

源码仓库

使用此插件的项目

暂无相关数据。

所在榜单