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
|
@override
|
||||||
void updateRow(String groupId, RowPB row) {}
|
void updateRow(String groupId, RowPB row) {
|
||||||
|
//
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,13 @@ class _BoardSelectOptionCellState extends State<BoardSelectOptionCell> {
|
|||||||
.toList();
|
.toList();
|
||||||
return Align(
|
return Align(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Wrap(children: children, spacing: 4, runSpacing: 2),
|
child: AbsorbPointer(
|
||||||
|
child: Wrap(
|
||||||
|
children: children,
|
||||||
|
spacing: 4,
|
||||||
|
runSpacing: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -37,10 +37,15 @@ class _BoardTextCellState extends State<BoardTextCell> {
|
|||||||
} else {
|
} else {
|
||||||
return Align(
|
return Align(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints.loose(
|
||||||
|
const Size(double.infinity, 100),
|
||||||
|
),
|
||||||
child: FlowyText.regular(
|
child: FlowyText.regular(
|
||||||
state.content,
|
state.content,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -35,7 +35,12 @@ class _BoardUrlCellState extends State<BoardUrlCell> {
|
|||||||
value: _cellBloc,
|
value: _cellBloc,
|
||||||
child: BlocBuilder<BoardURLCellBloc, BoardURLCellState>(
|
child: BlocBuilder<BoardURLCellBloc, BoardURLCellState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
final richText = RichText(
|
if (state.content.isEmpty) {
|
||||||
|
return const SizedBox();
|
||||||
|
} else {
|
||||||
|
return Align(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: RichText(
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
text: state.content,
|
text: state.content,
|
||||||
@ -45,12 +50,9 @@ class _BoardUrlCellState extends State<BoardUrlCell> {
|
|||||||
decoration: TextDecoration.underline,
|
decoration: TextDecoration.underline,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
return Align(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: richText,
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -73,7 +73,7 @@ class _BoardCardState extends State<BoardCard> {
|
|||||||
(cellId) {
|
(cellId) {
|
||||||
final child = widget.cellBuilder.buildCell(cellId);
|
final child = widget.cellBuilder.buildCell(cellId);
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -242,7 +242,7 @@ class IGridCellController<T, D> extends Equatable {
|
|||||||
.getFieldTypeOptionData(fieldType: fieldType)
|
.getFieldTypeOptionData(fieldType: fieldType)
|
||||||
.then((result) {
|
.then((result) {
|
||||||
return result.fold(
|
return result.fold(
|
||||||
(data) => parser.fromBuffer(data.typeOptionData),
|
(data) => left(parser.fromBuffer(data.typeOptionData)),
|
||||||
(err) => right(err),
|
(err) => right(err),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -15,7 +15,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:table_calendar/table_calendar.dart';
|
import 'package:table_calendar/table_calendar.dart';
|
||||||
import 'package:app_flowy/plugins/grid/application/prelude.dart';
|
import 'package:app_flowy/plugins/grid/application/prelude.dart';
|
||||||
|
|
||||||
import '../../../layout/sizes.dart';
|
import '../../../layout/sizes.dart';
|
||||||
import '../../header/type_option/date.dart';
|
import '../../header/type_option/date.dart';
|
||||||
|
|
||||||
@ -39,6 +38,7 @@ class DateCellEditor with FlowyOverlayDelegate {
|
|||||||
|
|
||||||
final result =
|
final result =
|
||||||
await cellController.getFieldTypeOption(DateTypeOptionDataParser());
|
await cellController.getFieldTypeOption(DateTypeOptionDataParser());
|
||||||
|
|
||||||
result.fold(
|
result.fold(
|
||||||
(dateTypeOptionPB) {
|
(dateTypeOptionPB) {
|
||||||
final calendar = _CellCalendarWidget(
|
final calendar = _CellCalendarWidget(
|
||||||
|
@ -49,8 +49,10 @@ class _NumberCellState extends GridFocusNodeCellState<GridNumberCell> {
|
|||||||
controller: _controller,
|
controller: _controller,
|
||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
onEditingComplete: () => focusNode.unfocus(),
|
onEditingComplete: () => focusNode.unfocus(),
|
||||||
maxLines: null,
|
onSubmitted: (_) => focusNode.unfocus(),
|
||||||
|
maxLines: 1,
|
||||||
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
||||||
|
textInputAction: TextInputAction.done,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
@ -63,8 +65,6 @@ class _NumberCellState extends GridFocusNodeCellState<GridNumberCell> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> dispose() async {
|
Future<void> dispose() async {
|
||||||
_delayOperation?.cancel();
|
|
||||||
_cellBloc.close();
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,6 +76,11 @@ class _NumberCellState extends GridFocusNodeCellState<GridNumberCell> {
|
|||||||
if (_cellBloc.isClosed == false &&
|
if (_cellBloc.isClosed == false &&
|
||||||
_controller.text != contentFromState(_cellBloc.state)) {
|
_controller.text != contentFromState(_cellBloc.state)) {
|
||||||
_cellBloc.add(NumberCellEvent.updateCell(_controller.text));
|
_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> {
|
pub async fn create_row(&self, params: CreateRowParams) -> FlowyResult<RowPB> {
|
||||||
let mut row_rev = self.create_row_rev().await?;
|
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?;
|
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<()> {
|
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> {
|
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 {
|
match params.layout {
|
||||||
GridLayout::Table => {
|
GridLayout::Table => {
|
||||||
// Table can be grouped too
|
// 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() {
|
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) {
|
pub(crate) async fn did_create_row(&self, row_pb: &RowPB, params: &CreateRowParams) {
|
||||||
for view_editor in self.view_editors.iter() {
|
for view_editor in self.view_editors.iter() {
|
||||||
view_editor.did_create_row(row_pb, params).await;
|
view_editor.did_create_row(row_pb, params).await;
|
||||||
|
Loading…
Reference in New Issue
Block a user