Issue with DisabledRange component causing "Null check operator used on a null value" error
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!
@2811267153 can you please provide me entire code related to this issue, thanks
Closing this issue for now. Please reopen it with more details if needed.