stacked_hooks
0.2.4, released 3 years ago by filledstacks.com
Classes that help use Flutter Hooks with the stacked package architecture.
WASM-ready
What it does
It provides widget classes like StackedHookView that bridge the stacked architecture with the flutter_hooks package. This allows you to consume ViewModels provided by Provider while utilizing hooks inside your widget build methods.
AI-written summary of version 0.2.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building an app using the stacked architecture and want to use flutter_hooks
- You need to manage local UI controllers like TextEditingController within stacked views
Skip it when
- You are not using the stacked architecture package
- you prefer other state management solutions like Riverpod or Bloc
Strengths
- Integrates flutter_hooks seamlessly with stacked ViewModels
- Reduces boilerplate when using TextEditingControllers and similar hooks in stacked views
Weaknesses
- Dependent on both stacked and flutter_hooks ecosystems
- Limited functionality beyond bridging the two packages
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
not documented
class _HookForm extends StackedHookView<HomeViewModel> {
@override
Widget buildStackedView(BuildContext context, HomeViewModel model) {
final title = useTextEditingController();
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(model.title),
TextField(controller: title, onChanged: model.updateTitle),
],
);
}
}Works with
Packages commonly used together with stacked_hooks: ones it builds on, ones built on it, and its own family.
- providerstacked_hooks depends on itA lightweight wrapper around InheritedWidget for state management
- flutter_hooksstacked_hooks depends on itA Flutter implementation of React hooks for managing widget life-cycle and code reuse.
- stacked_sharedSame familyShared code between the stacked packages.
- stackedSame familyA complete frontend architecture framework for building Flutter applications.
- stacked_generatorSame familyGenerates routing and dependency‑injection boilerplate for Stacked apps.
- stacked_servicesSame familyProvides default implementations of services for the Stacked architecture.
- stacked_themesSame familyManage multiple themes, dark mode, and theme persistence in Flutter applications.