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

package produces build error #223

Open
AballahEhab opened this issue Mar 28, 2023 · 4 comments
Open

package produces build error #223

AballahEhab opened this issue Mar 28, 2023 · 4 comments

Comments

@AballahEhab
Copy link

../../../flutter/usedVersion/.pub-cache/hosted/pub.dartlang.org/keyboard_actions-4.2.0/lib/keyboard_actions.dart:322:31: Error: A value of type 'OverlayState?' can't be assigned to a variable of type 'OverlayState' because 'OverlayState?' is nullable and 'OverlayState' isn't.

  • 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('../../../flutter/usedVersion/packages/flutter/lib/src/widgets/overlay.dart').
    OverlayState os = Overlay.of(context);
    ^
    ../../../flutter/usedVersion/.pub-cache/hosted/pub.dartlang.org/keyboard_actions-4.2.0/lib/external/keyboard_avoider/bottom_area_avoider.dart:194:27: Error: Method 'getOffsetToReveal' cannot be called on 'RenderAbstractViewport?' because it is potentially null.
  • 'RenderAbstractViewport' is from 'package:flutter/src/rendering/viewport.dart' ('../../../flutter/usedVersion/packages/flutter/lib/src/rendering/viewport.dart').
    Try calling using ?. instead.
    final offset = viewport.getOffsetToReveal(object, 1.0).offset + overscroll;
@MarcoChong
Copy link

you have to upgrade the flutter to last version

@Galeen-Bidpath
Copy link

If you are on flutter < 3.7.3 and don't need to use latest version, use v4.1.0.

@ricardonior29
Copy link

Im using flutter 3.3.3 - Dart version 2.18.2 and I keep getting the error. I already tried the pub versions 4.2.0, 4.1.0, 4.0.1 and 4.0.0

`: Error: A value of type 'OverlayState?' can't be assigned to a variable of type 'OverlayState' because 'OverlayState?' is nullable and 'OverlayState' isn't.
keyboard_actions.dart:322

  • 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('../development/flutter/packages/flutter/lib/src/widgets/overlay.dart').
    overlay.dart:1
    OverlayState os = Overlay.of(context);`

`: Error: Method 'getOffsetToReveal' cannot be called on 'RenderAbstractViewport?' because it is potentially null.

  • 'RenderAbstractViewport' is from 'package:flutter/src/rendering/viewport.dart' ('../development/flutter/packages/flutter/lib/src/rendering/viewport.dart').
    Try calling using ?. instead.
    final offset = viewport.getOffsetToReveal(object, 1.0).offset + overscroll;
    ^^^^^^^^^^^^^^^^^`

@Felypee
Copy link

Felypee commented Jul 12, 2023

I downgraded the package version to keyboard_actions: ^3.4.7. So try downgrade it until it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants