Build Complex Components via Composition
Flutter Forge employs the principle of Composition, enabling developers to build complex UI components by assembling smaller, simpler components.
website·Indexed 31 days ago
https://flutter-forge.devA framework for modular UI modeling in Flutter. It provides a structured architecture using Components, Stores, Actions, Reducers, and Effects, with built-in support for AsyncState, widget testing, and integration with Riverpod.
Environment is a mechanism for formal dependency injection into a Component. Conceptually, it is an entity that holds all the information a component needs to access external dependencies. In practice, an Environment is simply a plain Dart class that you define and create; it does not need to extend a base class or follow specific technical restrictions.Flutter Forge uses a composable architecture based on the Redux pattern. The primary unit of organization is the Component, which encapsulates the following elements:
ReducerTuple containing the updated State and an array of EffectTask objects. The Store then processes these effects.final someComponentReducer =
Reducer<SomeWidgetState, SomeWidgetEnvironment, SomeWidgetAction>(
(state, action) {
switch (action) {
case Load _:
return ReducerTuple(
SomeWidgetState(count: state.count, name: "Loading..."),
[SomeWidgetEffects.loadNameEffect]
);
}
});