ElessarST commented on a change in pull request #15700: URL: https://github.com/apache/beam/pull/15700#discussion_r726821774
########## File path: playground/frontend/lib/pages/playground/components/more_actions.dart ########## @@ -0,0 +1,134 @@ +/* + * 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:flutter_svg/flutter_svg.dart'; +import 'dart:html' as html; + +import 'package:playground/config/theme.dart'; + +enum HeaderAction { + shortcuts, + beamPlaygroundGithub, + apacheBeamGithub, + scioGithub, + beamWebsite, + aboutBeam, +} + +const kShortcutsText = "Shortcuts"; + +const kBeamPlaygroundGithubText = "Beam Playground on GitHub"; +const kBeamPlaygroundGithubLink = + "https://github.com/apache/beam/tree/master/playground/frontend"; + +const kApacheBeamGithubText = "Apache Beam on GitHub"; +const kApacheBeamGithubLink = + "https://github.com/apache/beam/tree/master/playground/frontend"; + +const kScioGithubText = "SCIO on GitHub"; +const kScioGithubLink = "https://github.com/spotify/scio"; + +const kBeamWebsiteText = "To Apache Beam website"; +const kBeamWebsiteLink = "https://beam.apache.org/"; + +const kAboutBeamText = "About Apache Beam"; + +class MoreActions extends StatelessWidget { + const MoreActions({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + child: PopupMenuButton<HeaderAction>( + icon: Icon( + Icons.more_horiz_outlined, + color: ThemeColors.of(context).grey1Color, + ), + itemBuilder: (BuildContext context) => <PopupMenuEntry<HeaderAction>>[ + PopupMenuItem<HeaderAction>( + padding: EdgeInsets.zero, + value: HeaderAction.shortcuts, + child: ListTile( + leading: SvgPicture.asset("shortcuts.svg"), + title: const Text(kShortcutsText), + ), + ), + PopupMenuItem<HeaderAction>( + padding: EdgeInsets.zero, + value: HeaderAction.beamPlaygroundGithub, + child: ListTile( + leading: SvgPicture.asset("github.svg"), + title: const Text(kBeamPlaygroundGithubText), + onTap: () => html.window.open( Review comment: Thank you, it's working with `url_launcher`. I tried `flutter test` ```flutter test 00:01 +4: All tests passed!``` ########## File path: playground/frontend/lib/pages/playground/components/more_actions.dart ########## @@ -0,0 +1,134 @@ +/* + * 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:flutter_svg/flutter_svg.dart'; +import 'dart:html' as html; + +import 'package:playground/config/theme.dart'; + +enum HeaderAction { + shortcuts, + beamPlaygroundGithub, + apacheBeamGithub, + scioGithub, + beamWebsite, + aboutBeam, +} + +const kShortcutsText = "Shortcuts"; + +const kBeamPlaygroundGithubText = "Beam Playground on GitHub"; +const kBeamPlaygroundGithubLink = + "https://github.com/apache/beam/tree/master/playground/frontend"; + +const kApacheBeamGithubText = "Apache Beam on GitHub"; +const kApacheBeamGithubLink = + "https://github.com/apache/beam/tree/master/playground/frontend"; + +const kScioGithubText = "SCIO on GitHub"; +const kScioGithubLink = "https://github.com/spotify/scio"; + +const kBeamWebsiteText = "To Apache Beam website"; +const kBeamWebsiteLink = "https://beam.apache.org/"; + +const kAboutBeamText = "About Apache Beam"; + +class MoreActions extends StatelessWidget { + const MoreActions({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + child: PopupMenuButton<HeaderAction>( + icon: Icon( + Icons.more_horiz_outlined, + color: ThemeColors.of(context).grey1Color, + ), + itemBuilder: (BuildContext context) => <PopupMenuEntry<HeaderAction>>[ + PopupMenuItem<HeaderAction>( + padding: EdgeInsets.zero, + value: HeaderAction.shortcuts, + child: ListTile( + leading: SvgPicture.asset("shortcuts.svg"), + title: const Text(kShortcutsText), + ), + ), + PopupMenuItem<HeaderAction>( + padding: EdgeInsets.zero, + value: HeaderAction.beamPlaygroundGithub, + child: ListTile( + leading: SvgPicture.asset("github.svg"), + title: const Text(kBeamPlaygroundGithubText), + onTap: () => html.window.open( Review comment: Thank you, it's working with `url_launcher`. I tried `flutter test` ```flutter test 00:01 +4: All tests passed! -- 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]
