rrousselGit / functional_widget

A code generator to write widgets as function without loosing the benefits of classes.
597 stars 46 forks source link

Option remove leading underscore #46

Closed derolf closed 5 years ago

derolf commented 5 years ago

Adds an option removeLeadingUnderscore to FunctionalWidget:

  /// If `true` the leading underscore of the function is removed. This way,
  /// a private function can be used to create a public widget class. If the
  /// function does not have a leading underscore, this option is ignored.
  ///
  /// For example, the function `_foo` would generate class `Foo`.
  final bool removeLeadingUnderscore;
rrousselGit commented 5 years ago

Nice, thanks for your contributions! I'll review them a bit later today 😃

derolf commented 5 years ago

@rrousselGit I can't get the CI to pass since I had to change things in both packages and it doesn't resolve the "new" version.

rrousselGit commented 5 years ago

The only way to make the CI pass is to change the dependency on the annotation package from the generator to use path: ../functional_widget_annotations (and then revert it before publishing it to pub...)

I'm not aware of any mean to make this workflow better.

codecov-io commented 5 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@2ca3c7e). Click here to learn what that means. The diff coverage is 92.59%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #46   +/-   ##
=========================================
  Coverage          ?   99.07%           
=========================================
  Files             ?        4           
  Lines             ?      326           
  Branches          ?        0           
=========================================
  Hits              ?      323           
  Misses            ?        3           
  Partials          ?        0
Impacted Files Coverage Δ
...unctional_widget/lib/function_to_widget_class.dart 99.54% <100%> (ø)
functional_widget/lib/src/utils.dart 95.23% <80%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2ca3c7e...9b2667c. Read the comment docs.

derolf commented 5 years ago

Please comment on regarding toTitle/toPublic. As said, splitting will make things a bit more complicated...

derolf commented 5 years ago

@rrousselGit ready to go then?

rrousselGit commented 5 years ago

LGTM with a few more tests. Not everything is covered on the "parsing build.yaml".

We'll want a test to:

Also, there's the __Foo scenario that is not tested/documented. It is voluntary that __Foo generates _Foo?

rrousselGit commented 5 years ago

@derolf do you still want to merge this?

derolf commented 5 years ago

Yes, for sure! Just busy with Flutter :-)

derolf commented 5 years ago

Sorry, we dropped functional_widget. The reason is very simple: It's nice that you save some lines of code, but it really creates a lot of mental overload to navigate in the code because you jump around a lot.