Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter_hooks: ^0.20.3 #396

Closed
macasas opened this issue Nov 24, 2023 · 2 comments
Closed

flutter_hooks: ^0.20.3 #396

macasas opened this issue Nov 24, 2023 · 2 comments
Assignees
Labels
bug Something isn't working needs triage

Comments

@macasas
Copy link

macasas commented Nov 24, 2023

I have been using
final textEditingController = useTextEditingController();
in a project for a few weeks, no problem until this afternoon.

Now this, and every other project using useTextEditingController is flagging an error.

The method 'useTextEditingController' isn't defined for the type 'TodoItem'.
Try correcting the name to the name of an existing method, or defining a method named 'useTextEditingController'.

As if
import 'package:flutter_hooks/flutter_hooks.dart';
has gone missing. When I remove the import, the lovely flutter list of options to import the correct package does not list it. I went back to the riverpod example todos which uses the same code, as soon as I clicked on the word useTextEditingController up came the same error, and this also has worked for a fortnight until now.

It's as if useTextEditingController just disappeared!! Because I have useFocusNode() in the same file and it is clearly linked to package:flutter_hooks/flutter_hooks.dart

I have cleaned, pub get, etc... to the same error
I have recreated pods

And when I try to flutter run

Failed to build iOS app
Error (Xcode):
../../../../../.pub-cache/hosted/pub.dev/flutter_hooks-0.20.3/lib/src/text_control
ler.dart:10:3: Error: 'TextEditingController' isn't a type.

Totally confused!

@macasas macasas added bug Something isn't working needs triage labels Nov 24, 2023
@macasas
Copy link
Author

macasas commented Nov 24, 2023

Switching back to 0.18.6 and problem disappeared.
Removed .pub-cache 0.20.3 and reinstalled, I guess I must have corrupted something unknowingly because all is well in the world again :-)

@rrousselGit
Copy link
Owner

Sounds like a pub issue then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants