浏览代码

Layout fixes for ChipButtonWidget

ashilkn 2 年之前
父节点
当前提交
573ee901c8
共有 1 个文件被更改,包括 10 次插入8 次删除
  1. 10 8
      lib/ui/components/buttons/chip_button_widget.dart

+ 10 - 8
lib/ui/components/buttons/chip_button_widget.dart

@@ -37,14 +37,16 @@ class ChipButtonWidget extends StatelessWidget {
                       size: 17,
                     )
                   : const SizedBox.shrink(),
-              const SizedBox(width: 4),
-              Padding(
-                padding: const EdgeInsets.symmetric(horizontal: 4),
-                child: Text(
-                  label ?? "",
-                  style: getEnteTextTheme(context).smallBold,
-                ),
-              )
+              if (label != null && leadingIcon != null)
+                const SizedBox(width: 4),
+              if (label != null)
+                Padding(
+                  padding: const EdgeInsets.symmetric(horizontal: 4),
+                  child: Text(
+                    label!,
+                    style: getEnteTextTheme(context).smallBold,
+                  ),
+                )
             ],
           ),
         ),