Skip to content

Ignore non-story functions inside stories files #65

@fertrig

Description

@fertrig

Story functions are simple functions that return a Widget and take zero arguments. Their type is Widget Function().

The stories files may have functions which are not stories, i.e. functions which take parameters. Unfortunately, the code generation builders think they are candidates for story functions. Thus, they process them and they fail with an unhelpful error message.

The builders should detect these non-story functions and ignore them.

Here are some sample functions which generate error messages:

/// Function with one argument
Widget textWidget(Color textColor) =>
    Text('I am a Text widget', style: TextStyle(color: textColor));

/// Private function
Widget _textWidget(Color textColor) =>
    Text('I am a Text widget', style: TextStyle(color: textColor));

/// Function that returns a text widget
Text textWidget(Color textColor) =>
    Text('I am a Text widget', style: TextStyle(color: textColor));

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerspreviewRelated to the Monarch Preview Window or monarch package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions