Controls' properties' types should be given in the documentation.
It would be easier if types of properties are also given in the documentation.
Perhaps like this:
value: str
The text displayed.
(From the Text documentation page.)
You can actually help with that, if you want :) Here's an example: https://flet.dev/docs/controls/image#fit
Thank you!
Should the changes be like bool or Optional[bool] where it is optional?
(Almost) all properties are actually optional, so let's just mention the main type: bool
If you are hopping on this, please make sure to follow the style used "Value is of type ... [and defaults to ...]" :)
Bruh, I have a question. Can I just "copy/paste" the values from function (property) definitions and see the def_value from there or is there something more to do, like with the action_button_padding with type of PaddingValue which is of course a union.
def_value is the default value of a property.
Not all props have one though. But if the property you are willing to document has one, then you can mention it.
Concerning stuffs like PaddingValue, I think you can just write it like that in the docs too. We could then add a section/page in the docs (still thinking of how it could be named) for all of these types, with more information on the possible values.
Got it!
As many of the PaddingValue things are also in the docs, I suggest the name of the section as "Type Aliases". This is also a name of a new feature in python.
Now there are conflicting types, there is a PaddingValue and a padding.Padding. I think I should leave those properties in the docs as they are in which type is given padding.Padding. They accept PaddingValue. What do you think?
I suggest the name of the section as "Type Aliases". This is also a name of a new feature in python.
Nice suggestion, thanks. So, we could have "Aliases" page under "References/Types" section of the docs. Will you like to create the file for this? (aliases.md under docs/references/types)
Now there are conflicting types, there is a PaddingValue and a padding.Padding.
If we have this aliases page, we could then set the value-type of all padding-related props to PaddingValue, which has link to the aliases page (it will look like /docs/references/types/aliases#paddingvalue).
This will fix the conflict, right?
Will you like to create the file for this?
Sure!
A quick question @ndonkoHenri
~~Should it look like this~~
~~### PaddingValue~~
~~Union of int, float, Padding and None.~~
I have sent a pull request in exactly this format.
Can we close this issue as completed @taaaf11 ?
For now, the laptop on which I write this code is not in working condition, and I don't know how much I would have to wait for that. As this issue is related to all controls, I think it should be kept opened. What is your opinion?
Alright, no prob, let's keep it opened.
New website: https://docs.flet.dev/