Closed Nek-12 closed 1 year ago
I don't see any issue here. You can define your own default range and utilize it for both the CalendarDialog and your wrapper composable function. If the standard range needs to remain the same, you can easily copy and paste it those constants, allowing you thus easily to change the range if desired. I will keep the constant files and the respective constants internal. Why would you define the state inside your wrapper function instead of passing it along?
Alright, I see. For now I used the approach you suggested, just thought you would consider providing sensible defaults for people to use, however user-defined-defaults work too I'm making these helper functions for the dialogs because I want to streamline the process of composing and showing the dialog. I've noticed that all of the usecases I've encountered involve declaring the state and immediately calling the Dialog composable, so I've merged those operations together. I'm passing the state as a return value of the function and using it later in the parent composable.
P.S. Github is experiencing serious issues :D
Alright, I see. For now I used the approach you suggested, just thought you would consider providing sensible defaults for people to use, however user-defined-defaults work too I'm making these helper functions for the dialogs because I want to streamline the process of composing and showing the dialog. I've noticed that all of the usecases I've encountered involve declaring the state and immediately calling the Dialog composable, so I've merged those operations together. I'm passing the state as a return value of the function and using it later in the parent composable.
Alright, I see. For now I used the approach you suggested, just thought you would consider providing sensible defaults for people to use, however user-defined-defaults work too I'm making these helper functions for the dialogs because I want to streamline the process of composing and showing the dialog. I've noticed that all of the usecases I've encountered involve declaring the state and immediately calling the Dialog composable, so I've merged those operations together. I'm passing the state as a return value of the function and using it later in the parent composable.
Constants.DEFAULT_RANGE is internal, as such, it cannot be used to create composables which wrap the CalendarDialog.
Sample: