瀏覽代碼

Added some comments

ashilkn 2 年之前
父節點
當前提交
415fabeeb6
共有 2 個文件被更改,包括 11 次插入6 次删除
  1. 8 5
      lib/ui/components/action_sheet_widget.dart
  2. 3 1
      lib/ui/components/large_button_widget.dart

+ 8 - 5
lib/ui/components/action_sheet_widget.dart

@@ -99,14 +99,15 @@ class ContentContainerWidget extends StatelessWidget {
     final textTheme = getEnteTextTheme(context);
     final textTheme = getEnteTextTheme(context);
     return Column(
     return Column(
       mainAxisSize: MainAxisSize.min,
       mainAxisSize: MainAxisSize.min,
-      //set cross axis to center when icon should be shown in place of body
+      //todo: set cross axis to center when icon should be shown in place of body
       crossAxisAlignment: CrossAxisAlignment.stretch,
       crossAxisAlignment: CrossAxisAlignment.stretch,
       children: [
       children: [
         title == null
         title == null
             ? const SizedBox.shrink()
             ? const SizedBox.shrink()
             : Text(
             : Text(
                 title!,
                 title!,
-                style: textTheme.h3Bold.copyWith(color: textBaseDark),
+                style: textTheme.h3Bold
+                    .copyWith(color: textBaseDark), //constant color
               ),
               ),
         title == null || body == null
         title == null || body == null
             ? const SizedBox.shrink()
             ? const SizedBox.shrink()
@@ -115,7 +116,8 @@ class ContentContainerWidget extends StatelessWidget {
             ? const SizedBox.shrink()
             ? const SizedBox.shrink()
             : Text(
             : Text(
                 body!,
                 body!,
-                style: textTheme.body.copyWith(color: textMutedDark),
+                style: textTheme.body
+                    .copyWith(color: textMutedDark), //constant color
               )
               )
       ],
       ],
     );
     );
@@ -131,8 +133,9 @@ class ActionButtons extends StatelessWidget {
     final actionButtonsWithSeparators = actionButtons;
     final actionButtonsWithSeparators = actionButtons;
     return Column(
     return Column(
       children:
       children:
-          //Separator is 8pts in figma. -2pts here as the action buttons are 2pts
-          //extra in height in code compared to figma because of the border of buttons
+          //Separator height is 8pts in figma. -2pts here as the action
+          //buttons are 2pts extra in height in code compared to figma because
+          //of the border(1pt top + 1pt bottom) of action buttons.
           addSeparators(actionButtonsWithSeparators, const SizedBox(height: 6)),
           addSeparators(actionButtonsWithSeparators, const SizedBox(height: 6)),
     );
     );
   }
   }

+ 3 - 1
lib/ui/components/large_button_widget.dart

@@ -72,7 +72,7 @@ class LargeButtonWidget extends StatelessWidget {
         ),
         ),
         child: Padding(
         child: Padding(
           padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 16),
           padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 16),
-          //show loading or row depending on state of button
+          //todo: show loading or row depending on state of button
           child: _hasTrailingIcon()
           child: _hasTrailingIcon()
               ? Row(
               ? Row(
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -212,6 +212,7 @@ class LargeButtonWidget extends StatelessWidget {
     return null;
     return null;
   }
   }
 
 
+  //Returning null to fallback to default color
   Color? _disabledIconColor(EnteColorScheme colorScheme) {
   Color? _disabledIconColor(EnteColorScheme colorScheme) {
     if (buttonType == ButtonType.primary ||
     if (buttonType == ButtonType.primary ||
         buttonType == ButtonType.secondary) {
         buttonType == ButtonType.secondary) {
@@ -254,6 +255,7 @@ class LargeButtonWidget extends StatelessWidget {
     return null;
     return null;
   }
   }
 
 
+  //Returning null to fallback to default color
   TextStyle? _disabledLabelStyle(
   TextStyle? _disabledLabelStyle(
     EnteTextTheme textTheme,
     EnteTextTheme textTheme,
     EnteColorScheme colorScheme,
     EnteColorScheme colorScheme,