Skip to content

Commit f521c18

Browse files
committed
fix: overflow of SelectOptionTagCell
1 parent 1b5b8f1 commit f521c18

File tree

4 files changed

+26
-64
lines changed

4 files changed

+26
-64
lines changed

frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/extension.dart

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class SelectOptionTag extends StatelessWidget {
8787
Widget build(BuildContext context) {
8888
return ChoiceChip(
8989
pressElevation: 1,
90-
label: FlowyText.medium(name, fontSize: 12),
90+
label: FlowyText.medium(name, fontSize: 12, overflow: TextOverflow.ellipsis),
9191
selectedColor: color,
9292
backgroundColor: color,
9393
labelPadding: const EdgeInsets.symmetric(horizontal: 6),
@@ -130,11 +130,18 @@ class SelectOptionTagCell extends StatelessWidget {
130130
child: InkWell(
131131
child: Padding(
132132
padding: const EdgeInsets.symmetric(horizontal: 3),
133-
child: Row(children: [
134-
SelectOptionTag.fromSelectOption(context: context, option: option),
135-
const Spacer(),
136-
...children,
137-
]),
133+
child: Row(
134+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
135+
children: [
136+
Flexible(
137+
fit: FlexFit.loose,
138+
flex: 2,
139+
child: SelectOptionTag.fromSelectOption(context: context, option: option),
140+
),
141+
const Spacer(),
142+
...children,
143+
],
144+
),
138145
),
139146
onTap: () => onSelected(option),
140147
),

frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/select_option_editor.dart

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,18 @@ class _SelectOptionCell extends StatelessWidget {
225225
height: GridSize.typeOptionItemHeight,
226226
child: Row(
227227
children: [
228-
Expanded(child: _body(theme, context)),
228+
Flexible(
229+
fit: FlexFit.loose,
230+
child: SelectOptionTagCell(
231+
option: option,
232+
onSelected: (option) {
233+
context.read<SelectOptionCellEditorBloc>().add(SelectOptionEditorEvent.selectOption(option.id));
234+
},
235+
children: [
236+
if (isSelected) svgWidget("grid/checkmark"),
237+
],
238+
),
239+
),
229240
FlowyIconButton(
230241
width: 30,
231242
onPressed: () => _showEditPannel(context),
@@ -237,18 +248,6 @@ class _SelectOptionCell extends StatelessWidget {
237248
);
238249
}
239250

240-
Widget _body(AppTheme theme, BuildContext context) {
241-
return SelectOptionTagCell(
242-
option: option,
243-
onSelected: (option) {
244-
context.read<SelectOptionCellEditorBloc>().add(SelectOptionEditorEvent.selectOption(option.id));
245-
},
246-
children: [
247-
if (isSelected) svgWidget("grid/checkmark"),
248-
],
249-
);
250-
}
251-
252251
void _showEditPannel(BuildContext context) {
253252
final pannel = SelectOptionTypeOptionEditor(
254253
option: option,

frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/row/cell/number_cell.dart

Lines changed: 0 additions & 44 deletions
This file was deleted.

frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/row/row_detail.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class _RowDetailPageState extends State<RowDetailPage> {
6767
return bloc;
6868
},
6969
child: Padding(
70-
padding: const EdgeInsets.symmetric(horizontal: 80, vertical: 40),
70+
padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 20),
7171
child: Column(
7272
children: [
7373
SizedBox(

0 commit comments

Comments
 (0)