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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.
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.

1 participant