mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: overflow of SelectOptionTagCell
This commit is contained in:
parent
1b5b8f19d7
commit
f521c18512
@ -87,7 +87,7 @@ class SelectOptionTag extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ChoiceChip(
|
return ChoiceChip(
|
||||||
pressElevation: 1,
|
pressElevation: 1,
|
||||||
label: FlowyText.medium(name, fontSize: 12),
|
label: FlowyText.medium(name, fontSize: 12, overflow: TextOverflow.ellipsis),
|
||||||
selectedColor: color,
|
selectedColor: color,
|
||||||
backgroundColor: color,
|
backgroundColor: color,
|
||||||
labelPadding: const EdgeInsets.symmetric(horizontal: 6),
|
labelPadding: const EdgeInsets.symmetric(horizontal: 6),
|
||||||
@ -130,11 +130,18 @@ class SelectOptionTagCell extends StatelessWidget {
|
|||||||
child: InkWell(
|
child: InkWell(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 3),
|
padding: const EdgeInsets.symmetric(horizontal: 3),
|
||||||
child: Row(children: [
|
child: Row(
|
||||||
SelectOptionTag.fromSelectOption(context: context, option: option),
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
const Spacer(),
|
children: [
|
||||||
...children,
|
Flexible(
|
||||||
]),
|
fit: FlexFit.loose,
|
||||||
|
flex: 2,
|
||||||
|
child: SelectOptionTag.fromSelectOption(context: context, option: option),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
...children,
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
onTap: () => onSelected(option),
|
onTap: () => onSelected(option),
|
||||||
),
|
),
|
||||||
|
@ -225,7 +225,18 @@ class _SelectOptionCell extends StatelessWidget {
|
|||||||
height: GridSize.typeOptionItemHeight,
|
height: GridSize.typeOptionItemHeight,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: _body(theme, context)),
|
Flexible(
|
||||||
|
fit: FlexFit.loose,
|
||||||
|
child: SelectOptionTagCell(
|
||||||
|
option: option,
|
||||||
|
onSelected: (option) {
|
||||||
|
context.read<SelectOptionCellEditorBloc>().add(SelectOptionEditorEvent.selectOption(option.id));
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
if (isSelected) svgWidget("grid/checkmark"),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
FlowyIconButton(
|
FlowyIconButton(
|
||||||
width: 30,
|
width: 30,
|
||||||
onPressed: () => _showEditPannel(context),
|
onPressed: () => _showEditPannel(context),
|
||||||
@ -237,18 +248,6 @@ class _SelectOptionCell extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _body(AppTheme theme, BuildContext context) {
|
|
||||||
return SelectOptionTagCell(
|
|
||||||
option: option,
|
|
||||||
onSelected: (option) {
|
|
||||||
context.read<SelectOptionCellEditorBloc>().add(SelectOptionEditorEvent.selectOption(option.id));
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
if (isSelected) svgWidget("grid/checkmark"),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _showEditPannel(BuildContext context) {
|
void _showEditPannel(BuildContext context) {
|
||||||
final pannel = SelectOptionTypeOptionEditor(
|
final pannel = SelectOptionTypeOptionEditor(
|
||||||
option: option,
|
option: option,
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
import 'package:app_flowy/startup/startup.dart';
|
|
||||||
import 'package:app_flowy/workspace/application/grid/prelude.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
||||||
|
|
||||||
class NumberCell extends StatefulWidget {
|
|
||||||
final GridCell cellData;
|
|
||||||
|
|
||||||
const NumberCell({
|
|
||||||
required this.cellData,
|
|
||||||
Key? key,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<NumberCell> createState() => _NumberCellState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _NumberCellState extends State<NumberCell> {
|
|
||||||
late NumberCellBloc _cellBloc;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
_cellBloc = getIt<NumberCellBloc>(param1: widget.cellData);
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return BlocProvider.value(
|
|
||||||
value: _cellBloc,
|
|
||||||
child: BlocBuilder<NumberCellBloc, NumberCellState>(
|
|
||||||
builder: (context, state) {
|
|
||||||
return Container();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<void> dispose() async {
|
|
||||||
_cellBloc.close();
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
@ -67,7 +67,7 @@ class _RowDetailPageState extends State<RowDetailPage> {
|
|||||||
return bloc;
|
return bloc;
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 80, vertical: 40),
|
padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 20),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user