flet icon indicating copy to clipboard operation
flet copied to clipboard

Why are the default values of arguments that are Optional in a component defined as None?

Open SigreRabbit opened this issue 1 year ago • 4 comments

Duplicate Check

  • [x] I have searched the opened issues and there are no duplicates

Describe the requested feature

Why are the default values of most arguments that are Optional defined as None instead of actual values in the component implementation?

For example, the default value of spacing in the Row component is 10, but when I hover over the function in VSCode, I cannot know the default value and have to check the documentation or implementation. Isn't this inconvenient?

The idea, in short, is that I would like the implementation to be able to check what is given as the default value for an argument that actually has a default value.

Image

Suggest a solution

No response

Screenshots

No response

Additional details

No response

SigreRabbit avatar May 17 '25 13:05 SigreRabbit

I think what you're asking is to hover the control and get both the type and default values.

If so. This would generally mean the development team would have to rework the whole flet modules to implement the default values in the modules description which would generally take time.

For a short time, u can set ur own custom values for better responsiveness

HappyCoder256 avatar Jun 12 '25 01:06 HappyCoder256

Next release will have the default values in the constructors.

ndonkoHenri avatar Jun 12 '25 12:06 ndonkoHenri

I understand that it will take time to change this. I thought I had asked what the intent was with this and then suggested it as an improvement. Thank you for your understanding!

SigreRabbit avatar Jun 13 '25 02:06 SigreRabbit

Fixed in Flet Alpha and future stable releases.

ndonkoHenri avatar Aug 08 '25 14:08 ndonkoHenri