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

The method 'detach' isn't defined for the class 'FocusScopeNode' #44

Closed
fvisticot opened this issue Apr 23, 2019 · 16 comments
Closed

The method 'detach' isn't defined for the class 'FocusScopeNode' #44

fvisticot opened this issue Apr 23, 2019 · 16 comments
Labels
bug Something isn't working fix when it hits stable

Comments

@fvisticot
Copy link

[✓] Flutter (Channel master, v1.5.5-pre.15, on Mac OS X 10.14.4 18E226, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.31.1)

I get this compilation error:

  • 'FocusScopeNode' is from 'package:flutter/src/widgets/focus_manager.dart' ('file:///Users/fsdf/Tools/flutter/packages/flutter/lib/src/widgets/focus_manager.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'detach'.
    focusNode.detach();
    ^^^^^^
@AndreHaueisen
Copy link
Owner

Hi @fvisticot
You are on the master channel. This is a breaking change so I can't do anything until it hits stable otherwise it will break the package for everyone else.
Thanks for reporting though. I won't be caught with my guard down.

@AndreHaueisen AndreHaueisen added bug Something isn't working fix when it hits stable labels Apr 23, 2019
@rahulmanthena
Copy link

Do you have any workaround until then :)

@AndreHaueisen
Copy link
Owner

Sorry man. I don't.
Is it absolutely necessary for you to stay on the master channel?
I suggest the beta.

@AndreHaueisen AndreHaueisen changed the title Flushbar Does not compile after Flutter upgrade The method 'detach' isn't defined for the class 'FocusScopeNode' May 2, 2019
@zachstarnes
Copy link

Hey @AndreHaueisen I am getting this error on version 1.5.0 installing with pub. Since you do not have a fix for this at the moment what version number should I use in my pubspec.yaml

@AndreHaueisen
Copy link
Owner

You should use flutter stable or beta version.

@vanelizarov
Copy link

@AndreHaueisen I think it won't break anything if we call dispose() method on focusNode instead of detach(). The doc says:

The attachment will automatically be detached in dispose().

@AndreHaueisen
Copy link
Owner

It needs FocusScopeNode. Not FocusNode.
FocusScopeNode does not have dispose() yet.

@vanelizarov
Copy link

@AndreHaueisen aah, yeah, I see, messed up a little bit 🙃

Have you seen this comment? Can it help?

@masewo
Copy link

masewo commented May 18, 2019

Now it happens with flutter dev channel too. Not only master anymore.
Implemented this comment in my fork:
https://github.com/masewo/flushbar
Seems to be working so far.
Very likely that we do not need FocusAttachment here.
Maybe it should sufficient to replace detach by dispose.
Edit: Working without FocusAttachment too.

@AndreHaueisen
Copy link
Owner

@vanelizarov The comment helped me understand what has changed. Thank you very much.
@masewo I'm aware of the solution by now, but this does not work on beta or stable since we don't have FocusAttachment yet. I can't push the fix because it would break the package for those who are not in the dev or master.
I will wait for it to reach beta at least since the chance for another breaking change is lower.

For now, either migrate to beta or stable or use maseo's version.

@vanelizarov
Copy link

@AndreHaueisen maybe you can add this feature to e.g. “dev” version of the package by creating separate branch and let the users who have faced this issue install your lib from Github instead of Pub?

@AndreHaueisen
Copy link
Owner

@vanelizarov Agreed.

For those who don't want to change to stable or beta channels, install the package using:

flushbar:
    git:
      url: https://github.com/AndreHaueisen/flushbar
      ref: dev_version

@AndreHaueisen
Copy link
Owner

AndreHaueisen commented May 18, 2019

Thanks for the feedback guys 👍

@yohom
Copy link

yohom commented May 31, 2019

Hi @AndreHaueisen, Flutter has hit its new beta(1.6.3), can you release a new version to fix this problem?

@AndreHaueisen
Copy link
Owner

The fix is live at version 1.6.0
Everyone that needs to stay in the stable channel should keep using version 1.5.3

@zinwalin
Copy link

The fix is live at version 1.6.0
Everyone that needs to stay in the stable channel should keep using version 1.5.3

thanks.

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

No branches or pull requests

8 participants