redus_flutter 0.3.0
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 - fixesLateInitializationError state(Symbol, factory)pattern for state initializationgetState<T>(Symbol)for retrieving existing state- Fine-grained reactivity via
markNeedsBuild()instead ofsetState()
- State lives on
-
.watch(context) Extension - Fine-grained reactivity for any widget
ref.watch(context)- Subscribe widget to Ref changescomputed.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
- Supports key-based lookup:
-
Deprecated
Componentclass - UseReactiveWidgetinstead
Dependencies #
- Updated to
redus: ^0.4.1with DI module
0.2.0 - 2024-12-19 #
Changed #
-
Automatic Reactivity -
render()now automatically tracks reactive dependencies- No more manual
watchEffect+rebuild()needed insetup() - Accessing
Ref.valueorComputed.valueinrender()auto-triggers rebuilds when they change - Similar to Vue's template reactivity
- No more manual
-
Removed
rebuild()method - No longer needed with automatic tracking
Dependencies #
- Updated to
redus: ^0.3.0with callableRefandComputedcount()is now equivalent tocount.value- Strongly typed
watch()API with proper type inference
0.1.0 - 2024-12-18 #
Added #
-
Component Base Class (
src/component/)- Vue-like
ComponentextendingStatefulWidget setup()method for reactive state initializationrender()method replacingbuild()rebuild()method to trigger component update
- Vue-like
-
Lifecycle Hooks (
src/component/lifecycle.dart)onBeforeMount- Before first buildonMounted- After first buildonBeforeUpdate- Before rebuildonUpdated- After rebuildonBeforeUnmount- Before disposeonUnmounted- After disposeonErrorCaptured- Error boundaryonActivated/onDeactivated- Route visibilityonRenderTracked/onRenderTriggered- Debug hooks
-
Dependency Injection (
src/di/service_locator.dart)register<T>()- Register singletonregisterFactory<T>()- Register factoryget<T>()- Get instanceisRegistered<T>()- Check registrationunregister<T>()- Remove registrationresetServiceLocator()- Clear all
Dependencies #
- Built on
redusreactivity system - Re-exports all
redusAPIs for convenience