Parcourir la source

Merge branch 'main' into cache_info

Neeraj Gupta il y a 2 ans
Parent
commit
8f3279f9f8

+ 4 - 1
lib/ui/components/action_sheet_widget.dart

@@ -177,7 +177,10 @@ class ActionButtons extends StatelessWidget {
     final actionButtonsWithSeparators = actionButtons;
     return Column(
       children:
-          addSeparators(actionButtonsWithSeparators, const SizedBox(height: 8)),
+          //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)),
     );
   }
 }

+ 3 - 7
lib/ui/components/button_widget.dart

@@ -83,6 +83,7 @@ class ButtonWidget extends StatelessWidget {
     final buttonStyle = CustomButtonStyle(
       //Dummy default values since we need to keep these properties non-nullable
       defaultButtonColor: Colors.transparent,
+      defaultBorderColor: Colors.transparent,
       defaultIconColor: Colors.transparent,
       defaultLabelStyle: textTheme.body,
     );
@@ -161,7 +162,7 @@ class ButtonChildWidget extends StatefulWidget {
 
 class _ButtonChildWidgetState extends State<ButtonChildWidget> {
   late Color buttonColor;
-  late Color? borderColor;
+  late Color borderColor;
   late Color iconColor;
   late TextStyle labelStyle;
   late Color checkIconColor;
@@ -208,12 +209,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
         decoration: BoxDecoration(
           borderRadius: const BorderRadius.all(Radius.circular(4)),
           color: buttonColor,
-          border: borderColor != null
-              ? Border.all(
-                  color: borderColor!,
-                  // strokeAlign: StrokeAlign.outside,
-                )
-              : null,
+          border: Border.all(color: borderColor),
         ),
         child: Padding(
           padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 16),

+ 2 - 5
lib/ui/components/models/button_type.dart

@@ -75,14 +75,11 @@ enum ButtonType {
     return null;
   }
 
-  Color? defaultBorderColor(
-    EnteColorScheme colorScheme,
-    ButtonSize buttonSize,
-  ) {
+  Color defaultBorderColor(EnteColorScheme colorScheme, ButtonSize buttonSize) {
     if (this == ButtonType.tertiaryCritical && buttonSize == ButtonSize.large) {
       return colorScheme.warning700;
     }
-    return null;
+    return Colors.transparent;
   }
 
   //Returning null to fallback to default color

+ 2 - 2
lib/ui/components/models/custom_button_style.dart

@@ -4,7 +4,7 @@ class CustomButtonStyle {
   Color defaultButtonColor;
   Color? pressedButtonColor;
   Color? disabledButtonColor;
-  Color? defaultBorderColor;
+  Color defaultBorderColor;
   Color? pressedBorderColor;
   Color? disabledBorderColor;
   Color defaultIconColor;
@@ -19,7 +19,7 @@ class CustomButtonStyle {
     required this.defaultButtonColor,
     this.pressedButtonColor,
     this.disabledButtonColor,
-    this.defaultBorderColor,
+    required this.defaultBorderColor,
     this.pressedBorderColor,
     this.disabledBorderColor,
     required this.defaultIconColor,