progressive_time_picker icon indicating copy to clipboard operation
progressive_time_picker copied to clipboard

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

Open 2811267153 opened this issue 1 year ago • 1 comments

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

2811267153 avatar May 17 '24 13:05 2811267153

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

Hetpra9653 avatar May 24 '24 06:05 Hetpra9653

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

mohit-chauhan-mi avatar Sep 19 '24 07:09 mohit-chauhan-mi