minix library

Minix: A lightweight state management and dependency injection system for Flutter.

✅ Simple and reactive Observable, AsyncObservable, and StreamObservable. ✅ Flutter widgets: Observer and ContextObserver for automatic rebuilds. ✅ Powerful Injector for scoped, tagged, and auto-disposed DI.

Example:

final counter = Observable(0);

Observer(() => Text('${counter.watch()}'));

class MyService extends Injectable {
  @override
  void onInit() => print('Initialized');
}

void main() {
  Injector.put(MyService());
}

This file exports all core APIs of the Minix framework.

Classes

AsyncObservable<T>
A reactive wrapper for managing asynchronous operations and their states.
ContextObserver
A reactive widget that rebuilds automatically when any used Observable changes.
FormObservable
Injectable
An abstract class to define lifecycle hooks for dependency injection.
Injector
A class that represents the Injector functionality.
ListObservable<T>
A class that represents the ListObservable functionality.
MapObservable<K, V>
MockObservable<T>
Observable<T>
A class that represents the Observable functionality.
ObservableTracker
Optimized ObservableTracker with better memory management A class that represents the ObservableTracker functionality.
Observer
A reactive widget that rebuilds whenever any accessed Observable changes.
Selector<T, R>
A specialized observable that derives its value from another observable using a selector function.
StreamObservable<T>
A reactive wrapper around Dart's Stream, enabling observable state, error handling, and reactive UI updates.

Enums

AsyncState
Represents the current state of an asynchronous operation.
StreamState
Represents the various states a StreamObservable can be in.

Mixins

AutoDispose

Extensions

ObservableSelector on Observable<T>
StreamObservableExtension on Stream<T>
Extension on Stream to easily convert it to a StreamObservable.
StringValidation on Observable<String>

Typedefs

ContextObserverBuilder = Widget Function(BuildContext context)
Signature for the widget-building function used by ContextObserver.
InjectorHook = void Function(String event, Type type)
A typedef for InjectorHook.
ObserverBuilder = Widget Function()
Signature for the widget-building function used by Observer.