Skip to content

Commit

Permalink
Rename selectingMode square to cell.
Browse files Browse the repository at this point in the history
Change part to export.
  • Loading branch information
bosskmk committed Dec 14, 2020
1 parent b20874a commit a654688
Show file tree
Hide file tree
Showing 70 changed files with 543 additions and 533 deletions.
2 changes: 1 addition & 1 deletion example/lib/screen/feature/cell_renderer_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class _CellRendererScreenState extends State<CellRendererScreen> {
print(event);
},
onLoaded: (PlutoOnLoadedEvent event) {
event.stateManager.setSelectingMode(PlutoSelectingMode.square);
event.stateManager.setSelectingMode(PlutoSelectingMode.cell);

stateManager = event.stateManager;
},
Expand Down
4 changes: 2 additions & 2 deletions example/lib/screen/feature/cell_selection_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class _CellSelectionScreenState extends State<CellSelectionScreen> {
topTitle: 'Cell selection',
topContents: [
const Text(
'In Square selection mode, Shift + tap or long tap and then move to select cells.'),
'In cell selection mode, Shift + tap or long tap and then move to select cells.'),
],
topButtons: [
PlutoExampleButton(
Expand Down Expand Up @@ -107,7 +107,7 @@ class _CellSelectionScreenState extends State<CellSelectionScreen> {
print(event);
},
onLoaded: (PlutoOnLoadedEvent event) {
event.stateManager.setSelectingMode(PlutoSelectingMode.square);
event.stateManager.setSelectingMode(PlutoSelectingMode.cell);

stateManager = event.stateManager;
},
Expand Down
2 changes: 1 addition & 1 deletion example/lib/screen/feature/column_freezing_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class _ColumnFreezingScreenState extends State<ColumnFreezingScreen> {
print(event);
},
onLoaded: (PlutoOnLoadedEvent event) {
event.stateManager.setSelectingMode(PlutoSelectingMode.square);
event.stateManager.setSelectingMode(PlutoSelectingMode.cell);
},
),
);
Expand Down
2 changes: 1 addition & 1 deletion example/lib/screen/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class PlutoFeatures extends StatelessWidget {
PlutoListTile(
title: 'Cell selection',
description:
'In Square selection mode, Shift + tap or long tap and then move to select cells.',
'In cell selection mode, Shift + tap or long tap and then move to select cells.',
onTapLiveDemo: () {
Navigator.pushNamed(context, CellSelectionScreen.routeName);
},
Expand Down
178 changes: 46 additions & 132 deletions lib/pluto_grid.dart
Original file line number Diff line number Diff line change
@@ -1,134 +1,48 @@
library pluto_grid;

import 'dart:async';
import 'dart:developer' as developer;
import 'dart:math';

import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart' as intl;
import 'package:linked_scroll_controller/linked_scroll_controller.dart';
import 'package:pluto_filtered_list/pluto_filtered_list.dart';
import 'package:rxdart/rxdart.dart';

part './src/helper/clipboard_transformation.dart';

part './src/helper/filter_helper.dart';

part './src/helper/datetime_helper.dart';

part './src/helper/move_direction.dart';

part './src/helper/show_column_menu.dart';

part './src/manager/event/pluto_cannot_move_current_cell_event.dart';

part './src/manager/event/pluto_cell_gesture_event.dart';

part './src/manager/event/pluto_change_column_filter_event.dart';

part './src/manager/event/pluto_drag_rows_event.dart';

part './src/manager/event/pluto_event.dart';

part './src/manager/event/pluto_move_update_event.dart';

part './src/manager/pluto_event_manager.dart';

part './src/manager/pluto_key_manager.dart';

part './src/manager/pluto_state_manager.dart';

part './src/manager/state/cell_state.dart';

part './src/manager/state/column_state.dart';

part './src/manager/state/dragging_row_state.dart';

part './src/manager/state/editing_state.dart';

part './src/manager/state/filtering_row_state.dart';

part './src/manager/state/grid_state.dart';

part './src/manager/state/keyboard_state.dart';

part './src/manager/state/layout_state.dart';

part './src/manager/state/row_state.dart';

part './src/manager/state/scroll_state.dart';

part './src/manager/state/selecting_state.dart';

part './src/model/pluto_cell.dart';

part './src/model/pluto_column.dart';

part './src/model/pluto_column_type.dart';

part './src/model/pluto_row.dart';

part './src/pluto_configuration.dart';

part './src/pluto_dual_grid.dart';

part './src/pluto_dual_grid_popup.dart';

part './src/pluto_grid.dart';

part './src/pluto_grid_popup.dart';

part './src/ui/pluto_body_columns.dart';

part './src/ui/pluto_body_rows.dart';

part './src/ui/pluto_left_frozen_columns.dart';

part './src/ui/pluto_left_frozen_rows.dart';

part './src/ui/pluto_right_frozen_columns.dart';

part './src/ui/pluto_right_frozen_rows.dart';

part './src/ui/pluto_base_cell.dart';

part './src/ui/pluto_base_column.dart';

part './src/ui/columns/pluto_column_title.dart';

part './src/ui/columns/pluto_column_filter.dart';

part './src/ui/pluto_base_row.dart';

part './src/ui/cells/pluto_date_cell.dart';

part './src/ui/cells/pluto_default_cell.dart';

part './src/ui/cells/pluto_number_cell.dart';

part './src/ui/cells/mixin_popup_cell.dart';

part './src/ui/cells/pluto_select_cell.dart';

part './src/ui/cells/mixin_text_cell.dart';

part './src/ui/cells/pluto_text_cell.dart';

part './src/ui/cells/pluto_time_cell.dart';

part './src/widget/pluto_loading.dart';

part './src/widget/pluto_scrollbar.dart';

part './src/widget/pluto_scaled_checkbox.dart';

part './src/widget/pluto_shadow_container.dart';

part './src/widget/pluto_shadow_line.dart';

part './src/widget/pluto_state_with_change.dart';
export './src/helper/clipboard_transformation.dart';
export './src/helper/datetime_helper.dart';
export './src/helper/filter_helper.dart';
export './src/helper/move_direction.dart';
export './src/helper/show_column_menu.dart';
export './src/manager/event/pluto_cannot_move_current_cell_event.dart';
export './src/manager/event/pluto_cell_gesture_event.dart';
export './src/manager/event/pluto_change_column_filter_event.dart';
export './src/manager/event/pluto_drag_rows_event.dart';
export './src/manager/event/pluto_event.dart';
export './src/manager/event/pluto_move_update_event.dart';
export './src/manager/pluto_event_manager.dart';
export './src/manager/pluto_key_manager.dart';
export './src/manager/pluto_state_manager.dart';
export './src/model/pluto_cell.dart';
export './src/model/pluto_column.dart';
export './src/model/pluto_column_type.dart';
export './src/model/pluto_row.dart';
export './src/pluto_configuration.dart';
export './src/pluto_dual_grid.dart';
export './src/pluto_dual_grid_popup.dart';
export './src/pluto_grid.dart';
export './src/pluto_grid_popup.dart';
export './src/ui/cells/pluto_date_cell.dart';
export './src/ui/cells/pluto_default_cell.dart';
export './src/ui/cells/pluto_number_cell.dart';
export './src/ui/cells/pluto_select_cell.dart';
export './src/ui/cells/pluto_text_cell.dart';
export './src/ui/cells/pluto_time_cell.dart';
export './src/ui/columns/pluto_column_filter.dart';
export './src/ui/columns/pluto_column_title.dart';
export './src/ui/pluto_base_cell.dart';
export './src/ui/pluto_base_column.dart';
export './src/ui/pluto_base_row.dart';
export './src/ui/pluto_body_columns.dart';
export './src/ui/pluto_body_rows.dart';
export './src/ui/pluto_left_frozen_columns.dart';
export './src/ui/pluto_left_frozen_rows.dart';
export './src/ui/pluto_right_frozen_columns.dart';
export './src/ui/pluto_right_frozen_rows.dart';
export './src/widget/pluto_loading.dart';
export './src/widget/pluto_scaled_checkbox.dart';
export './src/widget/pluto_scrollbar.dart';
export './src/widget/pluto_shadow_container.dart';
export './src/widget/pluto_shadow_line.dart';
export './src/widget/pluto_state_with_change.dart';
2 changes: 0 additions & 2 deletions lib/src/helper/clipboard_transformation.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
part of '../../pluto_grid.dart';

class ClipboardTransformation {
static List<List<String>> stringToList(String text) {
return text
Expand Down
2 changes: 1 addition & 1 deletion lib/src/helper/datetime_helper.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../../pluto_grid.dart';
import 'package:intl/intl.dart' as intl;

class DatetimeHelper {
static List<DateTime> getDaysInBetween(DateTime startDate, DateTime endDate) {
Expand Down
5 changes: 4 additions & 1 deletion lib/src/helper/filter_helper.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
part of '../../pluto_grid.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:pluto_filtered_list/pluto_filtered_list.dart';
import 'package:pluto_grid/pluto_grid.dart';

typedef SetFilterPopupHandler = void Function(PlutoStateManager stateManager);

Expand Down
2 changes: 0 additions & 2 deletions lib/src/helper/move_direction.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
part of '../../pluto_grid.dart';

enum MoveDirection {
left,
right,
Expand Down
3 changes: 2 additions & 1 deletion lib/src/helper/show_column_menu.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
part of '../../pluto_grid.dart';
import 'package:flutter/material.dart';
import 'package:pluto_grid/pluto_grid.dart';

Future<PlutoGridColumnMenuItem> showColumnMenu({
BuildContext context,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../../../pluto_grid.dart';
import 'package:pluto_grid/pluto_grid.dart';

/// Event : Cannot move current cell
class PlutoCannotMoveCurrentCellEvent extends PlutoEvent {
Expand All @@ -10,5 +10,5 @@ class PlutoCannotMoveCurrentCellEvent extends PlutoEvent {
this.direction,
});

void _handler(PlutoStateManager stateManager) {}
void handler(PlutoStateManager stateManager) {}
}
5 changes: 3 additions & 2 deletions lib/src/manager/event/pluto_cell_gesture_event.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
part of '../../../pluto_grid.dart';
import 'package:flutter/material.dart';
import 'package:pluto_grid/pluto_grid.dart';

class PlutoCellGestureEvent extends PlutoEvent {
final PlutoGestureType gestureType;
Expand All @@ -16,7 +17,7 @@ class PlutoCellGestureEvent extends PlutoEvent {
});

@override
void _handler(PlutoStateManager stateManager) {
void handler(PlutoStateManager stateManager) {
if (gestureType == null ||
offset == null ||
cell == null ||
Expand Down
4 changes: 2 additions & 2 deletions lib/src/manager/event/pluto_change_column_filter_event.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of '../../../pluto_grid.dart';
import 'package:pluto_grid/pluto_grid.dart';

class PlutoChangeColumnFilterEvent extends PlutoEvent {
final String columnField;
Expand All @@ -11,7 +11,7 @@ class PlutoChangeColumnFilterEvent extends PlutoEvent {
this.filterValue,
});

void _handler(PlutoStateManager stateManager) {
void handler(PlutoStateManager stateManager) {
List<PlutoRow> foundFilterRows =
stateManager.filterRowsByField(columnField);

Expand Down
5 changes: 3 additions & 2 deletions lib/src/manager/event/pluto_drag_rows_event.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
part of '../../../pluto_grid.dart';
import 'package:flutter/material.dart';
import 'package:pluto_grid/pluto_grid.dart';

/// Event : Dragging [PlutoRow].
class PlutoDragRowsEvent extends PlutoEvent {
Expand All @@ -12,7 +13,7 @@ class PlutoDragRowsEvent extends PlutoEvent {
this.rows,
});

void _handler(PlutoStateManager stateManager) {
void handler(PlutoStateManager stateManager) {
if (dragType == null ||
(!dragType.isStart && offset == null) ||
rows == null) {
Expand Down
9 changes: 2 additions & 7 deletions lib/src/manager/event/pluto_event.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
part of '../../../pluto_grid.dart';
import 'package:pluto_grid/pluto_grid.dart';

abstract class PlutoEvent {
void _handler(PlutoStateManager stateManager);

@visibleForTesting
void handler(PlutoStateManager stateManager) {
_handler(stateManager);
}
void handler(PlutoStateManager stateManager);
}
6 changes: 4 additions & 2 deletions lib/src/manager/event/pluto_move_update_event.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
part of '../../../pluto_grid.dart';
import 'package:flutter/material.dart';
import 'package:linked_scroll_controller/linked_scroll_controller.dart';
import 'package:pluto_grid/pluto_grid.dart';

/// Event : Such as DragUpdate or LongPressMoveUpdate.
class PlutoMoveUpdateEvent extends PlutoEvent {
Expand All @@ -8,7 +10,7 @@ class PlutoMoveUpdateEvent extends PlutoEvent {
this.offset,
});

void _handler(PlutoStateManager stateManager) {
void handler(PlutoStateManager stateManager) {
if (offset == null) {
return;
}
Expand Down
5 changes: 3 additions & 2 deletions lib/src/manager/pluto_event_manager.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
part of '../../pluto_grid.dart';
import 'package:pluto_grid/pluto_grid.dart';
import 'package:rxdart/rxdart.dart';

class PlutoEventManager {
PlutoStateManager stateManager;
Expand Down Expand Up @@ -32,6 +33,6 @@ class PlutoEventManager {
}

void _handler(PlutoEvent event) {
event._handler(stateManager);
event.handler(stateManager);
}
}
12 changes: 9 additions & 3 deletions lib/src/manager/pluto_key_manager.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
part of '../../pluto_grid.dart';
import 'dart:developer' as developer;

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:pluto_grid/pluto_grid.dart';
import 'package:rxdart/rxdart.dart';

class PlutoKeyManager {
PlutoStateManager stateManager;
Expand Down Expand Up @@ -247,7 +253,7 @@ class PlutoKeyManager {
.text = stateManager.cellValueBeforeEditing.toString();

stateManager.changeCellValue(
stateManager.currentCell._key, stateManager.cellValueBeforeEditing);
stateManager.currentCell.key, stateManager.cellValueBeforeEditing);
}
}

Expand Down Expand Up @@ -288,7 +294,7 @@ class PlutoKeyManager {
if (stateManager.isEditing != true && stateManager.currentCell != null) {
stateManager.setEditing(true);

stateManager.changeCellValue(stateManager.currentCell._key,
stateManager.changeCellValue(stateManager.currentCell.key,
keyManagerEvent.event.logicalKey.keyLabel);
}
}
Expand Down
Loading

0 comments on commit a654688

Please sign in to comment.