damondouglas commented on a change in pull request #15700:
URL: https://github.com/apache/beam/pull/15700#discussion_r726283323



##########
File path: playground/frontend/lib/modules/output/components/output_area.dart
##########
@@ -23,8 +23,15 @@ class OutputArea extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    return const Center(
-      child: Text('Output'),
+    return Container(
+      color: Theme.of(context).backgroundColor,
+      child: const TabBarView(
+        children: <Widget>[
+          Center(child: Text("Output")),

Review comment:
       May we consider putting these header labels as constants?

##########
File path: 
playground/frontend/lib/components/toggle_theme_button/toggle_theme_button.dart
##########
@@ -31,16 +32,13 @@ class ToggleThemeButton extends StatelessWidget {
   Widget build(BuildContext context) {
     return Consumer<ThemeProvider>(builder: (context, theme, child) {
       final text = theme.isDarkMode ? kLightMode : kDartMode;
-      final icon = theme.isDarkMode
-          ? Icons.light_mode_outlined
-          : Icons.mode_night_outlined;
       return Padding(
         padding: const EdgeInsets.symmetric(
           vertical: kSmSpacing,
           horizontal: kMdSpacing,
         ),
         child: TextButton.icon(
-          icon: Icon(icon),
+          icon: SvgPicture.asset("theme.svg"),

Review comment:
       May we hoist `"theme.svg"` as a `const` to the top of the file or in a 
constants file?

##########
File path: playground/frontend/lib/modules/actions/components/reset_action.dart
##########
@@ -0,0 +1,42 @@
+/*
+ * 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 'package:playground/config/theme.dart';
+import 'package:playground/modules/actions/components/header_icon_button.dart';
+
+const kResetButtonText = "Reset";
+
+class ResetAction extends StatelessWidget {
+  final VoidCallback reset;
+
+  const ResetAction({Key? key, required this.reset}) : super(key: key);
+
+  @override
+  Widget build(BuildContext context) {
+    return HeaderIconButton(
+      icon: SvgPicture.asset(
+        "reset.svg",

Review comment:
       May we consider hoisting this constant at the top of this file or a 
constants library.

##########
File path: 
playground/frontend/lib/modules/actions/components/new_example_action.dart
##########
@@ -0,0 +1,40 @@
+/*
+ * 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 'dart:html' as html;

Review comment:
       When running `flutter test`, I received the following error:
   
   ```
   Error: Not found: 'dart:html'
   ```
   
   I didn't receive any error when running the application in Chrome.

##########
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:
       May we consider using the `url_launcher` 
(https://pub.dev/packages/url_launcher) package instead?  Tests raised errors 
in finding the `dart:html`.  I tried to investigate running `flutter test` with 
a specific device/platform or use of `TestOn` annotation but this didn't seem 
to work.




-- 
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