flutter_hooks 0.2.0 flutter_hooks: ^0.2.0 copied to clipboard
A flutter implementation of React hooks. It adds a new kind of widget with enhanced code reuse.
0.2.0: #
- Made all existing hooks as static functions, and removed
HookContext
. The migration is as followed:
Widget build(HookContext context) {
final state = context.useState(0);
}
becomes:
Widget build(BuildContext context) {
final state = useState(0);
}
- Introduced keys for hooks and applied them to hooks where it makes sense.
- Added
useReducer
for complex state. It is similar touseState
but is being managed by aReducer
and can only be changed by dispatching an action. - fixes a bug where hot-reload without using hooks throwed an exception
0.1.0: #
useMemoized
callback doesn't take the previous value anymore (to match React API) UseuseValueChanged
instead.- Introduced
useEffect
anduseStreamController
- fixed a bug where hot-reload while reordering/adding hooks did not work properly
- improved readme
0.0.1: #
Added a few common hooks:
useStream
useFuture
useAnimationController
useSingleTickerProvider
useListenable
useValueListenable
useAnimation
0.0.0: #
- initial release