Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] Improvements on function documentation #65

Closed
Macacoazul01 opened this issue Jan 27, 2022 · 7 comments
Closed

[enhancement] Improvements on function documentation #65

Macacoazul01 opened this issue Jan 27, 2022 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@Macacoazul01
Copy link
Collaborator

It would be nice to have samples of complex uses of the parameters when you hover their names (some codes on the examples would be perfect).

With it, the package will become easier to use.

@Macacoazul01
Copy link
Collaborator Author

something like this (using Dialog() parameters as example):

image

@lcuis lcuis added the documentation Improvements or additions to documentation label Mar 24, 2022
@Macacoazul01
Copy link
Collaborator Author

@lcuis to help exemplifying what am I saying:

The default done button: {dynamic doneButton = "Done"}

What can I do with a custom done button:

doneButton: (List<int> selectedItemsDone, BuildContext doneContext) {
            return ElevatedButton(
              onPressed: () {
                Navigator.pop(doneContext);
                setState(() {});
              },
              child: const Text("Selecionar"),
          },

These complex cases are already on the example main.dart file of the project, but not on the parameters

@lcuis
Copy link
Owner

lcuis commented Dec 13, 2022

Hello @Macacoazul01 ,

I think this would definitely be a big plus to the plugin. The thing is that the only way I have found to document is by documenting the method. This method documentation is already very long. I am not sure that it would still be readable with examples for complex parameters. Do yo think otherwise?
The best for me would be for the information popup to only contain the single parameter related information but I don't know how to do that. The dart documentation doesn't mention this possibility: https://dart.dev/guides/language/effective-dart/documentation
Do you know any way to do that?

@Macacoazul01
Copy link
Collaborator Author

I'm really not the best at documentation.
If you find a way to do something like this that works i can help with, by copying the sample on other functions.
Maybe there isn't a true necessity to add a sample here, only to define a little better what every parameter is / show each one while we hover the parameter.

something like this (using Dialog() parameters as example):

image

@lcuis
Copy link
Owner

lcuis commented Feb 24, 2023

This is a very good example you found here. It shows it is possible to have hover documentation per parameter.

Apparently, it is done by documenting the variable, which is the case in SearchChoices. The only issue is that we don't specify the single and multiple factories parameters with a preceding this.. Thus, the documentation engine cannot find the parameter documentation directly.
Maybe, we should transform the 2 factories into simple constructors and have them defined with all the parameters set as preceded with this.?

For this, we probably need to remove the existing constructor _ and place all its assert calls within a method called by both new constructors.

Also, indeed, it is possible and a good idea to improve the content of the existing documentation.

lcuis added a commit that referenced this issue Feb 24, 2023
…acacoazul01 #65 * marked assertUniqueValue parameter as deprecated since it is not used anywhere.
@lcuis
Copy link
Owner

lcuis commented Feb 24, 2023

Release 2.2.4 is a good starting point to improve the parameters documentation. Now, it is possible to have a hover documentation per parameter and thus have an example for the most complex cases.

Also, with this release, removing the _ constructor meant a quite important simplification.

Thanks @Macacoazul01 !

@lcuis lcuis added waiting for customer response The team needs more information from the user and removed waiting for customer response The team needs more information from the user labels Feb 24, 2023
@Macacoazul01
Copy link
Collaborator Author

closing this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants