refactor: add Grid prefix to some Grid cells

This commit is contained in:
appflowy 2022-07-18 17:48:33 +08:00
parent 3961e85f6b
commit cefd64034d
5 changed files with 25 additions and 25 deletions

View File

@ -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:

View File

@ -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<CheckboxCell> createState() => _CheckboxCellState();
GridCellState<GridCheckboxCell> createState() => _CheckboxCellState();
}
class _CheckboxCellState extends GridCellState<CheckboxCell> {
class _CheckboxCellState extends GridCellState<GridCheckboxCell> {
late CheckboxCellBloc _cellBloc;
@override

View File

@ -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<DateCell> createState() => _DateCellState();
GridCellState<GridDateCell> createState() => _DateCellState();
}
class _DateCellState extends GridCellState<DateCell> {
class _DateCellState extends GridCellState<GridDateCell> {
late DateCellBloc _cellBloc;
@override

View File

@ -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<NumberCell> createState() => _NumberCellState();
GridFocusNodeCellState<GridNumberCell> createState() => _NumberCellState();
}
class _NumberCellState extends GridFocusNodeCellState<NumberCell> {
class _NumberCellState extends GridFocusNodeCellState<GridNumberCell> {
late NumberCellBloc _cellBloc;
late TextEditingController _controller;
Timer? _delayOperation;

View File

@ -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<SingleSelectCell> createState() => _SingleSelectCellState();
State<GridSingleSelectCell> createState() => _SingleSelectCellState();
}
class _SingleSelectCellState extends State<SingleSelectCell> {
class _SingleSelectCellState extends State<GridSingleSelectCell> {
late SelectOptionCellBloc _cellBloc;
@override
@ -74,11 +74,11 @@ class _SingleSelectCellState extends State<SingleSelectCell> {
}
//----------------------------------------------------------------
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<MultiSelectCell> createState() => _MultiSelectCellState();
State<GridMultiSelectCell> createState() => _MultiSelectCellState();
}
class _MultiSelectCellState extends State<MultiSelectCell> {
class _MultiSelectCellState extends State<GridMultiSelectCell> {
late SelectOptionCellBloc _cellBloc;
@override