mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: fix some bugs
This commit is contained in:
parent
c5e24cc346
commit
99e408e2d7
@ -253,5 +253,7 @@ class GroupControllerDelegateImpl extends GroupControllerDelegate {
|
||||
}
|
||||
|
||||
@override
|
||||
void updateRow(String groupId, RowPB row) {}
|
||||
void updateRow(String groupId, RowPB row) {
|
||||
//
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,13 @@ class _BoardSelectOptionCellState extends State<BoardSelectOptionCell> {
|
||||
.toList();
|
||||
return Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Wrap(children: children, spacing: 4, runSpacing: 2),
|
||||
child: AbsorbPointer(
|
||||
child: Wrap(
|
||||
children: children,
|
||||
spacing: 4,
|
||||
runSpacing: 2,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -37,9 +37,14 @@ class _BoardTextCellState extends State<BoardTextCell> {
|
||||
} else {
|
||||
return Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: FlowyText.regular(
|
||||
state.content,
|
||||
fontSize: 14,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints.loose(
|
||||
const Size(double.infinity, 100),
|
||||
),
|
||||
child: FlowyText.regular(
|
||||
state.content,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -35,22 +35,24 @@ class _BoardUrlCellState extends State<BoardUrlCell> {
|
||||
value: _cellBloc,
|
||||
child: BlocBuilder<BoardURLCellBloc, BoardURLCellState>(
|
||||
builder: (context, state) {
|
||||
final richText = RichText(
|
||||
textAlign: TextAlign.left,
|
||||
text: TextSpan(
|
||||
text: state.content,
|
||||
style: TextStyle(
|
||||
color: theme.main2,
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
if (state.content.isEmpty) {
|
||||
return const SizedBox();
|
||||
} else {
|
||||
return Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: RichText(
|
||||
textAlign: TextAlign.left,
|
||||
text: TextSpan(
|
||||
text: state.content,
|
||||
style: TextStyle(
|
||||
color: theme.main2,
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: richText,
|
||||
);
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
|
@ -73,7 +73,7 @@ class _BoardCardState extends State<BoardCard> {
|
||||
(cellId) {
|
||||
final child = widget.cellBuilder.buildCell(cellId);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
|
@ -242,7 +242,7 @@ class IGridCellController<T, D> extends Equatable {
|
||||
.getFieldTypeOptionData(fieldType: fieldType)
|
||||
.then((result) {
|
||||
return result.fold(
|
||||
(data) => parser.fromBuffer(data.typeOptionData),
|
||||
(data) => left(parser.fromBuffer(data.typeOptionData)),
|
||||
(err) => right(err),
|
||||
);
|
||||
});
|
||||
|
@ -15,7 +15,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:table_calendar/table_calendar.dart';
|
||||
import 'package:app_flowy/plugins/grid/application/prelude.dart';
|
||||
|
||||
import '../../../layout/sizes.dart';
|
||||
import '../../header/type_option/date.dart';
|
||||
|
||||
@ -39,6 +38,7 @@ class DateCellEditor with FlowyOverlayDelegate {
|
||||
|
||||
final result =
|
||||
await cellController.getFieldTypeOption(DateTypeOptionDataParser());
|
||||
|
||||
result.fold(
|
||||
(dateTypeOptionPB) {
|
||||
final calendar = _CellCalendarWidget(
|
||||
|
@ -49,8 +49,10 @@ class _NumberCellState extends GridFocusNodeCellState<GridNumberCell> {
|
||||
controller: _controller,
|
||||
focusNode: focusNode,
|
||||
onEditingComplete: () => focusNode.unfocus(),
|
||||
maxLines: null,
|
||||
onSubmitted: (_) => focusNode.unfocus(),
|
||||
maxLines: 1,
|
||||
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
||||
textInputAction: TextInputAction.done,
|
||||
decoration: const InputDecoration(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
border: InputBorder.none,
|
||||
@ -63,8 +65,6 @@ class _NumberCellState extends GridFocusNodeCellState<GridNumberCell> {
|
||||
|
||||
@override
|
||||
Future<void> dispose() async {
|
||||
_delayOperation?.cancel();
|
||||
_cellBloc.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@ -76,6 +76,11 @@ class _NumberCellState extends GridFocusNodeCellState<GridNumberCell> {
|
||||
if (_cellBloc.isClosed == false &&
|
||||
_controller.text != contentFromState(_cellBloc.state)) {
|
||||
_cellBloc.add(NumberCellEvent.updateCell(_controller.text));
|
||||
|
||||
if (!mounted) {
|
||||
_delayOperation = null;
|
||||
_cellBloc.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ impl GridRevisionEditor {
|
||||
pub async fn create_row(&self, params: CreateRowParams) -> FlowyResult<RowPB> {
|
||||
let mut row_rev = self.create_row_rev().await?;
|
||||
|
||||
self.view_manager.update_row(&mut row_rev, ¶ms).await;
|
||||
self.view_manager.fill_row(&mut row_rev, ¶ms).await;
|
||||
|
||||
let row_pb = self.create_row_pb(row_rev, params.start_row_id.clone()).await?;
|
||||
|
||||
@ -314,7 +314,10 @@ impl GridRevisionEditor {
|
||||
}
|
||||
|
||||
pub async fn update_row(&self, changeset: RowMetaChangeset) -> FlowyResult<()> {
|
||||
self.block_manager.update_row(changeset, make_row_from_row_rev).await
|
||||
let row_id = changeset.row_id.clone();
|
||||
let _ = self.block_manager.update_row(changeset, make_row_from_row_rev).await?;
|
||||
self.view_manager.did_update_row(&row_id).await;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn get_rows(&self, block_id: &str) -> FlowyResult<RepeatedRowPB> {
|
||||
|
@ -76,7 +76,7 @@ impl GridViewRevisionEditor {
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) async fn update_row(&self, row_rev: &mut RowRevision, params: &CreateRowParams) {
|
||||
pub(crate) async fn fill_row(&self, row_rev: &mut RowRevision, params: &CreateRowParams) {
|
||||
match params.layout {
|
||||
GridLayout::Table => {
|
||||
// Table can be grouped too
|
||||
|
@ -47,12 +47,16 @@ impl GridViewManager {
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) async fn update_row(&self, row_rev: &mut RowRevision, params: &CreateRowParams) {
|
||||
pub(crate) async fn fill_row(&self, row_rev: &mut RowRevision, params: &CreateRowParams) {
|
||||
for view_editor in self.view_editors.iter() {
|
||||
view_editor.update_row(row_rev, params).await;
|
||||
view_editor.fill_row(row_rev, params).await;
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn did_update_row(&self, row_id: &str) {
|
||||
let row = self.block_manager.get_row_rev(row_id).await;
|
||||
}
|
||||
|
||||
pub(crate) async fn did_create_row(&self, row_pb: &RowPB, params: &CreateRowParams) {
|
||||
for view_editor in self.view_editors.iter() {
|
||||
view_editor.did_create_row(row_pb, params).await;
|
||||
|
Loading…
Reference in New Issue
Block a user