Browse Source

fix: improve look of select option list (#1168)

Richard Shiue 2 years ago
parent
commit
3dc64f3d50

+ 4 - 8
frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/extension.dart

@@ -130,14 +130,10 @@ class SelectOptionTagCell extends StatelessWidget {
               child: Row(
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 children: [
-                  Flexible(
-                    fit: FlexFit.loose,
-                    flex: 2,
-                    child: SelectOptionTag.fromOption(
-                      context: context,
-                      option: option,
-                      onSelected: () => onSelected(option),
-                    ),
+                  SelectOptionTag.fromOption(
+                    context: context,
+                    option: option,
+                    onSelected: () => onSelected(option),
                   ),
                   const Spacer(),
                   ...children,

+ 12 - 19
frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart

@@ -248,32 +248,25 @@ class _SelectOptionCellState extends State<_SelectOptionCell> {
       mutex: widget.popoverMutex,
       child: SizedBox(
         height: GridSize.typeOptionItemHeight,
-        child: Row(
+        child: SelectOptionTagCell(
+          option: widget.option,
+          onSelected: (option) {
+            context
+                .read<SelectOptionCellEditorBloc>()
+                .add(SelectOptionEditorEvent.selectOption(option.id));
+          },
           children: [
-            Flexible(
-              fit: FlexFit.loose,
-              child: SelectOptionTagCell(
-                option: widget.option,
-                onSelected: (option) {
-                  context
-                      .read<SelectOptionCellEditorBloc>()
-                      .add(SelectOptionEditorEvent.selectOption(option.id));
-                },
-                children: [
-                  if (widget.isSelected)
-                    Padding(
-                      padding: const EdgeInsets.only(right: 6),
-                      child: svgWidget("grid/checkmark"),
-                    ),
-                ],
+            if (widget.isSelected)
+              Padding(
+                padding: const EdgeInsets.only(right: 6),
+                child: svgWidget("grid/checkmark"),
               ),
-            ),
             FlowyIconButton(
               width: 30,
               onPressed: () => _popoverController.show(),
               iconPadding: const EdgeInsets.fromLTRB(4, 4, 4, 4),
               icon: svgWidget("editor/details", color: theme.iconColor),
-            )
+            ),
           ],
         ),
       ),