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


##########
learning/tour-of-beam/frontend/lib/components/scaffold.dart:
##########
@@ -0,0 +1,77 @@
+/*
+ * 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_components/playground_components.dart';
+
+import 'footer.dart';
+import 'login/login_button.dart';
+import 'logo.dart';
+import 'profile/avatar.dart';
+import 'sdk_dropdown.dart';
+
+class TobScaffold extends StatelessWidget {

Review Comment:
   This is common when a file per class is enforced.
   Dart has no prescription for this because global code like variables, 
constants, typedefs, etc. are commonly used.
   Instead Dart enforces lowercase file names which already breaks the 
strictness of file naming and some of its benefits (like automated file 
location, searching for uses and file inclusions in a single find-in-files 
search, etc.).
   
   On top of that, I see the following reasons to stray from name matches:
   
   - I like naming widgets with `Widget` at the end so we don't trap ourselves 
like Flutter did reserving `Image` class for a widget. I only do otherwise if 
the widget suffix makes it obvious like `Button`. This would make most of the 
widget files end with `_widget.dart` which clutters the view.
   - Renaming identifiers is a good practice when we find more precise names 
for identifiers. This is easy if only the code but not the file names. Renaming 
files requires caution as we have seen in this PR which confused git a lot. So 
file renaming should be avoided. This mismatch is a factor to untie the two.
   
   But I am open to tie. @nausharipov what do you think?



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