LogoSignals.dart
Copy Markdown
rodydavis/signals.dart 999999

signals_flutter

The signals library exposes four core functions which are the building blocks to model any business logic you can think of.

Version: 7.0.0

Installation#

flutter pub add signals_flutter

The signals_flutter package delivers high-performance, premium reactive UI updates for Flutter applications. By binding signals directly to the widget tree, it enables surgical, localized widget rebuilds without redrawing parent elements or complex state management boilerplate.

Key Features#

  • 🚀 Implicit Tracking: Inherit from [SignalWidget] or [SignalStatefulWidget] to establish automatic, mixin-free reactivity inside widget build methods.
  • ⚡ Surgical Rebuilds: Use [SignalBuilder] to surgically rebuild specific, localized nodes of the widget tree without redrawing parent elements.
  • 🔄 Interoperability: Seamlessly convert back and forth between Dart Signals, standard Flutter ValueNotifiers, and asynchronous Streams.

Quick Start#

import 'package:flutter/material.dart';
import 'package:signals/signals_flutter.dart';

final counter = signal(0);

class CounterWidget extends SignalWidget {
  const CounterWidget({super.key});

  @override
  Widget build(BuildContext context) {
    // Accessing .value implicitly tracks and rebuilds this widget on change:
    return ElevatedButton(
      onPressed: () => counter.value++,
      child: Text('Count: ${counter.value}'),
    );
  }
}

Package Contents#