redus_flutter 0.3.0 copy "redus_flutter: ^0.3.0" to clipboard
redus_flutter: ^0.3.0 copied to clipboard

Vue-like Component system for Flutter with reactive state, lifecycle hooks, and dependency injection.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.3.0 - 2024-12-19 #

Added #

  • ReactiveWidget - New single-class component design

    • State lives on ReactiveElement, not Widget - fixes LateInitializationError
    • state(Symbol, factory) pattern for state initialization
    • getState<T>(Symbol) for retrieving existing state
    • Fine-grained reactivity via markNeedsBuild() instead of setState()
  • .watch(context) Extension - Fine-grained reactivity for any widget

    • ref.watch(context) - Subscribe widget to Ref changes
    • computed.watch(context) - Subscribe widget to Computed changes
    • Only the specific widget rebuilds, not the entire component

Changed #

  • DI Moved to redus_dart - Dependency injection now comes from package:redus/di.dart

    • Supports key-based lookup: get<T>(key: #myKey)
    • Register multiple instances of same type with different keys
  • Deprecated Component class - Use ReactiveWidget instead

Dependencies #

  • Updated to redus: ^0.4.1 with DI module

0.2.0 - 2024-12-19 #

Changed #

  • Automatic Reactivity - render() now automatically tracks reactive dependencies

    • No more manual watchEffect + rebuild() needed in setup()
    • Accessing Ref.value or Computed.value in render() auto-triggers rebuilds when they change
    • Similar to Vue's template reactivity
  • Removed rebuild() method - No longer needed with automatic tracking

Dependencies #

  • Updated to redus: ^0.3.0 with callable Ref and Computed
    • count() is now equivalent to count.value
    • Strongly typed watch() API with proper type inference

0.1.0 - 2024-12-18 #

Added #

  • Component Base Class (src/component/)

    • Vue-like Component extending StatefulWidget
    • setup() method for reactive state initialization
    • render() method replacing build()
    • rebuild() method to trigger component update
  • Lifecycle Hooks (src/component/lifecycle.dart)

    • onBeforeMount - Before first build
    • onMounted - After first build
    • onBeforeUpdate - Before rebuild
    • onUpdated - After rebuild
    • onBeforeUnmount - Before dispose
    • onUnmounted - After dispose
    • onErrorCaptured - Error boundary
    • onActivated / onDeactivated - Route visibility
    • onRenderTracked / onRenderTriggered - Debug hooks
  • Dependency Injection (src/di/service_locator.dart)

    • register<T>() - Register singleton
    • registerFactory<T>() - Register factory
    • get<T>() - Get instance
    • isRegistered<T>() - Check registration
    • unregister<T>() - Remove registration
    • resetServiceLocator() - Clear all

Dependencies #

  • Built on redus reactivity system
  • Re-exports all redus APIs for convenience
0
likes
0
points
721
downloads

Publisher

unverified uploader

Weekly Downloads

Vue-like Component system for Flutter with reactive state, lifecycle hooks, and dependency injection.

Homepage
Repository (GitHub)
View/report issues

Topics

#flutter #state-management #component #lifecycle #dependency-injection

License

unknown (license)

Dependencies

flutter, meta, redus

More

Packages that depend on redus_flutter