alexeyinkin commented on code in PR #23477:
URL: https://github.com/apache/beam/pull/23477#discussion_r990463831


##########
playground/frontend/lib/modules/examples/components/example_list/example_item_actions.dart:
##########
@@ -36,6 +36,8 @@ class ExampleItemActions extends StatelessWidget {
     return Row(
       children: [
         if (example.isMultiFile) multifilePopover,
+        if (example.complexity != Complexity.unspecified)
+          ComplexityWidget(complexity: example.complexity),

Review Comment:
   I don't see a problem with `if`s in a list. There is even a lint to make 
them right:
   
https://dart-lang.github.io/linter/lints/prefer_if_elements_to_conditional_expressions.html
   The problem here is the line break.
   
   @Malarg you can turn it to a one-liner which is much more readable:
   
   ```dart
         children: [
           if (example.isMultiFile) multifilePopover,
           if (example.complexity != null) ComplexityWidget(example.complexity),
           descriptionPopover,
         ],
   ```
   
   by getting rid of `Complexity.unspecified` and making it nullable, and by 
turning `ComplexityWidget`'s argument into a positioned one.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to