Mindinventory / progressive_time_picker

A Customizable Progressive Time Picker for Flutter.
https://www.mindinventory.com/flutter-app-development.php
MIT License
70 stars 14 forks source link

Issue with DisabledRange component causing "Null check operator used on a null value" error #17

Closed 2811267153 closed 1 month ago

2811267153 commented 6 months ago

While using your Flutter library, I have encountered an issue related to the DisabledRange component. When configuring the disabledRange property in my component, the app throws a "Null check operator used on a null value" error during runtime.

The error seems to be triggered by the following code snippet: dart disabledRange: DisabledRange( initTime: _disabledInitTime, endTime: _disabledEndTime, disabledRangeColor: Colors.grey, errorColor: Colors.red, ), In this context, either _disabledInitTime or _disabledEndTime (or both) might be null, and the DisabledRange component or its internal logic might be using a null check operator (!) without first checking for null values.

To resolve this issue, I suggest considering the following approaches:

Perform null checks inside the DisabledRange component for _disabledInitTime and _disabledEndTime to avoid using the null check operator when they are null. Update the documentation for the DisabledRange component to clarify if _disabledInitTime and _disabledEndTime should not be null, or if they can be null, how they should be handled properly. If _disabledInitTime and _disabledEndTime can be optional, consider providing default values or nullable types for them in the DisabledRange constructor. I hope this information helps you fix the problem. If you need more details about my setup or code, please let me know.

Thank you for your attention and support. I am looking forward to updates on this issue!

截屏2024-05-17 21 34 08 截屏2024-05-17 21 34 39
Hetpra9653 commented 5 months ago

@2811267153 can you please provide me entire code related to this issue, thanks

mohit-chauhan-mi commented 1 month ago

Closing this issue for now. Please reopen it with more details if needed.