From cefd64034db40ea544381eb51b9a430380f89d94 Mon Sep 17 00:00:00 2001 From: appflowy Date: Mon, 18 Jul 2022 17:48:33 +0800 Subject: [PATCH] refactor: add Grid prefix to some Grid cells --- .../grid/src/widgets/cell/cell_builder.dart | 10 +++++----- .../grid/src/widgets/cell/checkbox_cell.dart | 8 ++++---- .../src/widgets/cell/date_cell/date_cell.dart | 8 ++++---- .../grid/src/widgets/cell/number_cell.dart | 8 ++++---- .../select_option_cell/select_option_cell.dart | 16 ++++++++-------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/cell_builder.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/cell_builder.dart index 10efcbb0de..f785672f71 100755 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/cell_builder.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/cell_builder.dart @@ -30,15 +30,15 @@ class GridCellBuilder { final key = cell.key(); switch (cell.fieldType) { case FieldType.Checkbox: - return CheckboxCell(cellControllerBuilder: cellControllerBuilder, key: key); + return GridCheckboxCell(cellControllerBuilder: cellControllerBuilder, key: key); case FieldType.DateTime: - return DateCell(cellControllerBuilder: cellControllerBuilder, key: key, style: style); + return GridDateCell(cellControllerBuilder: cellControllerBuilder, key: key, style: style); case FieldType.SingleSelect: - return SingleSelectCell(cellContorllerBuilder: cellControllerBuilder, style: style, key: key); + return GridSingleSelectCell(cellContorllerBuilder: cellControllerBuilder, style: style, key: key); case FieldType.MultiSelect: - return MultiSelectCell(cellContorllerBuilder: cellControllerBuilder, style: style, key: key); + return GridMultiSelectCell(cellContorllerBuilder: cellControllerBuilder, style: style, key: key); case FieldType.Number: - return NumberCell(cellContorllerBuilder: cellControllerBuilder, key: key); + return GridNumberCell(cellContorllerBuilder: cellControllerBuilder, key: key); case FieldType.RichText: return GridTextCell(cellContorllerBuilder: cellControllerBuilder, style: style, key: key); case FieldType.URL: diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/checkbox_cell.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/checkbox_cell.dart index ac2a2fb979..9fcbaf751f 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/checkbox_cell.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/checkbox_cell.dart @@ -6,18 +6,18 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'cell_builder.dart'; -class CheckboxCell extends GridCellWidget { +class GridCheckboxCell extends GridCellWidget { final GridCellControllerBuilder cellControllerBuilder; - CheckboxCell({ + GridCheckboxCell({ required this.cellControllerBuilder, Key? key, }) : super(key: key); @override - GridCellState createState() => _CheckboxCellState(); + GridCellState createState() => _CheckboxCellState(); } -class _CheckboxCellState extends GridCellState { +class _CheckboxCellState extends GridCellState { late CheckboxCellBloc _cellBloc; @override diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/date_cell/date_cell.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/date_cell/date_cell.dart index 7436d0ac7f..78d18a50e8 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/date_cell/date_cell.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/date_cell/date_cell.dart @@ -18,11 +18,11 @@ abstract class GridCellDelegate { GridCellDelegate get delegate; } -class DateCell extends GridCellWidget { +class GridDateCell extends GridCellWidget { final GridCellControllerBuilder cellControllerBuilder; late final DateCellStyle? cellStyle; - DateCell({ + GridDateCell({ GridCellStyle? style, required this.cellControllerBuilder, Key? key, @@ -35,10 +35,10 @@ class DateCell extends GridCellWidget { } @override - GridCellState createState() => _DateCellState(); + GridCellState createState() => _DateCellState(); } -class _DateCellState extends GridCellState { +class _DateCellState extends GridCellState { late DateCellBloc _cellBloc; @override diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/number_cell.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/number_cell.dart index 6b1cf4ceae..573a4168c9 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/number_cell.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/number_cell.dart @@ -6,19 +6,19 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'cell_builder.dart'; -class NumberCell extends GridCellWidget { +class GridNumberCell extends GridCellWidget { final GridCellControllerBuilder cellContorllerBuilder; - NumberCell({ + GridNumberCell({ required this.cellContorllerBuilder, Key? key, }) : super(key: key); @override - GridFocusNodeCellState createState() => _NumberCellState(); + GridFocusNodeCellState createState() => _NumberCellState(); } -class _NumberCellState extends GridFocusNodeCellState { +class _NumberCellState extends GridFocusNodeCellState { late NumberCellBloc _cellBloc; late TextEditingController _controller; Timer? _delayOperation; diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/select_option_cell.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/select_option_cell.dart index 6669e84576..f822e503d2 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/select_option_cell.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/grid/src/widgets/cell/select_option_cell/select_option_cell.dart @@ -20,11 +20,11 @@ class SelectOptionCellStyle extends GridCellStyle { }); } -class SingleSelectCell extends GridCellWidget { +class GridSingleSelectCell extends GridCellWidget { final GridCellControllerBuilder cellContorllerBuilder; late final SelectOptionCellStyle? cellStyle; - SingleSelectCell({ + GridSingleSelectCell({ required this.cellContorllerBuilder, GridCellStyle? style, Key? key, @@ -37,10 +37,10 @@ class SingleSelectCell extends GridCellWidget { } @override - State createState() => _SingleSelectCellState(); + State createState() => _SingleSelectCellState(); } -class _SingleSelectCellState extends State { +class _SingleSelectCellState extends State { late SelectOptionCellBloc _cellBloc; @override @@ -74,11 +74,11 @@ class _SingleSelectCellState extends State { } //---------------------------------------------------------------- -class MultiSelectCell extends GridCellWidget { +class GridMultiSelectCell extends GridCellWidget { final GridCellControllerBuilder cellContorllerBuilder; late final SelectOptionCellStyle? cellStyle; - MultiSelectCell({ + GridMultiSelectCell({ required this.cellContorllerBuilder, GridCellStyle? style, Key? key, @@ -91,10 +91,10 @@ class MultiSelectCell extends GridCellWidget { } @override - State createState() => _MultiSelectCellState(); + State createState() => _MultiSelectCellState(); } -class _MultiSelectCellState extends State { +class _MultiSelectCellState extends State { late SelectOptionCellBloc _cellBloc; @override