diff --git a/frontend/app_flowy/lib/plugins/board/application/card/board_checkbox_cell_bloc.dart b/frontend/app_flowy/lib/plugins/board/application/card/board_checkbox_cell_bloc.dart index 8229fd1588..37dcf8bab3 100644 --- a/frontend/app_flowy/lib/plugins/board/application/card/board_checkbox_cell_bloc.dart +++ b/frontend/app_flowy/lib/plugins/board/application/card/board_checkbox_cell_bloc.dart @@ -64,7 +64,7 @@ class BoardCheckboxCellState with _$BoardCheckboxCellState { required bool isSelected, }) = _CheckboxCellState; - factory BoardCheckboxCellState.initial(GridCellController context) { + factory BoardCheckboxCellState.initial(GridTextCellController context) { return BoardCheckboxCellState( isSelected: _isSelected(context.getCellData())); } diff --git a/frontend/app_flowy/lib/plugins/board/application/card/board_number_cell_bloc.dart b/frontend/app_flowy/lib/plugins/board/application/card/board_number_cell_bloc.dart index 4cf0930591..fb9759cc72 100644 --- a/frontend/app_flowy/lib/plugins/board/application/card/board_number_cell_bloc.dart +++ b/frontend/app_flowy/lib/plugins/board/application/card/board_number_cell_bloc.dart @@ -60,7 +60,7 @@ class BoardNumberCellState with _$BoardNumberCellState { required String content, }) = _BoardNumberCellState; - factory BoardNumberCellState.initial(GridCellController context) => + factory BoardNumberCellState.initial(GridTextCellController context) => BoardNumberCellState( content: context.getCellData() ?? "", ); diff --git a/frontend/app_flowy/lib/plugins/board/application/card/board_text_cell_bloc.dart b/frontend/app_flowy/lib/plugins/board/application/card/board_text_cell_bloc.dart index 003c3a34f4..1273877f29 100644 --- a/frontend/app_flowy/lib/plugins/board/application/card/board_text_cell_bloc.dart +++ b/frontend/app_flowy/lib/plugins/board/application/card/board_text_cell_bloc.dart @@ -6,7 +6,7 @@ import 'dart:async'; part 'board_text_cell_bloc.freezed.dart'; class BoardTextCellBloc extends Bloc { - final GridCellController cellController; + final GridTextCellController cellController; void Function()? _onCellChangedFn; BoardTextCellBloc({ required this.cellController, @@ -71,7 +71,7 @@ class BoardTextCellState with _$BoardTextCellState { required bool enableEdit, }) = _BoardTextCellState; - factory BoardTextCellState.initial(GridCellController context) => + factory BoardTextCellState.initial(GridTextCellController context) => BoardTextCellState( content: context.getCellData() ?? "", enableEdit: false, diff --git a/frontend/app_flowy/lib/plugins/board/presentation/board_page.dart b/frontend/app_flowy/lib/plugins/board/presentation/board_page.dart index 89daeb8617..4c8777a204 100644 --- a/frontend/app_flowy/lib/plugins/board/presentation/board_page.dart +++ b/frontend/app_flowy/lib/plugins/board/presentation/board_page.dart @@ -288,7 +288,7 @@ class _BoardContentState extends State { rowPB: rowPB, ); - final dataController = GridRowDataController( + final dataController = RowDataController( rowInfo: rowInfo, fieldController: fieldController, rowCache: rowCache, diff --git a/frontend/app_flowy/lib/plugins/board/presentation/card/board_text_cell.dart b/frontend/app_flowy/lib/plugins/board/presentation/card/board_text_cell.dart index f5252a178a..00501c8be8 100644 --- a/frontend/app_flowy/lib/plugins/board/presentation/card/board_text_cell.dart +++ b/frontend/app_flowy/lib/plugins/board/presentation/card/board_text_cell.dart @@ -35,7 +35,7 @@ class _BoardTextCellState extends State { @override void initState() { final cellController = - widget.cellControllerBuilder.build() as GridCellController; + widget.cellControllerBuilder.build() as GridTextCellController; _cellBloc = BoardTextCellBloc(cellController: cellController) ..add(const BoardTextCellEvent.initial()); _controller = TextEditingController(text: _cellBloc.state.content); diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_controller.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_controller.dart index bb2dcc59d7..22e01dd08e 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_controller.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_controller.dart @@ -1,15 +1,15 @@ part of 'cell_service.dart'; -typedef GridCellController = IGridCellController; -typedef GridCheckboxCellController = IGridCellController; -typedef GridNumberCellController = IGridCellController; +typedef GridTextCellController = GridCellController; +typedef GridCheckboxCellController = GridCellController; +typedef GridNumberCellController = GridCellController; typedef GridSelectOptionCellController - = IGridCellController; + = GridCellController; typedef GridChecklistCellController - = IGridCellController; + = GridCellController; typedef GridDateCellController - = IGridCellController; -typedef GridURLCellController = IGridCellController; + = GridCellController; +typedef GridURLCellController = GridCellController; abstract class GridCellControllerBuilderDelegate { GridCellFieldNotifier buildFieldNotifier(); @@ -27,7 +27,7 @@ class GridCellControllerBuilder { }) : _cellCache = cellCache, _cellId = cellId; - IGridCellController build() { + GridCellController build() { final cellFieldNotifier = delegate.buildFieldNotifier(); switch (_cellId.fieldType) { case FieldType.Checkbox: @@ -35,12 +35,12 @@ class GridCellControllerBuilder { cellId: _cellId, parser: StringCellDataParser(), ); - return GridCellController( + return GridTextCellController( cellId: _cellId, cellCache: _cellCache, cellDataLoader: cellDataLoader, fieldNotifier: cellFieldNotifier, - cellDataPersistence: CellDataPersistence(cellId: _cellId), + cellDataPersistence: TextCellDataPersistence(cellId: _cellId), ); case FieldType.DateTime: final cellDataLoader = GridCellDataLoader( @@ -67,19 +67,19 @@ class GridCellControllerBuilder { cellCache: _cellCache, cellDataLoader: cellDataLoader, fieldNotifier: cellFieldNotifier, - cellDataPersistence: CellDataPersistence(cellId: _cellId), + cellDataPersistence: TextCellDataPersistence(cellId: _cellId), ); case FieldType.RichText: final cellDataLoader = GridCellDataLoader( cellId: _cellId, parser: StringCellDataParser(), ); - return GridCellController( + return GridTextCellController( cellId: _cellId, cellCache: _cellCache, cellDataLoader: cellDataLoader, fieldNotifier: cellFieldNotifier, - cellDataPersistence: CellDataPersistence(cellId: _cellId), + cellDataPersistence: TextCellDataPersistence(cellId: _cellId), ); case FieldType.MultiSelect: case FieldType.SingleSelect: @@ -95,7 +95,7 @@ class GridCellControllerBuilder { cellCache: _cellCache, cellDataLoader: cellDataLoader, fieldNotifier: cellFieldNotifier, - cellDataPersistence: CellDataPersistence(cellId: _cellId), + cellDataPersistence: TextCellDataPersistence(cellId: _cellId), ); case FieldType.URL: @@ -108,7 +108,7 @@ class GridCellControllerBuilder { cellCache: _cellCache, cellDataLoader: cellDataLoader, fieldNotifier: cellFieldNotifier, - cellDataPersistence: CellDataPersistence(cellId: _cellId), + cellDataPersistence: TextCellDataPersistence(cellId: _cellId), ); } throw UnimplementedError; @@ -123,14 +123,14 @@ class GridCellControllerBuilder { /// Generic D represents the type of data that will be saved to the disk /// // ignore: must_be_immutable -class IGridCellController extends Equatable { +class GridCellController extends Equatable { final GridCellIdentifier cellId; final GridCellCache _cellsCache; final GridCellCacheKey _cacheKey; final FieldService _fieldService; final GridCellFieldNotifier _fieldNotifier; final GridCellDataLoader _cellDataLoader; - final IGridCellDataPersistence _cellDataPersistence; + final GridCellDataPersistence _cellDataPersistence; CellListener? _cellListener; CellDataNotifier? _cellDataNotifier; @@ -141,12 +141,12 @@ class IGridCellController extends Equatable { Timer? _saveDataOperation; bool _isDispose = false; - IGridCellController({ + GridCellController({ required this.cellId, required GridCellCache cellCache, required GridCellFieldNotifier fieldNotifier, required GridCellDataLoader cellDataLoader, - required IGridCellDataPersistence cellDataPersistence, + required GridCellDataPersistence cellDataPersistence, }) : _cellsCache = cellCache, _cellDataLoader = cellDataLoader, _cellDataPersistence = cellDataPersistence, diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_data_loader.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_data_loader.dart index daf404d497..7c269df6d2 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_data_loader.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_data_loader.dart @@ -5,14 +5,14 @@ abstract class IGridCellDataConfig { bool get reloadOnFieldChanged; } -abstract class IGridCellDataParser { +abstract class GridCellDataParser { T? parserData(List data); } class GridCellDataLoader { final CellService service = CellService(); final GridCellIdentifier cellId; - final IGridCellDataParser parser; + final GridCellDataParser parser; final bool reloadOnFieldChanged; GridCellDataLoader({ @@ -43,7 +43,7 @@ class GridCellDataLoader { } } -class StringCellDataParser implements IGridCellDataParser { +class StringCellDataParser implements GridCellDataParser { @override String? parserData(List data) { final s = utf8.decode(data); @@ -51,7 +51,7 @@ class StringCellDataParser implements IGridCellDataParser { } } -class DateCellDataParser implements IGridCellDataParser { +class DateCellDataParser implements GridCellDataParser { @override DateCellDataPB? parserData(List data) { if (data.isEmpty) { @@ -62,7 +62,7 @@ class DateCellDataParser implements IGridCellDataParser { } class SelectOptionCellDataParser - implements IGridCellDataParser { + implements GridCellDataParser { @override SelectOptionCellDataPB? parserData(List data) { if (data.isEmpty) { @@ -72,7 +72,7 @@ class SelectOptionCellDataParser } } -class URLCellDataParser implements IGridCellDataParser { +class URLCellDataParser implements GridCellDataParser { @override URLCellDataPB? parserData(List data) { if (data.isEmpty) { diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_data_persistence.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_data_persistence.dart index 17edb59824..f8dbd67dd0 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_data_persistence.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/cell_data_persistence.dart @@ -2,14 +2,14 @@ part of 'cell_service.dart'; /// Save the cell data to disk /// You can extend this class to do custom operations. For example, the DateCellDataPersistence. -abstract class IGridCellDataPersistence { +abstract class GridCellDataPersistence { Future> save(D data); } -class CellDataPersistence implements IGridCellDataPersistence { +class TextCellDataPersistence implements GridCellDataPersistence { final GridCellIdentifier cellId; - CellDataPersistence({ + TextCellDataPersistence({ required this.cellId, }); final CellService _cellService = CellService(); @@ -33,8 +33,7 @@ class CalendarData with _$CalendarData { _CalendarData; } -class DateCellDataPersistence - implements IGridCellDataPersistence { +class DateCellDataPersistence implements GridCellDataPersistence { final GridCellIdentifier cellId; DateCellDataPersistence({ required this.cellId, diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/checkbox_cell_bloc.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/checkbox_cell_bloc.dart index 503dd88b81..9ff1534ba4 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/checkbox_cell_bloc.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/checkbox_cell_bloc.dart @@ -65,7 +65,7 @@ class CheckboxCellState with _$CheckboxCellState { required bool isSelected, }) = _CheckboxCellState; - factory CheckboxCellState.initial(GridCellController context) { + factory CheckboxCellState.initial(GridTextCellController context) { return CheckboxCellState(isSelected: _isSelected(context.getCellData())); } } diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/number_cell_bloc.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/number_cell_bloc.dart index de4dd38fc1..d3217794f3 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/number_cell_bloc.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/number_cell_bloc.dart @@ -82,7 +82,7 @@ class NumberCellState with _$NumberCellState { required String cellContent, }) = _NumberCellState; - factory NumberCellState.initial(GridCellController context) { + factory NumberCellState.initial(GridTextCellController context) { return NumberCellState( cellContent: context.getCellData() ?? "", ); diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/text_cell_bloc.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/text_cell_bloc.dart index 499721a40e..018baf2703 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/text_cell_bloc.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/text_cell_bloc.dart @@ -6,7 +6,7 @@ import 'cell_service/cell_service.dart'; part 'text_cell_bloc.freezed.dart'; class TextCellBloc extends Bloc { - final GridCellController cellController; + final GridTextCellController cellController; void Function()? _onCellChangedFn; TextCellBloc({ required this.cellController, @@ -66,7 +66,8 @@ class TextCellState with _$TextCellState { required String content, }) = _TextCellState; - factory TextCellState.initial(GridCellController context) => TextCellState( + factory TextCellState.initial(GridTextCellController context) => + TextCellState( content: context.getCellData() ?? "", ); } diff --git a/frontend/app_flowy/lib/plugins/grid/application/field/field_controller.dart b/frontend/app_flowy/lib/plugins/grid/application/field/field_controller.dart index be0d03e514..de5831d587 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/field/field_controller.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/field/field_controller.dart @@ -652,7 +652,8 @@ class GridFieldController { } } -class GridRowFieldNotifierImpl extends IGridRowFieldNotifier { +class GridRowFieldNotifierImpl extends RowChangesetNotifierForward + with RowCacheDelegate { final GridFieldController _cache; OnReceiveUpdateFields? _onChangesetFn; OnReceiveFields? _onFieldFn; diff --git a/frontend/app_flowy/lib/plugins/grid/application/row/row_bloc.dart b/frontend/app_flowy/lib/plugins/grid/application/row/row_bloc.dart index 98d80960bc..2d496dc2a3 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/row/row_bloc.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/row/row_bloc.dart @@ -13,11 +13,11 @@ part 'row_bloc.freezed.dart'; class RowBloc extends Bloc { final RowFFIService _rowService; - final GridRowDataController _dataController; + final RowDataController _dataController; RowBloc({ required RowInfo rowInfo, - required GridRowDataController dataController, + required RowDataController dataController, }) : _rowService = RowFFIService(gridId: rowInfo.gridId), _dataController = dataController, super(RowState.initial(rowInfo, dataController.loadData())) { diff --git a/frontend/app_flowy/lib/plugins/grid/application/row/row_cache.dart b/frontend/app_flowy/lib/plugins/grid/application/row/row_cache.dart index c841faccc3..3bba356ef8 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/row/row_cache.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/row/row_cache.dart @@ -12,10 +12,13 @@ part 'row_cache.freezed.dart'; typedef RowUpdateCallback = void Function(); -abstract class IGridRowFieldNotifier { - UnmodifiableListView get fields; +abstract class RowChangesetNotifierForward { void onRowFieldsChanged(VoidCallback callback); void onRowFieldChanged(void Function(FieldInfo) callback); +} + +abstract class RowCacheDelegate { + UnmodifiableListView get fields; void onRowDispose(); } @@ -33,8 +36,8 @@ class GridRowCache { final RowList _rowList = RowList(); final GridCellCache _cellCache; - final IGridRowFieldNotifier _fieldNotifier; - final _RowChangesetNotifier _rowChangeReasonNotifier; + final RowCacheDelegate _delegate; + final RowChangesetNotifier _rowChangeReasonNotifier; UnmodifiableListView get visibleRows { var visibleRows = [..._rowList.rows]; @@ -46,10 +49,11 @@ class GridRowCache { GridRowCache({ required this.gridId, required this.rows, - required IGridRowFieldNotifier notifier, + required RowChangesetNotifierForward notifier, + required RowCacheDelegate delegate, }) : _cellCache = GridCellCache(gridId: gridId), - _rowChangeReasonNotifier = _RowChangesetNotifier(), - _fieldNotifier = notifier { + _rowChangeReasonNotifier = RowChangesetNotifier(), + _delegate = delegate { // notifier.onRowFieldsChanged(() => _rowChangeReasonNotifier .receive(const RowsChangedReason.fieldDidChange())); @@ -65,7 +69,7 @@ class GridRowCache { } Future dispose() async { - _fieldNotifier.onRowDispose(); + _delegate.onRowDispose(); _rowChangeReasonNotifier.dispose(); await _cellCache.dispose(); } @@ -225,7 +229,7 @@ class GridRowCache { GridCellMap _makeGridCells(String rowId, RowPB? row) { // ignore: prefer_collection_literals var cellDataMap = GridCellMap(); - for (final field in _fieldNotifier.fields) { + for (final field in _delegate.fields) { if (field.visibility) { cellDataMap[field.id] = GridCellIdentifier( rowId: rowId, @@ -264,16 +268,16 @@ class GridRowCache { RowInfo buildGridRow(RowPB rowPB) { return RowInfo( gridId: gridId, - fields: _fieldNotifier.fields, + fields: _delegate.fields, rowPB: rowPB, ); } } -class _RowChangesetNotifier extends ChangeNotifier { +class RowChangesetNotifier extends ChangeNotifier { RowsChangedReason reason = const InitialListState(); - _RowChangesetNotifier(); + RowChangesetNotifier(); void receive(RowsChangedReason newReason) { reason = newReason; diff --git a/frontend/app_flowy/lib/plugins/grid/application/row/row_data_controller.dart b/frontend/app_flowy/lib/plugins/grid/application/row/row_data_controller.dart index e5fc6161bb..cb622fcbce 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/row/row_data_controller.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/row/row_data_controller.dart @@ -7,13 +7,13 @@ import 'row_cache.dart'; typedef OnRowChanged = void Function(GridCellMap, RowsChangedReason); -class GridRowDataController extends GridCellBuilderDelegate { +class RowDataController extends GridCellBuilderDelegate { final RowInfo rowInfo; final List _onRowChangedListeners = []; final GridFieldController _fieldController; final GridRowCache _rowCache; - GridRowDataController({ + RowDataController({ required this.rowInfo, required GridFieldController fieldController, required GridRowCache rowCache, diff --git a/frontend/app_flowy/lib/plugins/grid/application/row/row_detail_bloc.dart b/frontend/app_flowy/lib/plugins/grid/application/row/row_detail_bloc.dart index 10b4fe3cf8..7d36b71aef 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/row/row_detail_bloc.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/row/row_detail_bloc.dart @@ -7,7 +7,7 @@ import 'row_data_controller.dart'; part 'row_detail_bloc.freezed.dart'; class RowDetailBloc extends Bloc { - final GridRowDataController dataController; + final RowDataController dataController; RowDetailBloc({ required this.dataController, diff --git a/frontend/app_flowy/lib/plugins/grid/application/view/grid_view_cache.dart b/frontend/app_flowy/lib/plugins/grid/application/view/grid_view_cache.dart index eb83500d7d..c79bfcac92 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/view/grid_view_cache.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/view/grid_view_cache.dart @@ -18,10 +18,12 @@ class GridViewCache { required this.gridId, required GridFieldController fieldController, }) : _gridViewListener = GridViewListener(viewId: gridId) { + final delegate = GridRowFieldNotifierImpl(fieldController); _rowCache = GridRowCache( gridId: gridId, rows: [], - notifier: GridRowFieldNotifierImpl(fieldController), + notifier: delegate, + delegate: delegate, ); _gridViewListener.start( diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/grid_page.dart b/frontend/app_flowy/lib/plugins/grid/presentation/grid_page.dart index 177e2a2f2a..fec15d0a55 100755 --- a/frontend/app_flowy/lib/plugins/grid/presentation/grid_page.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/grid_page.dart @@ -275,7 +275,7 @@ class _GridRowsState extends State<_GridRows> { final fieldController = context.read().gridController.fieldController; - final dataController = GridRowDataController( + final dataController = RowDataController( rowInfo: rowInfo, fieldController: fieldController, rowCache: rowCache, @@ -308,7 +308,7 @@ class _GridRowsState extends State<_GridRows> { GridRowCache rowCache, GridCellBuilder cellBuilder, ) { - final dataController = GridRowDataController( + final dataController = RowDataController( rowInfo: rowInfo, fieldController: fieldController, rowCache: rowCache, diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/grid_row.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/grid_row.dart index befb275a72..9318d89599 100755 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/grid_row.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/grid_row.dart @@ -20,7 +20,7 @@ import 'package:easy_localization/easy_localization.dart'; class GridRowWidget extends StatefulWidget { final RowInfo rowInfo; - final GridRowDataController dataController; + final RowDataController dataController; final GridCellBuilder cellBuilder; final void Function(BuildContext, GridCellBuilder) openDetailPage; diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart index 415e5fc1ad..ca28a2b138 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart @@ -24,7 +24,7 @@ import '../header/field_cell.dart'; import '../header/field_editor.dart'; class RowDetailPage extends StatefulWidget with FlowyOverlayDelegate { - final GridRowDataController dataController; + final RowDataController dataController; final GridCellBuilder cellBuilder; const RowDetailPage({ diff --git a/frontend/app_flowy/lib/startup/deps_resolver.dart b/frontend/app_flowy/lib/startup/deps_resolver.dart index de7981ddb6..71ff5e07dc 100644 --- a/frontend/app_flowy/lib/startup/deps_resolver.dart +++ b/frontend/app_flowy/lib/startup/deps_resolver.dart @@ -152,7 +152,7 @@ void _resolveGridDeps(GetIt getIt) { (data, _) => FieldActionSheetBloc(fieldCellContext: data), ); - getIt.registerFactoryParam( + getIt.registerFactoryParam( (context, _) => TextCellBloc( cellController: context, ), @@ -165,7 +165,7 @@ void _resolveGridDeps(GetIt getIt) { ), ); - getIt.registerFactoryParam( + getIt.registerFactoryParam( (context, _) => NumberCellBloc( cellController: context, ), @@ -177,7 +177,7 @@ void _resolveGridDeps(GetIt getIt) { ), ); - getIt.registerFactoryParam( + getIt.registerFactoryParam( (cellData, _) => CheckboxCellBloc( service: CellService(), cellController: cellData, diff --git a/frontend/app_flowy/test/bloc_test/board_test/util.dart b/frontend/app_flowy/test/bloc_test/board_test/util.dart index fb83225200..3e3985b195 100644 --- a/frontend/app_flowy/test/bloc_test/board_test/util.dart +++ b/frontend/app_flowy/test/bloc_test/board_test/util.dart @@ -97,7 +97,7 @@ class BoardTestContext { return editorBloc; } - Future makeCellController(String fieldId) async { + Future makeCellController(String fieldId) async { final builder = await makeCellControllerBuilder(fieldId); return builder.build(); } @@ -109,7 +109,7 @@ class BoardTestContext { final rowCache = _boardDataController.rowCache; final fieldController = _boardDataController.fieldController; - final rowDataController = GridRowDataController( + final rowDataController = RowDataController( rowInfo: rowInfo, fieldController: fieldController, rowCache: rowCache, diff --git a/frontend/app_flowy/test/bloc_test/grid_test/util.dart b/frontend/app_flowy/test/bloc_test/grid_test/util.dart index 23b2ade691..89bd411ac6 100644 --- a/frontend/app_flowy/test/bloc_test/grid_test/util.dart +++ b/frontend/app_flowy/test/bloc_test/grid_test/util.dart @@ -54,7 +54,7 @@ class GridTestContext { return editorBloc; } - Future makeCellController( + Future makeCellController( String fieldId, int rowIndex) async { final builder = await makeCellControllerBuilder(fieldId, rowIndex); return builder.build(); @@ -68,7 +68,7 @@ class GridTestContext { final rowCache = gridController.rowCache; final fieldController = gridController.fieldController; - final rowDataController = GridRowDataController( + final rowDataController = RowDataController( rowInfo: rowInfo, fieldController: fieldController, rowCache: rowCache, @@ -131,19 +131,20 @@ class GridTestContext { return cellController; } - Future makeTextCellController(int rowIndex) async { + Future makeTextCellController(int rowIndex) async { final field = fieldContexts .firstWhere((element) => element.fieldType == FieldType.RichText); final cellController = - await makeCellController(field.id, rowIndex) as GridCellController; + await makeCellController(field.id, rowIndex) as GridTextCellController; return cellController; } - Future makeCheckboxCellController(int rowIndex) async { + Future makeCheckboxCellController( + int rowIndex) async { final field = fieldContexts .firstWhere((element) => element.fieldType == FieldType.Checkbox); final cellController = - await makeCellController(field.id, rowIndex) as GridCellController; + await makeCellController(field.id, rowIndex) as GridTextCellController; return cellController; } }