damondouglas commented on a change in pull request #16857: URL: https://github.com/apache/beam/pull/16857#discussion_r808238095
########## File path: playground/frontend/lib/modules/examples/components/example_list/example_item_actions.dart ########## @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; +import 'package:playground/modules/examples/components/description_popover/description_popover_button.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; +import 'package:playground/modules/examples/models/popover_state.dart'; +import 'package:provider/provider.dart'; + +import '../multifile_popover/multifile_popover_button.dart'; + +class ExampleItemActions extends StatelessWidget { + final ExampleModel example; + final BuildContext parentContext; + + const ExampleItemActions( + {Key? key, required this.parentContext, required this.example}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + children: [ + if (example.isMultiFile) multifilePopover, + descriptionPopover, + ], + ); + } + + Widget get multifilePopover { + return MultifilePopoverButton( + parentContext: parentContext, + example: example, + followerAnchor: Alignment.topLeft, + targetAnchor: Alignment.topRight, + onOpen: () => _setPopoverOpen(parentContext, true), + onClose: () => _setPopoverOpen(parentContext, false), + ); + } + + Widget get descriptionPopover { Review comment: To improve readability, the use of `=>` could possibly apply here. ########## File path: playground/frontend/lib/modules/examples/components/description_popover/description_popover.dart ########## @@ -46,6 +51,14 @@ class DescriptionPopover extends StatelessWidget { ), ), Text(example.description), + if (example.link?.isNotEmpty ?? false) Review comment: I think it would improve the code readability to not have conditional logic in the array. This is just my subjective opinion and feel free to go your own way. I flag this as review and will accept/embrace your unchanging it however. ########## File path: playground/frontend/lib/modules/examples/components/example_list/example_item_actions.dart ########## @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/material.dart'; +import 'package:playground/modules/examples/components/description_popover/description_popover_button.dart'; +import 'package:playground/modules/examples/models/example_model.dart'; +import 'package:playground/modules/examples/models/popover_state.dart'; +import 'package:provider/provider.dart'; + +import '../multifile_popover/multifile_popover_button.dart'; + +class ExampleItemActions extends StatelessWidget { + final ExampleModel example; + final BuildContext parentContext; + + const ExampleItemActions( + {Key? key, required this.parentContext, required this.example}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + children: [ + if (example.isMultiFile) multifilePopover, + descriptionPopover, + ], + ); + } + + Widget get multifilePopover { + return MultifilePopoverButton( Review comment: To improve readability, the use of `=>` could possibly apply here. -- 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]
