flutter_hooks
flutter_hooks copied to clipboard
React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.
With the changes in this [flutter](https://github.com/flutter/flutter/pull/108931) commit, three hook tests related to calling hasListeners are failing: [use_focus_node](https://github.com/rrousselGit/flutter_hooks/blob/master/packages/flutter_hooks/test/use_focus_node_test.dart#L36), useState [here](https://github.com/rrousselGit/flutter_hooks/blob/master/packages/flutter_hooks/test/use_state_test.dart#L39) and [here](https://github.com/rrousselGit/flutter_hooks/blob/master/packages/flutter_hooks/test/use_state_test.dart#L73), and useValueNotifier [here](https://github.com/rrousselGit/flutter_hooks/blob/master/packages/flutter_hooks/test/use_value_notifier_test.dart#L70) and [here](https://github.com/rrousselGit/flutter_hooks/blob/master/packages/flutter_hooks/test/use_value_notifier_test.dart#L112). Raising this bug to...
**Custom hook is calling dispose in reverse mode** I'm using custom hook on my project to initialise and configure `ChewieController` and I was getting the error `chewieController used after being...
**Describe the bug** useState seems to not trigger a rerender if given a new value in a useEffect **To Reproduce** ``` import 'dart:math'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; Future...
Added focus scope node for `FocusScope` widget. ```dart class Example extends HookWidget { @override Widget build(BuildContext context) { final node = useFocusScopeNode(); return FocusScope(autofocus: true, node: node, child: ...); }...
**Is your feature request related to a problem? Please describe.** Currently working on some desktop and TV application with lot of focus controls to play. I use `useFocusNode` and totally...
Documents the behavior for streams as discussed in #312.
We already have `useTabController`. Why not have the `useCupertinoTabController` for everyone that uses the `flutter/cupertino.dart` library? - [CupertinoTabController](https://api.flutter.dev/flutter/cupertino/CupertinoTabController-class.html)
Hi thanks for the lib! In JS, we have https://www.npmjs.com/package/eslint-plugin-react-hooks linters for enforcing the rules of hooks https://reactjs.org/docs/hooks-rules.html (the rules are mostly the same as here). So I wonder whether...
Will it be possible to provide support for `PersistentBottomSheetController` because it can be used to close bottom sheets as in https://stackoverflow.com/a/57406821 (part 2 of that answer). Thanks
I am trying to rebuild my `tabController` depending on some feature flags being on or off. ``` final featureFlags = useState(database.getFeatureFlags()); database.featureFlagsBox.watch(key: "feature_flags").listen((event) { featureFlags.value = event.value; }); final allPages...