how to check if function parameter is optional using anzlyzer package?

Issue

how to check if function parameter is optional using anzlyzer package?

For example:

myFunction(param1, {param2});

I would like to know that param1 is required and param2 is optional

Solution

Parameters, if I remember correctly, have a kind getter, which is an instance of ParameterKind, which can be REQUIRED, NAMED or POSITIONAL (also optional).

Answered By – Tobe Osakwe

Answer Checked By – Clifford M. (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *