Issue I have a welcome page where i can click a button and go to my login screen and i use Get.toNamed to navigate my screens //Click button on welcome.dart InkWell( onTap: () => goto("login"), child: …., ) //goto function
Continue readingTag: flutter-hooks
How to manage multiple ScrollView widgets using one useScrollController() hook?
Issue Flutter documentation for ScrollController has this paragraph: Scroll controllers are typically stored as member variables in State objects and are reused in each State.build. A single scroll controller can be used to control multiple scrollable widgets, but some operations,
Continue readingHow to update the initialData of "useState" from parent in Flutter Hooks
Issue According to the description of useState in flutter_hooks: … /// On the first call, it initializes [ValueNotifier] to [initialData]. [initialData] is ignored /// on subsequent calls. … I want to use useState to change the current widget state. I
Continue readingHow to use Flutter State Restoration with HookWidget
Issue I want to use Flutter State Restoration in my Flutter app. I want to save/restore some data and on internet all articles suggest to use RestorationMixin for this. How can I use RestorationMixin with HookWidget ? Solution Well I
Continue readingFlutter Hook useState not working with dropdown
Issue After choosing a value from dropdown, the value in useState does not update. This is my model class class Data { final int id; final String name; final String someOtherData; Data({ required this.id, required this.name, required this.someOtherData, }); }
Continue readingGetting error when trying to add WidgetRef parameter to the build method in Flutter
Issue void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); runApp( const ProviderScope( child: MyApp(), ), ); } class MyApp extends HookWidget { const MyApp({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { Future<DocumentSnapshot<Map<String, dynamic>>> getUserData(userId) async { final userData
Continue readingIs there a use for hooks_riverpod
Issue I’m kinda confused as to what exactly the aim is with hooks_riverpod, I’ve used flutter_riverpod, and I’ve used flutter_hooks, but what is hooks_riverpod, on the pub.dev main page for hooks_riverpod, it’s documentation is just flutter_riverpod documentation, there’s not a
Continue readingDispose hook on widget rebuild
Issue Do hooks dispose of themselves when a widget rebuilds? Is it possible to cause this behavior? I’m using Riverpod for state management and I have a widget that creates a custom TextEditingController hook in the build method. When I
Continue readingText widget shows text with strange styles (Flutter)
Issue I’m using Provider in Flutter for state management. And I want to display some text in my widget using this Provider. The test is shown but is looks very strange height or padding I don’t know. So here is
Continue readingFlutter useEffect with Key notices value change only once
Issue I’ve written a code like below and expected the value on screen to never change from "value by useEffect". *Since every time the button is pressed and the text is changed to "value by onPress", useEffect should catch the
Continue reading