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

[Android] Fix nullable sensor issue in GyroscopeStreamHandler #169

Closed

Conversation

WaleedAlrashed
Copy link

  • Updated the sensor property to ensure it is non-nullable by throwing an IllegalStateException if the gyroscope sensor is not available.
  • This change resolves compilation errors related to nullable type.

What was the issue ?
The issue occurred when running the project with this package added on Flutter Channel stable 3.24.1

Trace:

Note: Recompile with -Xlint:deprecation for details.
file:///Users/waleed/.pub-cache/hosted/pub.dev/flutter_credit_card-4.0.1/android/src/main/kotlin/com/simform/flutter_credit_card/gyroscope/GyroscopeStreamHandler.kt:18:35 Function 'getValue' of property delegate is expected to return 'android.hardware.Sensor', but returns 'android.hardware.Sensor?'.

Running on debug/release produced the same issue

Disclaimer: I'm not a Kotlin expert, applied the fix so I can continue working on my project, therefore Any suggestions/changes are welcome

- Updated the sensor property to ensure it is non-nullable by throwing an IllegalStateException if the gyroscope sensor is not available.
- This change resolves compilation errors related to nullable type.
@Sahil-Simform
Copy link
Collaborator

Hi @WaleedAlrashed ,

Thank you so much for your contribution! We really appreciate your effort.
A similar fix has already been merged in PR #180, so I’ll be closing this PR for now.

Feel free to reach out if you have any questions or if you'd like to discuss further!

Thanks again for your work!

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

Successfully merging this pull request may close these issues.

2 participants