diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 000000000..f72b9453d --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,13 @@ +name: Tests +on: + pull_request: + branches: + - master +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Install Flutter Dependencies + run: flutter pub get + - name: Run Flutter Tests + run: flutter test diff --git a/.gitignore b/.gitignore index b0407d4e1..b28e1b84a 100644 --- a/.gitignore +++ b/.gitignore @@ -77,4 +77,7 @@ coverage/ !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages # FVM Support - https://fvm.app/ -.fvm/flutter_sdk \ No newline at end of file +.fvm/flutter_sdk +example/windows/flutter/generated_plugin_registrant.cc +example/windows/flutter/generated_plugin_registrant.h +example/windows/flutter/generated_plugins.cmake diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..8d4d525e8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "dart.lineLength": 80, +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a7fafa2ae..a61163f38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,59 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [8.4.3] - 2024. 10. 23 + +* Added rowWrapper & editCellWrapper for the state manager +* Manually detect doubleTaps on desktop platform to eliminate delay +* Several improvements +* Add PlutoGridRowSelectionCheckBehavior which enables automatically setting the CheckBox values of selected rows +* Add PlutoGridRowSelectionCheckBehavior +* Upgrade packages + + + +## [8.4.2] - 2024. 07. 15 + +* add rowWrapper +* Added an option for developers to use either the standard Material DatePicker or a custom datepicker. +* Datepicker - moved isOpenedPopup = true +* Added the ability to add a custom data property at the row level. For example: you can pass data to onSelect or any other onHandler. (not required) +* Upgrade some used package to the latest version. + +## [8.4.1] - 2024. 05. 15 + +upgrade for flutter 3.22.0 + +## [8.4.0] - 2024. 04. 01 + +* Added onRowEnter, onRowExit callbacks to react on. @coruscant187 +* Added logic to change background color of row if hovered. @coruscant187 doonfrs/pluto_grid_plus#29 + +## [8.3.1] - 2024. 03. 19 + +* upgrade packages to latest major version + +## [8.3.0] - 2024. 02. 18 + +* Change pluto_grid_export to pluto_grid_plus_export as the old version is not maintained. +* fix & enhance the example for csv export. + +## [8.2.0] - 2023. 12. 19 + +* Add builder function in plutoColumnType.select allow user to customize the popup by item widget. + +## [8.1.0] - 2023. 12. 8 + +* Customize filter column by @RamshaFarheen bosskmk#739 +* Add column title (padding, icon-size, and checkBox size to auto-fit calculation by @Milad-Akarie bosskmk#715 +* add onSelectedItem function in plutoColumnType.select bosskmk#935 + +## [8.0.0] - 2023. 7. 12 + +* Change Package name to pluto_grid_plus +* Upgrade the packages to the latest version. + ## [7.0.2] - 2023. 5. 13 * Add Japanese, Turkish languages. @@ -13,12 +69,12 @@ ## [6.0.4] - 2023. 3. 7 -* Add Scrollbar properties. https://github.com/bosskmk/pluto_grid/issues/743 +* Add Scrollbar properties. ## [6.0.3] - 2023. 3. 6 * Add locales.(German, French) -* Fix row group expanded bug. https://github.com/bosskmk/pluto_grid/issues/775 +* Fix row group expanded bug. ## [6.0.2] - 2023. 2. 2 @@ -46,25 +102,25 @@ * Fix sorting bug. Fixed sorting issue with pagination applied. - https://github.com/bosskmk/pluto_grid/issues/668 + ## [5.4.6] - 2022. 11. 30 * Fix keepAlive. - Fixed a bug that slowed down when moving horizontally/vertically + Fixed a bug that slowed down when moving horizontally/vertically with the keyboard direction keys for a long time in succession. ## [5.4.5] - 2022. 11. 30 -* Fix RTL initiation flicker. - By https://github.com/Milad-Akarie +* Fix RTL initiation flicker. + By * Fix column context menu is triggered after drag (column resizing). - By https://github.com/Milad-Akarie + By ## [5.4.4] - 2022. 11. 29 * Add hovered scrollbar. - https://pluto.weblaze.dev/scrollbar-and-scroll-behavior + ## [5.4.3] - 2022. 11. 21 @@ -75,11 +131,11 @@ ## [5.4.2] - 2022. 11. 15 * Add properties of PlutoGridScrollbarConfig. - - onlyDraggingThumb - - mainAxisMargin - - crossAxisMargin - - scrollBarColor - - scrollBarTrackColor + * onlyDraggingThumb + * mainAxisMargin + * crossAxisMargin + * scrollBarColor + * scrollBarTrackColor ## [5.4.1] - 2022. 11. 12 @@ -88,7 +144,7 @@ ## [5.4.0] - 2022. 11. 5 * Add shortcut to PlutoGridConfiguration. - https://pluto.weblaze.dev/shortcuts + * Add popupIcon for popup type column. You can change the icon that appears on the right of the date, time, or selection type column cell or set it to null to remove it. @@ -122,7 +178,7 @@ * Change PlutoGridStateManager.configuration to not null. * Add Currency column. - https://github.com/bosskmk/pluto_grid/blob/master/demo/lib/screen/feature/currency_type_column_screen.dart + ## [5.1.1] - 2022. 9. 25 @@ -131,13 +187,13 @@ ## [5.1.0] - 2022. 9. 10 * Add Column footer. - https://weblaze.dev/pluto_grid/build/web/#feature/column-footer + * Add to be able to set locale for numeric type PlutoColumn. ## [5.0.6] - 2022. 9. 5 * Add support for countries that use comma as Decimal separator. -* Breaking change - Only available for flutter 3.3, +* Breaking change - Only available for flutter 3.3, otherwise it'll show this error on console: "Error: No named parameter with the name 'disabledForegroundColor'" ## [5.0.5] - 2022. 8. 30 @@ -170,21 +226,21 @@ * Added middle divider for `PlutoDualGrid`, `PlutoDualPopup` widget. By adding a divider in the center of the two grids, the position can be changed by dragging and dropping. - https://weblaze.dev/pluto_grid/build/web/#feature/dual-mode + * Add to `PlutoGridEventManager` stream to receive column sort changes. Add `PlutoGrid.onSorted` callback. * Added an option to disable column width adjustment while displaying the column right menu. - - Activate both `PlutoColumn.enableContextMenu` and `PlutoColumn.enableDropToResize` + * Activate both `PlutoColumn.enableContextMenu` and `PlutoColumn.enableDropToResize` Tap the column menu to display the context menu. Drag left or right to adjust the column width. - - Activate only `PlutoColumn.enableContextMenu` + * Activate only `PlutoColumn.enableContextMenu` You cannot adjust the column width by dragging the column menu. - - Only enable `PlutoColumn.enableDropToResize` + * Only enable `PlutoColumn.enableDropToResize` You cannot call the context menu by tapping the column menu. * Hide all column headings. `PlutoGridStateManager.setShowColumnTitle` - https://weblaze.dev/pluto_grid/build/web/#development + In the link above, you can hide or show the entire column area by clicking the toggle column title button in the top show menu. -* When the parent widget of `PlutoGrid` is scrolled, in the previous 4.0.0 logic, +* When the parent widget of `PlutoGrid` is scrolled, in the previous 4.0.0 logic, the error that the row area disappears when the column is out of the screen area has been fixed. * Improve text selection when edit TextCell by @DmitrySboychakov * Improve padding for table cells and column titles by @DmitrySboychakov @@ -196,10 +252,10 @@ * Modified to pass `PlutoColumn` instead of passing `PlutoColumn.key` when calling `hideColumn`. * Add `PlutoGridStateManager.hideColumns(List columns, bool hide)` * Changes due to the constraint of a frozen column. - - The width of the frozen column cannot be expanded beyond the limit width. - - When changing a non-frozen column to a frozen column, it cannot be changed if the constraint width is insufficient. - - If a column with a hidden frozen column state is unhidden in a narrow constraint width, the column frozen state is forcibly changed to `PlutoColumnFrozen.none`. - - If the entire grid width is narrowed to less than the constraint width while + * The width of the frozen column cannot be expanded beyond the limit width. + * When changing a non-frozen column to a frozen column, it cannot be changed if the constraint width is insufficient. + * If a column with a hidden frozen column state is unhidden in a narrow constraint width, the column frozen state is forcibly changed to `PlutoColumnFrozen.none`. + * If the entire grid width is narrowed to less than the constraint width while there is a frozen column, the frozen column is permanently changed to `PlutoColumnFrozen.none`, and it does not return to the frozen column again even if the grid width is increased. * Change the logic to move by dragging rows. Previous behavior: rows are moved while dragging. @@ -213,7 +269,7 @@ Changed left and right of `PlutoColumn.frozen` to start and end. `PlutoColumn.textAlign` default value changed from left to start. `PlutoColumn.titleTextAlign` default value changed from left to start. - https://weblaze.dev/pluto_grid/build/web/#feature/rtl + * Change `PlutoGridConfiguration`. Settings such as color, size, icon, border, and text style have been moved to `PlutoGridConfiguration.style`. * Even/Odd Color. @@ -221,7 +277,7 @@ * Set default row color. Add `PlutoGridConfiguration.style.rowColor`. * Customize column menu. - https://weblaze.dev/pluto_grid/build/web/#feature/column-menu + ## [4.0.1] - 2022. 6. 21 @@ -233,8 +289,8 @@ Please check the performance in profile or build mode. Debug mode can be slow if there are many lines. * Some state management is applied as a Provider. -* Added PlutoGridStateManager.initializeRowsAsync static method. - To avoid UI freezing when starting the grid with a large number of rows. +* Added PlutoGridStateManager.initializeRowsAsync static method. + To avoid UI freezing when starting the grid with a large number of rows. [Initialize rows asynchronously](https://weblaze.dev/pluto_grid/build/web/#feature/add-rows-asynchronously) ## [3.1.2] - 2022. 6. 2 @@ -252,7 +308,7 @@ ## [3.0.2] - 2022. 5. 25 -* CSV export has been separated into external packages. +* CSV export has been separated into external packages. Install the pluto_grid_export package. ## [3.0.0-1.pre] - 2022. 5. 14 @@ -318,7 +374,7 @@ ## [2.7.1] - 2021. 12. 8 -* Fixed an error where the row height of the popup did not change when the rowHeight value was changed. +* Fixed an error where the row height of the popup did not change when the rowHeight value was changed. ## [2.7.0] - 2021. 12. 7 @@ -358,7 +414,7 @@ ## [2.4.0] - 2021. 7. 31 -* Added pagination. +* Added pagination. * Added debounce on keyboard input in filter. ## [2.3.0] - 2021. 7. 7 @@ -373,7 +429,7 @@ ## [2.2.0] - 2021. 5. 29 -* Add callback to row checks developed by https://github.com/MrCasCode. +* Add callback to row checks developed by . ## [2.1.0] - 2021. 5. 19 @@ -382,7 +438,7 @@ ## [2.0.0] - 2021. 5. 14 * Change scroll physics. -* Fix a bug when dragging rows. +* Fix a bug when dragging rows. * Stable release. ## [2.0.0-nullsafety.2] - 2021. 5. 1 @@ -422,9 +478,9 @@ ## [1.0.0] - 2020. 12. 30 * Class name change. Just like changing PlutoConfiguration to PlutoGridConfiguration, the word Grid was added in the middle. - - PlutoStateManager > PlutoGridStateManager - - PlutoOnLoadedEvent > PlutoGridOnLoadedEvent - - Many other classes... + * PlutoStateManager > PlutoGridStateManager + * PlutoOnLoadedEvent > PlutoGridOnLoadedEvent + * Many other classes... ## [1.0.0-pre.10] - 2020. 12. 21 @@ -459,9 +515,9 @@ ## [1.0.0-pre.4] - 2020. 11. 16 * Enable constant_identifier_names. - - ex) `PlutoColumnFixed.Left` > `PlutoColumnFixed.left` - - ex) `PlutoSelectingMode.Row` > `PlutoSelectingMode.row` - - All existing constants such as enum are changed. + * ex) `PlutoColumnFixed.Left` > `PlutoColumnFixed.left` + * ex) `PlutoSelectingMode.Row` > `PlutoSelectingMode.row` + * All existing constants such as enum are changed. * Add a loading indicator. ## [1.0.0-pre.3] - 2020. 11. 13 @@ -483,20 +539,20 @@ ## [1.0.0-pre.1] - 2020. 11. 05 -##### Breaking changes: +### Breaking changes * PlutoGrid.popup has been deleted. PlutoGrid.popup() has been removed. Just clear the popup and create it with PlutoGrid(). * The column property enableDraggable has been changed to enableColumnDrag. -##### Improvements: +### Improvements * Column properties have been added. - - enableRowDrag : If set to true, an icon is create in the cell of the column, and the row can be moved by dragging it. - - enableRowChecked : If set to true, a check box is create in the cell of the column. - - renderer : You can change the displayed cell. - - applyFormatterInEditing : If this is set to true, the value changed by a formatter is a reflected in the editing state. However, it is only in the readonly state, or the state in which the cell value cannot be directly modified in the form of popup. + * enableRowDrag : If set to true, an icon is create in the cell of the column, and the row can be moved by dragging it. + * enableRowChecked : If set to true, a check box is create in the cell of the column. + * renderer : You can change the displayed cell. + * applyFormatterInEditing : If this is set to true, the value changed by a formatter is a reflected in the editing state. However, it is only in the readonly state, or the state in which the cell value cannot be directly modified in the form of popup. ## [0.1.21] - 2020. 11. 01 diff --git a/README.md b/README.md index 3def278a3..9fcfc8a33 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,68 @@ -## PlutoGrid for flutter - v7.0.2 +# PlutoGrid Plus for flutter - v8.4.3 + +PlutoGrid Plus is a maintained version of [![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg)](https://github.com/Solido/awesome-flutter) [![codecov](https://codecov.io/gh/bosskmk/pluto_grid/branch/master/graph/badge.svg)](https://codecov.io/gh/bosskmk/pluto_grid) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -
- `PlutoGrid` is a `DataGrid` that can be operated with the keyboard in various situations such as moving cells. It is developed with priority on the web and desktop. Improvements such as UI on mobile are being considered. If you comment on an issue, mobile improvements can be made quickly. -
- -### [Demo Web](https://bosskmk.github.io/pluto_grid/build/web/index.html) +## [Demo Web](https://bosskmk.github.io/pluto_grid/build/web/index.html) +> > You can try out various functions and usage methods right away. > All features provide example code. -
- -### [Pub.Dev](https://pub.dev/packages/pluto_grid) +## [Pub.Dev](https://pub.dev/packages/pluto_grid) +> > Check out how to install from the official distribution site. -
- -### [Documentation](https://pluto.weblaze.dev/series/pluto-grid) +## [Documentation](https://pluto.weblaze.dev/series/pluto-grid) +> > The documentation has more details. -
- -### [ChangeLog](https://github.com/bosskmk/pluto_grid/blob/master/CHANGELOG.md) +## [ChangeLog](https://github.com/bosskmk/pluto_grid/blob/master/CHANGELOG.md) +> > Please note the changes when changing the version of PlutoGrid you are using. -
- -### [Issue](https://github.com/bosskmk/pluto_grid/issues) +## [Issue](https://github.com/bosskmk/pluto_grid/issues) +> > Report any questions or errors. -
- -### Packages +## Packages > [PlutoGridExport](https://github.com/bosskmk/pluto_grid/tree/master/packages/pluto_grid_export) > This package can export the metadata of PlutoGrid as CSV or PDF. +## Screenshots -
+### Change the color of the rows or make the cells look the way you want them -### Screenshots - -#### Change the color of the rows or make the cells look the way you want them. ![PlutoGrid Normal](https://bosskmk.github.io/images/pluto_grid/2.8.0/pluto_grid_2.8.0_01.png) -
+### Date type input can be easily selected by pop-up and keyboard -#### Date type input can be easily selected by pop-up and keyboard. ![PlutoGrid Select Popup](https://bosskmk.github.io/images/pluto_grid/3.1.0/pluto_grid_3.1.0_01.png) -
+### The selection type column can be easily selected using a pop-up and keyboard -#### The selection type column can be easily selected using a pop-up and keyboard. ![PlutoGrid Select Date](https://bosskmk.github.io/images/pluto_grid/2.8.0/pluto_grid_2.8.0_03.png) -
+### Group columns by desired depth -#### Group columns by desired depth. ![PlutoGrid Cell renderer](https://bosskmk.github.io/images/pluto_grid/2.8.0/pluto_grid_2.8.0_04.png) -
+### Grid can be expressed in dark mode or a combination of desired colors. Also, freeze the column, move it by dragging, or adjust the size -#### Grid can be expressed in dark mode or a combination of desired colors. Also, freeze the column, move it by dragging, or adjust the size. ![PlutoGrid Multi select](https://bosskmk.github.io/images/pluto_grid/2.8.0/pluto_grid_2.8.0_05.png) -
+## Example -### Example Generate the data to be used in the grid. + ```dart List columns = [ @@ -143,6 +130,7 @@ List rows = [ ``` Create a grid with the data created above. + ```dart @override Widget build(BuildContext context) { @@ -167,9 +155,7 @@ Widget build(BuildContext context) { } ``` -
- -### Flutter version compatible +## Flutter version compatible | Flutter | PlutoGrid | |------------------|-----------------------| @@ -181,22 +167,18 @@ Widget build(BuildContext context) { For other versions, contact the issue -
- -### Related packages +## Related packages +> > develop packages that make it easy to develop admin pages or CMS with Flutter. + * [PlutoGrid](https://github.com/bosskmk/pluto_grid) * [PlutoMenuBar](https://github.com/bosskmk/pluto_menu_bar) * [PlutoLayout](https://github.com/bosskmk/pluto_layout) -
- -### Donate to this project +## Donate to this project [![Buy me a coffee](https://www.buymeacoffee.com/assets/img/custom_images/white_img.png)](https://www.buymeacoffee.com/manki) -
- -### Jetbrains provides a free license +## Jetbrains provides a free license -[IDE license support](https://www.jetbrains.com/community/opensource/#support) +[![IDE license support](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png)](https://www.jetbrains.com/community/opensource/#support) diff --git a/demo/lib/dummy_data/development.dart b/demo/lib/dummy_data/development.dart index 624e70aac..c659e5131 100644 --- a/demo/lib/dummy_data/development.dart +++ b/demo/lib/dummy_data/development.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:demo/dummy_data/words_multilingual.dart'; import 'package:faker/faker.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; class DummyData { late List columns; diff --git a/demo/lib/dummy_data/quick_start.dart b/demo/lib/dummy_data/quick_start.dart index edc9363b3..e7063a08a 100644 --- a/demo/lib/dummy_data/quick_start.dart +++ b/demo/lib/dummy_data/quick_start.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; class DummyData { List? columns; diff --git a/demo/lib/main.dart b/demo/lib/main.dart index 3c5d5cbd3..82070b82c 100644 --- a/demo/lib/main.dart +++ b/demo/lib/main.dart @@ -48,11 +48,12 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( + debugShowCheckedModeBanner: false, initialRoute: kReleaseMode ? HomeScreen.routeName : DevelopmentScreen.routeName, routes: { @@ -119,7 +120,7 @@ class MyApp extends StatelessWidget { scaffoldBackgroundColor: PlutoGridExampleColors.backgroundColor, colorScheme: const ColorScheme.light( primary: PlutoGridExampleColors.primaryColor, - background: PlutoGridExampleColors.backgroundColor, + surface: PlutoGridExampleColors.backgroundColor, ), ), ); diff --git a/demo/lib/screen/development_screen.dart b/demo/lib/screen/development_screen.dart index 87d7b5088..aef41ebcd 100644 --- a/demo/lib/screen/development_screen.dart +++ b/demo/lib/screen/development_screen.dart @@ -1,7 +1,7 @@ -import 'package:faker/faker.dart'; +import 'package:faker/faker.dart' as faker_package; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'package:pluto_menu_bar/pluto_menu_bar.dart'; import '../dummy_data/development.dart'; @@ -20,7 +20,7 @@ enum _Test { class DevelopmentScreen extends StatefulWidget { static const routeName = 'development'; - const DevelopmentScreen({Key? key}) : super(key: key); + const DevelopmentScreen({super.key}); @override _DevelopmentScreenState createState() => _DevelopmentScreenState(); @@ -312,6 +312,14 @@ class _DevelopmentScreenState extends State { // print('Secondary click A Row.(${e.offset})'); // print(e.row?.cells['column1']?.value); // }, + // onRowEnter: (e) { + // print('Enter A Row.'); + // print(e.row?.cells['column1']?.value); + // }, + // onRowExit: (e) { + // print('Exit A Row.'); + // print(e.row?.cells['column1']?.value); + // }, createHeader: (PlutoGridStateManager stateManager) { // stateManager.headerHeight = 200; return _Header( @@ -357,7 +365,7 @@ class ClassYouImplemented implements PlutoFilterType { } class _NoRows extends StatelessWidget { - const _NoRows({Key? key}) : super(key: key); + const _NoRows(); @override Widget build(BuildContext context) { @@ -407,8 +415,7 @@ class _Header extends StatefulWidget { required this.setTextDirection, required this.setConfiguration, required this.setGridMode, - Key? key, - }) : super(key: key); + }); @override _HeaderState createState() => _HeaderState(); @@ -439,7 +446,7 @@ class _HeaderState extends State<_Header> { 0, [ PlutoColumn( - title: faker.food.cuisine(), + title: faker_package.faker.food.cuisine(), field: 'new_${DateTime.now()}', type: PlutoColumnType.text(), frozen: frozen, @@ -657,9 +664,11 @@ class _HeaderState extends State<_Header> { return PlutoMenuBar( borderColor: Colors.transparent, mode: _isMobile ? PlutoMenuBarMode.tap : PlutoMenuBarMode.hover, - textStyle: const TextStyle( - color: Colors.black, - fontSize: 14, + itemStyle: const PlutoMenuItemStyle( + textStyle: TextStyle( + color: Colors.black, + fontSize: 14, + ), ), menus: [ PlutoMenuItem( diff --git a/demo/lib/screen/empty_screen.dart b/demo/lib/screen/empty_screen.dart index e999794e5..9da49ea6a 100644 --- a/demo/lib/screen/empty_screen.dart +++ b/demo/lib/screen/empty_screen.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../dummy_data/development.dart'; class EmptyScreen extends StatefulWidget { static const routeName = 'empty'; - const EmptyScreen({Key? key}) : super(key: key); + const EmptyScreen({super.key}); @override _EmptyScreenState createState() => _EmptyScreenState(); diff --git a/demo/lib/screen/feature/add_and_remove_column_row_screen.dart b/demo/lib/screen/feature/add_and_remove_column_row_screen.dart index 0c7f4345b..b2152de8c 100644 --- a/demo/lib/screen/feature/add_and_remove_column_row_screen.dart +++ b/demo/lib/screen/feature/add_and_remove_column_row_screen.dart @@ -1,8 +1,8 @@ import 'dart:async'; -import 'package:faker/faker.dart'; +import 'package:faker/faker.dart' as faker_package; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -10,7 +10,7 @@ import '../../widget/pluto_example_screen.dart'; class AddAndRemoveColumnRowScreen extends StatefulWidget { static const routeName = 'add-and-remove-column-row'; - const AddAndRemoveColumnRowScreen({Key? key}) : super(key: key); + const AddAndRemoveColumnRowScreen({super.key}); @override _AddAndRemoveColumnRowScreenState createState() => @@ -167,8 +167,7 @@ class _AddAndRemoveColumnRowScreenState class _Header extends StatefulWidget { const _Header({ required this.stateManager, - Key? key, - }) : super(key: key); + }); final PlutoGridStateManager stateManager; @@ -177,7 +176,7 @@ class _Header extends StatefulWidget { } class _HeaderState extends State<_Header> { - final faker = Faker(); + final faker = faker_package.Faker(); int addCount = 1; diff --git a/demo/lib/screen/feature/add_rows_asynchronously.dart b/demo/lib/screen/feature/add_rows_asynchronously.dart index 78faa54d9..9fe9f7f3a 100644 --- a/demo/lib/screen/feature/add_rows_asynchronously.dart +++ b/demo/lib/screen/feature/add_rows_asynchronously.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -10,7 +10,7 @@ import '../../widget/pluto_example_screen.dart'; class AddRowsAsynchronouslyScreen extends StatefulWidget { static const routeName = 'feature/add-rows-asynchronously'; - const AddRowsAsynchronouslyScreen({Key? key}) : super(key: key); + const AddRowsAsynchronouslyScreen({super.key}); @override _AddRowsAsynchronouslyScreenState createState() => diff --git a/demo/lib/screen/feature/cell_renderer_screen.dart b/demo/lib/screen/feature/cell_renderer_screen.dart index 12ec50e85..2c073a462 100644 --- a/demo/lib/screen/feature/cell_renderer_screen.dart +++ b/demo/lib/screen/feature/cell_renderer_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class CellRendererScreen extends StatefulWidget { static const routeName = 'feature/cell-renderer'; - const CellRendererScreen({Key? key}) : super(key: key); + const CellRendererScreen({super.key}); @override _CellRendererScreenState createState() => _CellRendererScreenState(); diff --git a/demo/lib/screen/feature/cell_selection_screen.dart b/demo/lib/screen/feature/cell_selection_screen.dart index edd27d3ba..80905ed4f 100644 --- a/demo/lib/screen/feature/cell_selection_screen.dart +++ b/demo/lib/screen/feature/cell_selection_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class CellSelectionScreen extends StatefulWidget { static const routeName = 'feature/cell-selection'; - const CellSelectionScreen({Key? key}) : super(key: key); + const CellSelectionScreen({super.key}); @override _CellSelectionScreenState createState() => _CellSelectionScreenState(); diff --git a/demo/lib/screen/feature/column_filtering_screen.dart b/demo/lib/screen/feature/column_filtering_screen.dart index 073a9143d..255dda572 100644 --- a/demo/lib/screen/feature/column_filtering_screen.dart +++ b/demo/lib/screen/feature/column_filtering_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class ColumnFilteringScreen extends StatefulWidget { static const routeName = 'feature/column-filtering'; - const ColumnFilteringScreen({Key? key}) : super(key: key); + const ColumnFilteringScreen({super.key}); @override _ColumnFilteringScreenState createState() => _ColumnFilteringScreenState(); diff --git a/demo/lib/screen/feature/column_footer_screen.dart b/demo/lib/screen/feature/column_footer_screen.dart index a958677b8..58b6bec36 100644 --- a/demo/lib/screen/feature/column_footer_screen.dart +++ b/demo/lib/screen/feature/column_footer_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class ColumnFooterScreen extends StatefulWidget { static const routeName = 'feature/column-footer'; - const ColumnFooterScreen({Key? key}) : super(key: key); + const ColumnFooterScreen({super.key}); @override _ColumnFooterScreenState createState() => _ColumnFooterScreenState(); diff --git a/demo/lib/screen/feature/column_freezing_screen.dart b/demo/lib/screen/feature/column_freezing_screen.dart index 456327864..2695a474a 100644 --- a/demo/lib/screen/feature/column_freezing_screen.dart +++ b/demo/lib/screen/feature/column_freezing_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class ColumnFreezingScreen extends StatefulWidget { static const routeName = 'feature/column-freezing'; - const ColumnFreezingScreen({Key? key}) : super(key: key); + const ColumnFreezingScreen({super.key}); @override _ColumnFreezingScreenState createState() => _ColumnFreezingScreenState(); diff --git a/demo/lib/screen/feature/column_group_screen.dart b/demo/lib/screen/feature/column_group_screen.dart index efcec20ec..a8de2597a 100644 --- a/demo/lib/screen/feature/column_group_screen.dart +++ b/demo/lib/screen/feature/column_group_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class ColumnGroupScreen extends StatefulWidget { static const routeName = 'feature/column-group'; - const ColumnGroupScreen({Key? key}) : super(key: key); + const ColumnGroupScreen({super.key}); @override _ColumnGroupScreenState createState() => _ColumnGroupScreenState(); diff --git a/demo/lib/screen/feature/column_hiding_screen.dart b/demo/lib/screen/feature/column_hiding_screen.dart index 58b699ff7..9725a8648 100644 --- a/demo/lib/screen/feature/column_hiding_screen.dart +++ b/demo/lib/screen/feature/column_hiding_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -7,7 +7,7 @@ import '../../widget/pluto_example_screen.dart'; class ColumnHidingScreen extends StatefulWidget { static const routeName = 'feature/column-hiding'; - const ColumnHidingScreen({Key? key}) : super(key: key); + const ColumnHidingScreen({super.key}); @override _ColumnHidingScreenState createState() => _ColumnHidingScreenState(); diff --git a/demo/lib/screen/feature/column_menu_screen.dart b/demo/lib/screen/feature/column_menu_screen.dart index ba46552f4..f0abad817 100644 --- a/demo/lib/screen/feature/column_menu_screen.dart +++ b/demo/lib/screen/feature/column_menu_screen.dart @@ -1,6 +1,6 @@ import 'package:demo/dummy_data/development.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class ColumnMenuScreen extends StatefulWidget { static const routeName = 'feature/column-menu'; - const ColumnMenuScreen({Key? key}) : super(key: key); + const ColumnMenuScreen({super.key}); @override _ColumnMenuScreenState createState() => _ColumnMenuScreenState(); diff --git a/demo/lib/screen/feature/column_moving_screen.dart b/demo/lib/screen/feature/column_moving_screen.dart index f820eb5df..712614987 100644 --- a/demo/lib/screen/feature/column_moving_screen.dart +++ b/demo/lib/screen/feature/column_moving_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -7,7 +7,7 @@ import '../../widget/pluto_example_screen.dart'; class ColumnMovingScreen extends StatefulWidget { static const routeName = 'feature/column-moving'; - const ColumnMovingScreen({Key? key}) : super(key: key); + const ColumnMovingScreen({super.key}); @override _ColumnMovingScreenState createState() => _ColumnMovingScreenState(); diff --git a/demo/lib/screen/feature/column_resizing_screen.dart b/demo/lib/screen/feature/column_resizing_screen.dart index 3576766a1..50dd64a57 100644 --- a/demo/lib/screen/feature/column_resizing_screen.dart +++ b/demo/lib/screen/feature/column_resizing_screen.dart @@ -1,6 +1,6 @@ import 'package:demo/dummy_data/development.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class ColumnResizingScreen extends StatefulWidget { static const routeName = 'feature/column-resizing'; - const ColumnResizingScreen({Key? key}) : super(key: key); + const ColumnResizingScreen({super.key}); @override _ColumnResizingScreenState createState() => _ColumnResizingScreenState(); @@ -78,8 +78,7 @@ class _ColumnResizingScreenState extends State { class _Header extends StatefulWidget { const _Header({ required this.setConfig, - Key? key, - }) : super(key: key); + }); final void Function(PlutoGridColumnSizeConfig) setConfig; diff --git a/demo/lib/screen/feature/column_sorting_screen.dart b/demo/lib/screen/feature/column_sorting_screen.dart index 3a9eefbf2..930bcc5b1 100644 --- a/demo/lib/screen/feature/column_sorting_screen.dart +++ b/demo/lib/screen/feature/column_sorting_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -7,7 +7,7 @@ import '../../widget/pluto_example_screen.dart'; class ColumnSortingScreen extends StatefulWidget { static const routeName = 'feature/column-sorting'; - const ColumnSortingScreen({Key? key}) : super(key: key); + const ColumnSortingScreen({super.key}); @override _ColumnSortingScreenState createState() => _ColumnSortingScreenState(); diff --git a/demo/lib/screen/feature/copy_and_paste_screen.dart b/demo/lib/screen/feature/copy_and_paste_screen.dart index 496d8dcc6..3cb64b61d 100644 --- a/demo/lib/screen/feature/copy_and_paste_screen.dart +++ b/demo/lib/screen/feature/copy_and_paste_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class CopyAndPasteScreen extends StatefulWidget { static const routeName = 'feature/copy-and-paste'; - const CopyAndPasteScreen({Key? key}) : super(key: key); + const CopyAndPasteScreen({super.key}); @override _CopyAndPasteScreenState createState() => _CopyAndPasteScreenState(); diff --git a/demo/lib/screen/feature/currency_type_column_screen.dart b/demo/lib/screen/feature/currency_type_column_screen.dart index f1ed82054..15cb2c5c8 100644 --- a/demo/lib/screen/feature/currency_type_column_screen.dart +++ b/demo/lib/screen/feature/currency_type_column_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class CurrencyTypeColumnScreen extends StatefulWidget { static const routeName = 'feature/currency-type-column'; - const CurrencyTypeColumnScreen({Key? key}) : super(key: key); + const CurrencyTypeColumnScreen({super.key}); @override _CurrencyTypeColumnScreenState createState() => diff --git a/demo/lib/screen/feature/dark_mode_screen.dart b/demo/lib/screen/feature/dark_mode_screen.dart index 34457ad8d..2bea6c963 100644 --- a/demo/lib/screen/feature/dark_mode_screen.dart +++ b/demo/lib/screen/feature/dark_mode_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class DarkModeScreen extends StatefulWidget { static const routeName = 'feature/dark-mode'; - const DarkModeScreen({Key? key}) : super(key: key); + const DarkModeScreen({super.key}); @override _DarkModeScreenState createState() => _DarkModeScreenState(); diff --git a/demo/lib/screen/feature/date_type_column_screen.dart b/demo/lib/screen/feature/date_type_column_screen.dart index 00c5d9873..063ffa517 100644 --- a/demo/lib/screen/feature/date_type_column_screen.dart +++ b/demo/lib/screen/feature/date_type_column_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -7,7 +7,7 @@ import '../../widget/pluto_example_screen.dart'; class DateTypeColumnScreen extends StatefulWidget { static const routeName = 'feature/date-type-column'; - const DateTypeColumnScreen({Key? key}) : super(key: key); + const DateTypeColumnScreen({super.key}); @override _DateTypeColumnScreenState createState() => _DateTypeColumnScreenState(); diff --git a/demo/lib/screen/feature/dual_mode_screen.dart b/demo/lib/screen/feature/dual_mode_screen.dart index 9cdd8fbaf..366efa553 100644 --- a/demo/lib/screen/feature/dual_mode_screen.dart +++ b/demo/lib/screen/feature/dual_mode_screen.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:faker/faker.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -11,7 +11,7 @@ import '../../widget/pluto_example_screen.dart'; class DualModeScreen extends StatefulWidget { static const routeName = 'feature/dual-mode'; - const DualModeScreen({Key? key}) : super(key: key); + const DualModeScreen({super.key}); @override _DualModeScreenState createState() => _DualModeScreenState(); diff --git a/demo/lib/screen/feature/editing_state_screen.dart b/demo/lib/screen/feature/editing_state_screen.dart index 7c288e699..ae1dd30db 100644 --- a/demo/lib/screen/feature/editing_state_screen.dart +++ b/demo/lib/screen/feature/editing_state_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class EditingStateScreen extends StatefulWidget { static const routeName = 'feature/editing-state'; - const EditingStateScreen({Key? key}) : super(key: key); + const EditingStateScreen({super.key}); @override _EditingStateScreenState createState() => _EditingStateScreenState(); diff --git a/demo/lib/screen/feature/export_screen.dart b/demo/lib/screen/feature/export_screen.dart index a339c1848..de1b9bbdd 100644 --- a/demo/lib/screen/feature/export_screen.dart +++ b/demo/lib/screen/feature/export_screen.dart @@ -1,9 +1,14 @@ // ignore_for_file: unused_local_variable +import 'dart:convert'; + +import 'package:file_saver/file_saver.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:flutter/services.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; -// import 'package:pluto_grid_export/pluto_grid_export.dart' as pluto_grid_export; +import 'package:pluto_grid_plus_export/pluto_grid_plus_export.dart' + as pluto_grid_export; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -12,7 +17,7 @@ import '../../widget/pluto_example_screen.dart'; class ExportScreen extends StatefulWidget { static const routeName = 'feature/export'; - const ExportScreen({Key? key}) : super(key: key); + const ExportScreen({super.key}); @override _ExportScreenState createState() => _ExportScreenState(); @@ -166,8 +171,7 @@ class _ExportScreenState extends State { class _Header extends StatefulWidget { const _Header({ required this.stateManager, - Key? key, - }) : super(key: key); + }); final PlutoGridStateManager stateManager; @@ -177,25 +181,25 @@ class _Header extends StatefulWidget { class _HeaderState extends State<_Header> { void _printToPdfAndShareOrSave() async { - // final themeData = pluto_grid_export.ThemeData.withFont( - // base: pluto_grid_export.Font.ttf( - // await rootBundle.load('assets/fonts/open_sans/OpenSans-Regular.ttf'), - // ), - // bold: pluto_grid_export.Font.ttf( - // await rootBundle.load('assets/fonts/open_sans/OpenSans-Bold.ttf'), - // ), - // ); - // - // var plutoGridPdfExport = pluto_grid_export.PlutoGridDefaultPdfExport( - // title: "Pluto Grid Sample pdf print", - // creator: "Pluto Grid Rocks!", - // format: pluto_grid_export.PdfPageFormat.a4.landscape, - // themeData: themeData, - // ); - // - // await pluto_grid_export.Printing.sharePdf( - // bytes: await plutoGridPdfExport.export(widget.stateManager), - // filename: plutoGridPdfExport.getFilename()); + final themeData = pluto_grid_export.ThemeData.withFont( + base: pluto_grid_export.Font.ttf( + await rootBundle.load('assets/fonts/open_sans/OpenSans-Regular.ttf'), + ), + bold: pluto_grid_export.Font.ttf( + await rootBundle.load('assets/fonts/open_sans/OpenSans-Bold.ttf'), + ), + ); + + var plutoGridPdfExport = pluto_grid_export.PlutoGridDefaultPdfExport( + title: "Pluto Grid Sample pdf print", + creator: "Pluto Grid Rocks!", + format: pluto_grid_export.PdfPageFormat.a4.landscape, + themeData: themeData, + ); + + await pluto_grid_export.Printing.sharePdf( + bytes: await plutoGridPdfExport.export(widget.stateManager), + filename: plutoGridPdfExport.getFilename()); } // This doesn't works properly in systems different from Windows. @@ -219,10 +223,30 @@ class _HeaderState extends State<_Header> { // } void _defaultExportGridAsCSV() async { - // String title = "pluto_grid_export"; - // var exported = const Utf8Encoder().convert( - // pluto_grid_export.PlutoGridExport.exportCSV(widget.stateManager)); - // await FileSaver.instance.saveFile("$title.csv", exported, ".csv"); + String title = "pluto_grid_export"; + var exported = const Utf8Encoder().convert( + pluto_grid_export.PlutoGridExport.exportCSV(widget.stateManager)); + String savedFile = await FileSaver.instance + .saveFile(name: title, bytes: exported, ext: ".csv"); + if (!mounted) return; + String msg = 'Exported successfully'; + + msg = + 'Exported successfully. Please open the file in Excel. Path: $savedFile'; + if (!mounted) return; + showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Success'), + content: Text(msg), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text('OK'), + ) + ])); } void _defaultExportGridAsCSVCompatibleWithExcel() async { diff --git a/demo/lib/screen/feature/grid_as_popup_screen.dart b/demo/lib/screen/feature/grid_as_popup_screen.dart index b7c94fa75..d870fcfe9 100644 --- a/demo/lib/screen/feature/grid_as_popup_screen.dart +++ b/demo/lib/screen/feature/grid_as_popup_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class GridAsPopupScreen extends StatefulWidget { static const routeName = 'feature/grid-as-popup'; - const GridAsPopupScreen({Key? key}) : super(key: key); + const GridAsPopupScreen({super.key}); @override _GridAsPopupScreenState createState() => _GridAsPopupScreenState(); diff --git a/demo/lib/screen/feature/listing_mode_screen.dart b/demo/lib/screen/feature/listing_mode_screen.dart index e5fb73d71..2038fce89 100644 --- a/demo/lib/screen/feature/listing_mode_screen.dart +++ b/demo/lib/screen/feature/listing_mode_screen.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -10,7 +10,7 @@ import '../../widget/pluto_example_screen.dart'; class ListingModeScreen extends StatefulWidget { static const routeName = 'feature/listing-mode'; - const ListingModeScreen({Key? key}) : super(key: key); + const ListingModeScreen({super.key}); @override _ListingModeScreenState createState() => _ListingModeScreenState(); @@ -115,7 +115,7 @@ class _ListingModeScreenState extends State { }, style: ButtonStyle( backgroundColor: - MaterialStateProperty.all( + WidgetStateProperty.all( Colors.blue, ), ), @@ -181,12 +181,10 @@ class _ListingModeScreenState extends State { autofocus: true, ), const SizedBox(height: 20), - ...row!.cells.entries - .map((e) => Padding( - padding: const EdgeInsets.all(8.0), - child: Text(e.value.value.toString()), - )) - .toList(), + ...row!.cells.entries.map((e) => Padding( + padding: const EdgeInsets.all(8.0), + child: Text(e.value.value.toString()), + )), const SizedBox(height: 20), Center( child: Wrap( @@ -204,7 +202,7 @@ class _ListingModeScreenState extends State { }, style: ButtonStyle( backgroundColor: - MaterialStateProperty.all( + WidgetStateProperty.all( Colors.blue, ), ), diff --git a/demo/lib/screen/feature/moving_screen.dart b/demo/lib/screen/feature/moving_screen.dart index 459558d4d..cc1a4bcab 100644 --- a/demo/lib/screen/feature/moving_screen.dart +++ b/demo/lib/screen/feature/moving_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class MovingScreen extends StatefulWidget { static const routeName = 'feature/moving'; - const MovingScreen({Key? key}) : super(key: key); + const MovingScreen({super.key}); @override _MovingScreenState createState() => _MovingScreenState(); diff --git a/demo/lib/screen/feature/number_type_column_screen.dart b/demo/lib/screen/feature/number_type_column_screen.dart index 3f0bee6bc..9dfbe9ae8 100644 --- a/demo/lib/screen/feature/number_type_column_screen.dart +++ b/demo/lib/screen/feature/number_type_column_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -7,7 +7,7 @@ import '../../widget/pluto_example_screen.dart'; class NumberTypeColumnScreen extends StatefulWidget { static const routeName = 'feature/number-type-column'; - const NumberTypeColumnScreen({Key? key}) : super(key: key); + const NumberTypeColumnScreen({super.key}); @override _NumberTypeColumnScreenState createState() => _NumberTypeColumnScreenState(); diff --git a/demo/lib/screen/feature/row_color_screen.dart b/demo/lib/screen/feature/row_color_screen.dart index 3b6740bfd..b3d2bbb92 100644 --- a/demo/lib/screen/feature/row_color_screen.dart +++ b/demo/lib/screen/feature/row_color_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class RowColorScreen extends StatefulWidget { static const routeName = 'feature/row-color'; - const RowColorScreen({Key? key}) : super(key: key); + const RowColorScreen({super.key}); @override _RowColorScreenState createState() => _RowColorScreenState(); diff --git a/demo/lib/screen/feature/row_group_screen.dart b/demo/lib/screen/feature/row_group_screen.dart index f5c99efbd..0eb95dea3 100644 --- a/demo/lib/screen/feature/row_group_screen.dart +++ b/demo/lib/screen/feature/row_group_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_docs_button.dart'; @@ -9,7 +9,7 @@ import '../../widget/pluto_example_screen.dart'; class RowGroupScreen extends StatefulWidget { static const routeName = 'feature/row-group'; - const RowGroupScreen({Key? key}) : super(key: key); + const RowGroupScreen({super.key}); @override _RowGroupScreenState createState() => _RowGroupScreenState(); @@ -89,7 +89,7 @@ class _RowGroupScreenState extends State { children: FilteredList( initialList: [ PlutoRow(cells: { - 'files': PlutoCell(value: 'pluto_grid.dart') + 'files': PlutoCell(value: 'pluto_grid_plus.dart') }), PlutoRow(cells: { 'files': PlutoCell(value: 'pluto_dual_grid.dart') diff --git a/demo/lib/screen/feature/row_infinity_scroll_screen.dart b/demo/lib/screen/feature/row_infinity_scroll_screen.dart index 4fa6518b3..b963d291a 100644 --- a/demo/lib/screen/feature/row_infinity_scroll_screen.dart +++ b/demo/lib/screen/feature/row_infinity_scroll_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class RowInfinityScrollScreen extends StatefulWidget { static const routeName = 'feature/row-infinity-scroll'; - const RowInfinityScrollScreen({Key? key}) : super(key: key); + const RowInfinityScrollScreen({super.key}); @override _RowInfinityScrollScreenState createState() => diff --git a/demo/lib/screen/feature/row_lazy_pagination_screen.dart b/demo/lib/screen/feature/row_lazy_pagination_screen.dart index 1edd8b7c5..5f590931b 100644 --- a/demo/lib/screen/feature/row_lazy_pagination_screen.dart +++ b/demo/lib/screen/feature/row_lazy_pagination_screen.dart @@ -1,7 +1,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -10,7 +10,7 @@ import '../../widget/pluto_example_screen.dart'; class RowLazyPaginationScreen extends StatefulWidget { static const routeName = 'feature/row-lazy-pagination'; - const RowLazyPaginationScreen({Key? key}) : super(key: key); + const RowLazyPaginationScreen({super.key}); @override State createState() => diff --git a/demo/lib/screen/feature/row_moving_screen.dart b/demo/lib/screen/feature/row_moving_screen.dart index 3b9c80cd5..dc2dd335b 100644 --- a/demo/lib/screen/feature/row_moving_screen.dart +++ b/demo/lib/screen/feature/row_moving_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class RowMovingScreen extends StatefulWidget { static const routeName = 'feature/row-moving'; - const RowMovingScreen({Key? key}) : super(key: key); + const RowMovingScreen({super.key}); @override _RowMovingScreenState createState() => _RowMovingScreenState(); diff --git a/demo/lib/screen/feature/row_pagination_screen.dart b/demo/lib/screen/feature/row_pagination_screen.dart index cca884129..aae44db3e 100644 --- a/demo/lib/screen/feature/row_pagination_screen.dart +++ b/demo/lib/screen/feature/row_pagination_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class RowPaginationScreen extends StatefulWidget { static const routeName = 'feature/row-pagination'; - const RowPaginationScreen({Key? key}) : super(key: key); + const RowPaginationScreen({super.key}); @override _RowPaginationScreenState createState() => _RowPaginationScreenState(); diff --git a/demo/lib/screen/feature/row_selection_screen.dart b/demo/lib/screen/feature/row_selection_screen.dart index 1feebc5bc..4203b253d 100644 --- a/demo/lib/screen/feature/row_selection_screen.dart +++ b/demo/lib/screen/feature/row_selection_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class RowSelectionScreen extends StatefulWidget { static const routeName = 'feature/row-selection'; - const RowSelectionScreen({Key? key}) : super(key: key); + const RowSelectionScreen({super.key}); @override _RowSelectionScreenState createState() => _RowSelectionScreenState(); diff --git a/demo/lib/screen/feature/row_with_checkbox_screen.dart b/demo/lib/screen/feature/row_with_checkbox_screen.dart index 146be7790..7694765de 100644 --- a/demo/lib/screen/feature/row_with_checkbox_screen.dart +++ b/demo/lib/screen/feature/row_with_checkbox_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class RowWithCheckboxScreen extends StatefulWidget { static const routeName = 'feature/row-with-checkbox'; - const RowWithCheckboxScreen({Key? key}) : super(key: key); + const RowWithCheckboxScreen({super.key}); @override _RowWithCheckboxScreenState createState() => _RowWithCheckboxScreenState(); diff --git a/demo/lib/screen/feature/rtl_screen.dart b/demo/lib/screen/feature/rtl_screen.dart index b2c6718ce..af9f1fff6 100644 --- a/demo/lib/screen/feature/rtl_screen.dart +++ b/demo/lib/screen/feature/rtl_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../dummy_data/development.dart'; import '../../widget/pluto_example_button.dart'; @@ -8,7 +8,7 @@ import '../../widget/pluto_example_screen.dart'; class RTLScreen extends StatefulWidget { static const routeName = 'feature/rtl'; - const RTLScreen({Key? key}) : super(key: key); + const RTLScreen({super.key}); @override _RTLScreenState createState() => _RTLScreenState(); diff --git a/demo/lib/screen/feature/selection_type_column_screen.dart b/demo/lib/screen/feature/selection_type_column_screen.dart index 5238274b3..5e09a6439 100644 --- a/demo/lib/screen/feature/selection_type_column_screen.dart +++ b/demo/lib/screen/feature/selection_type_column_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -7,7 +7,7 @@ import '../../widget/pluto_example_screen.dart'; class SelectionTypeColumnScreen extends StatefulWidget { static const routeName = 'feature/selection-type-column'; - const SelectionTypeColumnScreen({Key? key}) : super(key: key); + const SelectionTypeColumnScreen({super.key}); @override _SelectionTypeColumnScreenState createState() => diff --git a/demo/lib/screen/feature/text_type_column_screen.dart b/demo/lib/screen/feature/text_type_column_screen.dart index b8060073e..5b09ae953 100644 --- a/demo/lib/screen/feature/text_type_column_screen.dart +++ b/demo/lib/screen/feature/text_type_column_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -7,7 +7,7 @@ import '../../widget/pluto_example_screen.dart'; class TextTypeColumnScreen extends StatefulWidget { static const routeName = 'feature/text-type-column'; - const TextTypeColumnScreen({Key? key}) : super(key: key); + const TextTypeColumnScreen({super.key}); @override _TextTypeColumnScreenState createState() => _TextTypeColumnScreenState(); diff --git a/demo/lib/screen/feature/time_type_column_screen.dart b/demo/lib/screen/feature/time_type_column_screen.dart index 6d5195bc0..c77ecedec 100644 --- a/demo/lib/screen/feature/time_type_column_screen.dart +++ b/demo/lib/screen/feature/time_type_column_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -7,7 +7,7 @@ import '../../widget/pluto_example_screen.dart'; class TimeTypeColumnScreen extends StatefulWidget { static const routeName = 'feature/time-type-column'; - const TimeTypeColumnScreen({Key? key}) : super(key: key); + const TimeTypeColumnScreen({super.key}); @override _TimeTypeColumnScreenState createState() => _TimeTypeColumnScreenState(); diff --git a/demo/lib/screen/feature/value_formatter_screen.dart b/demo/lib/screen/feature/value_formatter_screen.dart index 630325d5b..25b5aa3fa 100644 --- a/demo/lib/screen/feature/value_formatter_screen.dart +++ b/demo/lib/screen/feature/value_formatter_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../widget/pluto_example_button.dart'; import '../../widget/pluto_example_screen.dart'; @@ -7,7 +7,7 @@ import '../../widget/pluto_example_screen.dart'; class ValueFormatterScreen extends StatefulWidget { static const routeName = 'feature/value-formatter'; - const ValueFormatterScreen({Key? key}) : super(key: key); + const ValueFormatterScreen({super.key}); @override _ValueFormatterScreenState createState() => _ValueFormatterScreenState(); diff --git a/demo/lib/screen/home_screen.dart b/demo/lib/screen/home_screen.dart index cdcae2d82..8daa879fc 100644 --- a/demo/lib/screen/home_screen.dart +++ b/demo/lib/screen/home_screen.dart @@ -1,5 +1,6 @@ import 'dart:math'; +import 'package:demo/screen/empty_screen.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -51,7 +52,7 @@ import 'feature/value_formatter_screen.dart'; class HomeScreen extends StatelessWidget { static const routeName = '/'; - const HomeScreen({Key? key}) : super(key: key); + const HomeScreen({super.key}); @override Widget build(BuildContext context) { @@ -115,7 +116,7 @@ class HomeScreen extends StatelessWidget { color: Colors.white, onPressed: () { launchUrl( - 'https://pub.dev/packages/pluto_grid'); + 'https://pub.dev/packages/pluto_grid_plus'); }, ), const Text( @@ -147,7 +148,7 @@ class HomeScreen extends StatelessWidget { color: Colors.white, onPressed: () { launchUrl( - 'https://github.com/bosskmk/pluto_grid'); + 'https://github.com/doonfrs/pluto_grid_plus'); }, ), const Text( @@ -203,7 +204,7 @@ class PlutoFeatures extends StatelessWidget { color: Colors.deepOrange, ); - const PlutoFeatures({Key? key}) : super(key: key); + const PlutoFeatures({super.key}); @override Widget build(BuildContext context) { @@ -491,6 +492,14 @@ class PlutoFeatures extends StatelessWidget { Navigator.pushNamed(context, DarkModeScreen.routeName); }, ), + PlutoListTile.amber( + title: 'Empty', + description: + 'This screen is used during development, this is a template to test issues', + onTapLiveDemo: () { + Navigator.pushNamed(context, EmptyScreen.routeName); + }, + ), PlutoListTile.amber( title: 'Development', description: @@ -506,7 +515,7 @@ class PlutoFeatures extends StatelessWidget { } class PlutoContributors extends StatelessWidget { - const PlutoContributors({Key? key}) : super(key: key); + const PlutoContributors({super.key}); @override Widget build(BuildContext context) { @@ -697,6 +706,13 @@ class PlutoContributors extends StatelessWidget { launchUrl('https://github.com/sidlatau'); }, ), + PlutoContributorTile( + name: 'coruscant187', + linkTitle: 'Github', + onTapLink: () { + launchUrl('https://github.com/coruscant187'); + }, + ), PlutoContributorTile.invisible( name: 'And you.', linkTitle: 'Github', diff --git a/demo/lib/widget/pluto_contributor_tile.dart b/demo/lib/widget/pluto_contributor_tile.dart index 57fc40d60..26ed13be9 100644 --- a/demo/lib/widget/pluto_contributor_tile.dart +++ b/demo/lib/widget/pluto_contributor_tile.dart @@ -12,24 +12,22 @@ class PlutoContributorTile extends StatelessWidget { final Function()? onTapLink; const PlutoContributorTile({ - Key? key, + super.key, required this.name, this.description, this.linkTitle, this.onTapLink, }) : _color = Colors.white, - _fontColor = PlutoGridExampleColors.fontColor, - super(key: key); + _fontColor = PlutoGridExampleColors.fontColor; const PlutoContributorTile.invisible({ - Key? key, + super.key, required this.name, this.description, this.linkTitle, this.onTapLink, }) : _color = Colors.white70, - _fontColor = Colors.black54, - super(key: key); + _fontColor = Colors.black54; final Color _color; final Color _fontColor; diff --git a/demo/lib/widget/pluto_docs_button.dart b/demo/lib/widget/pluto_docs_button.dart index 874e4423d..b154e7c8c 100644 --- a/demo/lib/widget/pluto_docs_button.dart +++ b/demo/lib/widget/pluto_docs_button.dart @@ -7,10 +7,9 @@ class PlutoDocsButton extends StatelessWidget { final String url; PlutoDocsButton({ - Key? key, + super.key, required this.url, - }) : assert(url.isNotEmpty), - super(key: key); + }) : assert(url.isNotEmpty); @override Widget build(BuildContext context) { diff --git a/demo/lib/widget/pluto_example_button.dart b/demo/lib/widget/pluto_example_button.dart index bfda14ed2..2a53db272 100644 --- a/demo/lib/widget/pluto_example_button.dart +++ b/demo/lib/widget/pluto_example_button.dart @@ -7,10 +7,9 @@ class PlutoExampleButton extends StatelessWidget { final String url; PlutoExampleButton({ - Key? key, + super.key, required this.url, - }) : assert(url.isNotEmpty), - super(key: key); + }) : assert(url.isNotEmpty); @override Widget build(BuildContext context) { diff --git a/demo/lib/widget/pluto_example_screen.dart b/demo/lib/widget/pluto_example_screen.dart index 928c9236e..ba08242f8 100644 --- a/demo/lib/widget/pluto_example_screen.dart +++ b/demo/lib/widget/pluto_example_screen.dart @@ -12,13 +12,13 @@ class PlutoExampleScreen extends StatelessWidget { final Widget? body; const PlutoExampleScreen({ - Key? key, + super.key, this.title, this.topTitle, this.topContents, this.topButtons, this.body, - }) : super(key: key); + }); AlertDialog reportingDialog(BuildContext context) { return AlertDialog( diff --git a/demo/lib/widget/pluto_expansion_tile.dart b/demo/lib/widget/pluto_expansion_tile.dart index 5d4f7e79b..447fd15bd 100644 --- a/demo/lib/widget/pluto_expansion_tile.dart +++ b/demo/lib/widget/pluto_expansion_tile.dart @@ -8,12 +8,11 @@ class PlutoExpansionTile extends StatelessWidget { final List? buttons; PlutoExpansionTile({ - Key? key, + super.key, required this.title, this.children, this.buttons, - }) : assert(title.isNotEmpty), - super(key: key); + }) : assert(title.isNotEmpty); @override Widget build(BuildContext context) { diff --git a/demo/lib/widget/pluto_grid_title.dart b/demo/lib/widget/pluto_grid_title.dart index 681d55292..b8d8f9dda 100644 --- a/demo/lib/widget/pluto_grid_title.dart +++ b/demo/lib/widget/pluto_grid_title.dart @@ -4,9 +4,9 @@ class PlutoGridTitle extends StatelessWidget { final double? fontSize; const PlutoGridTitle({ - Key? key, + super.key, this.fontSize, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/demo/lib/widget/pluto_list_tile.dart b/demo/lib/widget/pluto_list_tile.dart index d16fd0f8b..46e6fbf19 100644 --- a/demo/lib/widget/pluto_list_tile.dart +++ b/demo/lib/widget/pluto_list_tile.dart @@ -14,37 +14,34 @@ class PlutoListTile extends StatelessWidget { final Widget? trailing; const PlutoListTile({ - Key? key, + super.key, required this.title, this.description, this.onTapPreview, this.onTapLiveDemo, this.trailing, }) : _color = Colors.white, - _fontColor = PlutoGridExampleColors.fontColor, - super(key: key); + _fontColor = PlutoGridExampleColors.fontColor; const PlutoListTile.dark({ - Key? key, + super.key, required this.title, this.description, this.onTapPreview, this.onTapLiveDemo, this.trailing, }) : _color = Colors.black87, - _fontColor = Colors.white70, - super(key: key); + _fontColor = Colors.white70; const PlutoListTile.amber({ - Key? key, + super.key, required this.title, this.description, this.onTapPreview, this.onTapLiveDemo, this.trailing, }) : _color = Colors.amber, - _fontColor = Colors.black87, - super(key: key); + _fontColor = Colors.black87; final Color _color; final Color _fontColor; diff --git a/demo/lib/widget/pluto_section.dart b/demo/lib/widget/pluto_section.dart index 34e6778e7..01bbb7a92 100644 --- a/demo/lib/widget/pluto_section.dart +++ b/demo/lib/widget/pluto_section.dart @@ -10,12 +10,12 @@ class PlutoSection extends StatelessWidget { final Color? fontColor; const PlutoSection({ - Key? key, + super.key, this.title, this.child, this.color, this.fontColor, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/demo/lib/widget/pluto_text_color_animation.dart b/demo/lib/widget/pluto_text_color_animation.dart index 93b88ffb7..8c777a34b 100644 --- a/demo/lib/widget/pluto_text_color_animation.dart +++ b/demo/lib/widget/pluto_text_color_animation.dart @@ -7,11 +7,11 @@ class PlutoTextColorAnimation extends StatefulWidget { final FontWeight? fontWeight; const PlutoTextColorAnimation({ - Key? key, + super.key, this.text, this.fontSize, this.fontWeight, - }) : super(key: key); + }); @override _PlutoTextColorAnimationState createState() => diff --git a/demo/linux/flutter/ephemeral/.plugin_symlinks/file_saver b/demo/linux/flutter/ephemeral/.plugin_symlinks/file_saver new file mode 120000 index 000000000..265ba5f45 --- /dev/null +++ b/demo/linux/flutter/ephemeral/.plugin_symlinks/file_saver @@ -0,0 +1 @@ +C:/Users/DOONF/AppData/Local/Pub/Cache/hosted/pub.dev/file_saver-0.2.10/ \ No newline at end of file diff --git a/demo/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux b/demo/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux new file mode 120000 index 000000000..f9f3220b6 --- /dev/null +++ b/demo/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux @@ -0,0 +1 @@ +C:/Users/DOONF/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_linux-2.2.1/ \ No newline at end of file diff --git a/demo/linux/flutter/ephemeral/.plugin_symlinks/printing b/demo/linux/flutter/ephemeral/.plugin_symlinks/printing new file mode 120000 index 000000000..08c478a37 --- /dev/null +++ b/demo/linux/flutter/ephemeral/.plugin_symlinks/printing @@ -0,0 +1 @@ +C:/Users/DOONF/AppData/Local/Pub/Cache/hosted/pub.dev/printing-5.11.1/ \ No newline at end of file diff --git a/demo/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux b/demo/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux index e433ea04f..debad87a2 120000 --- a/demo/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux +++ b/demo/linux/flutter/ephemeral/.plugin_symlinks/url_launcher_linux @@ -1 +1 @@ -C:/Users/manek/AppData/Local/Pub/Cache/hosted/pub.dev/url_launcher_linux-3.0.2/ \ No newline at end of file +C:/Users/DOONF/AppData/Local/Pub/Cache/hosted/pub.dev/url_launcher_linux-3.1.1/ \ No newline at end of file diff --git a/demo/linux/flutter/generated_plugin_registrant.cc b/demo/linux/flutter/generated_plugin_registrant.cc index f6f23bfe9..88c7a8bd9 100644 --- a/demo/linux/flutter/generated_plugin_registrant.cc +++ b/demo/linux/flutter/generated_plugin_registrant.cc @@ -6,9 +6,17 @@ #include "generated_plugin_registrant.h" +#include +#include #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) file_saver_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FileSaverPlugin"); + file_saver_plugin_register_with_registrar(file_saver_registrar); + g_autoptr(FlPluginRegistrar) printing_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "PrintingPlugin"); + printing_plugin_register_with_registrar(printing_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/demo/linux/flutter/generated_plugins.cmake b/demo/linux/flutter/generated_plugins.cmake index f16b4c342..561713c0b 100644 --- a/demo/linux/flutter/generated_plugins.cmake +++ b/demo/linux/flutter/generated_plugins.cmake @@ -3,6 +3,8 @@ # list(APPEND FLUTTER_PLUGIN_LIST + file_saver + printing url_launcher_linux ) diff --git a/demo/macos/Flutter/GeneratedPluginRegistrant.swift b/demo/macos/Flutter/GeneratedPluginRegistrant.swift index 8236f5728..f5e53edca 100644 --- a/demo/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/demo/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,8 +5,14 @@ import FlutterMacOS import Foundation +import file_saver +import path_provider_foundation +import printing import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FileSaverPlugin.register(with: registry.registrar(forPlugin: "FileSaverPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + PrintingPlugin.register(with: registry.registrar(forPlugin: "PrintingPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/demo/pubspec.yaml b/demo/pubspec.yaml index 1353d10e3..06ae60b00 100644 --- a/demo/pubspec.yaml +++ b/demo/pubspec.yaml @@ -1,86 +1,88 @@ -name: demo -description: PlutoGrid demo app. - -# The following line prevents the package from being accidentally published to -# pub.dev using `pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 - -environment: - sdk: ">=2.17.0 <3.0.0" - -dependencies: - flutter: - sdk: flutter - pluto_grid: - path: ../ - faker: ^2.0.0 - url_launcher: ^6.1.6 - font_awesome_flutter: ^10.2.1 - rainbow_color: ^2.0.1 - pluto_menu_bar: ^2.0.1 - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.4 - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^2.0.1 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - assets: - - assets/images/ - - fonts: - - family: OpenSans - fonts: - - asset: assets/fonts/open_sans/OpenSans-ExtraBold.ttf - weight: 800 - - asset: assets/fonts/open_sans/OpenSans-ExtraBoldItalic.ttf - weight: 800 - style: italic - - asset: assets/fonts/open_sans/OpenSans-Bold.ttf - weight: 700 - - asset: assets/fonts/open_sans/OpenSans-BoldItalic.ttf - weight: 700 - style: italic - - asset: assets/fonts/open_sans/OpenSans-SemiBold.ttf - weight: 600 - - asset: assets/fonts/open_sans/OpenSans-SemiBoldItalic.ttf - weight: 600 - style: italic - - asset: assets/fonts/open_sans/OpenSans-Regular.ttf - weight: 400 - - asset: assets/fonts/open_sans/OpenSans-Italic.ttf - weight: 400 - style: italic - - asset: assets/fonts/open_sans/OpenSans-Light.ttf - weight: 300 - - asset: assets/fonts/open_sans/OpenSans-LightItalic.ttf - weight: 300 - style: italic - +name: demo +description: PlutoGrid demo app. + +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ^3.0.0 + +dependency_overrides: + pluto_grid_plus: + path: ../ + +dependencies: + flutter: + sdk: flutter + pluto_grid_plus: 8.4.3 + faker: ^2.1.0 + url_launcher: ^6.2.1 + font_awesome_flutter: ^10.6.0 + rainbow_color: ^2.0.1 + pluto_menu_bar: ^3.0.1 + file_saver: ^0.2.10 + pluto_grid_plus_export: 1.0.5 + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.6 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + - assets/images/ + + fonts: + - family: OpenSans + fonts: + - asset: assets/fonts/open_sans/OpenSans-ExtraBold.ttf + weight: 800 + - asset: assets/fonts/open_sans/OpenSans-ExtraBoldItalic.ttf + weight: 800 + style: italic + - asset: assets/fonts/open_sans/OpenSans-Bold.ttf + weight: 700 + - asset: assets/fonts/open_sans/OpenSans-BoldItalic.ttf + weight: 700 + style: italic + - asset: assets/fonts/open_sans/OpenSans-SemiBold.ttf + weight: 600 + - asset: assets/fonts/open_sans/OpenSans-SemiBoldItalic.ttf + weight: 600 + style: italic + - asset: assets/fonts/open_sans/OpenSans-Regular.ttf + weight: 400 + - asset: assets/fonts/open_sans/OpenSans-Italic.ttf + weight: 400 + style: italic + - asset: assets/fonts/open_sans/OpenSans-Light.ttf + weight: 300 + - asset: assets/fonts/open_sans/OpenSans-LightItalic.ttf + weight: 300 + style: italic diff --git a/demo/windows/flutter/CMakeLists.txt b/demo/windows/flutter/CMakeLists.txt index 744f08a93..0a9177722 100644 --- a/demo/windows/flutter/CMakeLists.txt +++ b/demo/windows/flutter/CMakeLists.txt @@ -9,6 +9,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake) # https://github.com/flutter/flutter/issues/57146. set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + # === Flutter Library === set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") @@ -90,7 +95,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" - windows-x64 $ + ${FLUTTER_TARGET_PLATFORM} $ VERBATIM ) add_custom_target(flutter_assemble DEPENDS diff --git a/demo/windows/flutter/generated_plugin_registrant.cc b/demo/windows/flutter/generated_plugin_registrant.cc index 4f7884874..5c30b255d 100644 --- a/demo/windows/flutter/generated_plugin_registrant.cc +++ b/demo/windows/flutter/generated_plugin_registrant.cc @@ -6,9 +6,15 @@ #include "generated_plugin_registrant.h" +#include +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + FileSaverPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FileSaverPlugin")); + PrintingPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("PrintingPlugin")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/demo/windows/flutter/generated_plugins.cmake b/demo/windows/flutter/generated_plugins.cmake index 88b22e5c7..de50ed854 100644 --- a/demo/windows/flutter/generated_plugins.cmake +++ b/demo/windows/flutter/generated_plugins.cmake @@ -3,6 +3,8 @@ # list(APPEND FLUTTER_PLUGIN_LIST + file_saver + printing url_launcher_windows ) diff --git a/example/android/build.gradle b/example/android/build.gradle index 24047dce5..7af76c2ae 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index bc6a58afd..cfe88f690 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/example/lib/main.dart b/example/lib/main.dart index 260b5266f..dad9d280d 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -24,7 +24,7 @@ class MyApp extends StatelessWidget { // /// For more examples, go to the demo web link on the github below. class PlutoGridExamplePage extends StatefulWidget { - const PlutoGridExamplePage({Key? key}) : super(key: key); + const PlutoGridExamplePage({super.key}); @override State createState() => _PlutoGridExamplePageState(); @@ -56,6 +56,24 @@ class _PlutoGridExamplePageState extends State { 'Owner', ]), ), + PlutoColumn( + title: 'Role 2', + field: 'role2', + type: PlutoColumnType.select( + [ + 'Programmer', + 'Designer', + 'Owner', + ], + builder: (item) { + return Row(children: [ + Icon(item == 'Programmer' ? Icons.code : Icons.design_services), + const SizedBox(width: 8), + Text(item), + ]); + }, + ), + ), PlutoColumn( title: 'Joined', field: 'joined', @@ -99,6 +117,7 @@ class _PlutoGridExamplePageState extends State { 'name': PlutoCell(value: 'Mike'), 'age': PlutoCell(value: 20), 'role': PlutoCell(value: 'Programmer'), + 'role2': PlutoCell(value: 'Programmer'), 'joined': PlutoCell(value: '2021-01-01'), 'working_time': PlutoCell(value: '09:00'), 'salary': PlutoCell(value: 300), @@ -110,6 +129,7 @@ class _PlutoGridExamplePageState extends State { 'name': PlutoCell(value: 'Jack'), 'age': PlutoCell(value: 25), 'role': PlutoCell(value: 'Designer'), + 'role2': PlutoCell(value: 'Designer'), 'joined': PlutoCell(value: '2021-02-01'), 'working_time': PlutoCell(value: '10:00'), 'salary': PlutoCell(value: 400), @@ -121,6 +141,7 @@ class _PlutoGridExamplePageState extends State { 'name': PlutoCell(value: 'Suzi'), 'age': PlutoCell(value: 40), 'role': PlutoCell(value: 'Owner'), + 'role2': PlutoCell(value: 'Owner'), 'joined': PlutoCell(value: '2021-03-01'), 'working_time': PlutoCell(value: '11:00'), 'salary': PlutoCell(value: 700), @@ -134,7 +155,8 @@ class _PlutoGridExamplePageState extends State { PlutoColumnGroup(title: 'User information', fields: ['name', 'age']), PlutoColumnGroup(title: 'Status', children: [ PlutoColumnGroup(title: 'A', fields: ['role'], expandedColumn: true), - PlutoColumnGroup(title: 'Etc.', fields: ['joined', 'working_time']), + PlutoColumnGroup( + title: 'Etc.', fields: ['joined', 'working_time', 'role2']), ]), ]; @@ -159,6 +181,17 @@ class _PlutoGridExamplePageState extends State { print(event); }, configuration: const PlutoGridConfiguration(), + selectDateCallback: (PlutoCell cell, PlutoColumn column) async { + return showDatePicker( + context: context, + initialDate: PlutoDateTimeHelper.parseOrNullWithFormat( + cell.value, + column.type.date.format, + ) ?? DateTime.now(), + firstDate: column.type.date.startDate ?? DateTime(0), + lastDate: column.type.date.endDate ?? DateTime(9999) + ); + } ), ), ); diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 87755ebe2..25eb25387 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ^3.0.0 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -29,13 +29,13 @@ environment: dependencies: flutter: sdk: flutter - pluto_grid: + pluto_grid_plus: path: ../ # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 + cupertino_icons: ^1.0.6 dev_dependencies: flutter_test: @@ -46,7 +46,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^1.0.0 + flutter_lints: ^5.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/example/windows/flutter/CMakeLists.txt b/example/windows/flutter/CMakeLists.txt index b2e4bd8d6..4f2af69bb 100644 --- a/example/windows/flutter/CMakeLists.txt +++ b/example/windows/flutter/CMakeLists.txt @@ -9,6 +9,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake) # https://github.com/flutter/flutter/issues/57146. set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") +# Set fallback configurations for older versions of the flutter tool. +if (NOT DEFINED FLUTTER_TARGET_PLATFORM) + set(FLUTTER_TARGET_PLATFORM "windows-x64") +endif() + # === Flutter Library === set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") @@ -91,7 +96,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" - windows-x64 $ + ${FLUTTER_TARGET_PLATFORM} $ VERBATIM ) add_custom_target(flutter_assemble DEPENDS diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 8b6d4680a..000000000 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,11 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - - -void RegisterPlugins(flutter::PluginRegistry* registry) { -} diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake deleted file mode 100644 index b93c4c30c..000000000 --- a/example/windows/flutter/generated_plugins.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/example/windows/runner/Runner.rc b/example/windows/runner/Runner.rc index 51812dcd4..e5666e022 100644 --- a/example/windows/runner/Runner.rc +++ b/example/windows/runner/Runner.rc @@ -60,14 +60,14 @@ IDI_APP_ICON ICON "resources\\app_icon.ico" // Version // -#ifdef FLUTTER_BUILD_NUMBER -#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD #else -#define VERSION_AS_NUMBER 1,0,0 +#define VERSION_AS_NUMBER 1,0,0,0 #endif -#ifdef FLUTTER_BUILD_NAME -#define VERSION_AS_STRING #FLUTTER_BUILD_NAME +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION #else #define VERSION_AS_STRING "1.0.0" #endif diff --git a/lib/pluto_grid.dart b/lib/pluto_grid_plus.dart similarity index 92% rename from lib/pluto_grid.dart rename to lib/pluto_grid_plus.dart index d177608ec..daa732cd3 100644 --- a/lib/pluto_grid.dart +++ b/lib/pluto_grid_plus.dart @@ -1,4 +1,4 @@ -library pluto_grid; +library; export './src/helper/filter_helper.dart'; export './src/helper/filtered_list.dart'; @@ -17,6 +17,7 @@ export './src/manager/event/pluto_grid_cannot_move_current_cell_event.dart'; export './src/manager/event/pluto_grid_cell_gesture_event.dart'; export './src/manager/event/pluto_grid_change_column_filter_event.dart'; export './src/manager/event/pluto_grid_change_column_sort_event.dart'; +export './src/manager/event/pluto_grid_clear_columns_filter_event.dart'; export './src/manager/event/pluto_grid_drag_rows_event.dart'; export './src/manager/event/pluto_grid_event.dart'; export './src/manager/event/pluto_grid_scroll_update_event.dart'; @@ -43,6 +44,9 @@ export './src/pluto_grid.dart'; export './src/pluto_grid_configuration.dart'; export './src/pluto_grid_date_picker.dart'; export './src/pluto_grid_popup.dart'; +export './src/pluto_grid_settings.dart'; +export './src/pluto_grid_enums.dart'; +export './src/pluto_grid_events.dart'; export './src/widgets/pluto_linked_scroll_controller.dart'; export './src/widgets/pluto_loading.dart'; export './src/widgets/pluto_scaled_checkbox.dart'; diff --git a/lib/src/helper/filter_helper.dart b/lib/src/helper/filter_helper.dart index 9a47632ba..672c5fcc4 100644 --- a/lib/src/helper/filter_helper.dart +++ b/lib/src/helper/filter_helper.dart @@ -1,7 +1,7 @@ import 'package:collection/collection.dart' show IterableExtension; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; typedef SetFilterPopupHandler = void Function( PlutoGridStateManager? stateManager); @@ -504,11 +504,11 @@ class PlutoGridFilterPopupHeader extends StatelessWidget { final SetFilterPopupHandler? handleAddNewFilter; const PlutoGridFilterPopupHeader({ - Key? key, + super.key, this.stateManager, this.configuration, this.handleAddNewFilter, - }) : super(key: key); + }); void handleAddButton() { handleAddNewFilter!(stateManager); diff --git a/lib/src/helper/pluto_aggregate_helper.dart b/lib/src/helper/pluto_aggregate_helper.dart index 916f1ff39..9ecdc3f78 100644 --- a/lib/src/helper/pluto_aggregate_helper.dart +++ b/lib/src/helper/pluto_aggregate_helper.dart @@ -1,9 +1,9 @@ import 'package:collection/collection.dart' - show IterableNumberExtension, IterableExtension; -import 'package:pluto_grid/pluto_grid.dart'; + show IterableExtension, IterableNullableExtension, IterableNumberExtension; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; class PlutoAggregateHelper { - static num sum({ + static num? sum({ required Iterable rows, required PlutoColumn column, PlutoAggregateFilter? filter, @@ -19,14 +19,18 @@ class PlutoAggregateHelper { ? rows.where((row) => filter(row.cells[column.field]!)) : rows; - final Iterable numbers = foundItems.map( - (e) => e.cells[column.field]!.value, - ); + final Iterable numbers = foundItems + .map( + (e) => e.cells[column.field]?.value as num?, + ) + .whereNotNull(); - return numberColumn.toNumber(numberColumn.applyFormat(numbers.sum)); + return numbers.isNotEmpty + ? numberColumn.toNumber(numberColumn.applyFormat(numbers.sum)) + : null; } - static num average({ + static num? average({ required Iterable rows, required PlutoColumn column, PlutoAggregateFilter? filter, @@ -42,11 +46,15 @@ class PlutoAggregateHelper { ? rows.where((row) => filter(row.cells[column.field]!)) : rows; - final Iterable numbers = foundItems.map( - (e) => e.cells[column.field]!.value, - ); + final Iterable numbers = foundItems + .map( + (e) => e.cells[column.field]?.value as num?, + ) + .whereNotNull(); - return numberColumn.toNumber(numberColumn.applyFormat(numbers.average)); + return numbers.isNotEmpty + ? numberColumn.toNumber(numberColumn.applyFormat(numbers.average)) + : null; } static num? min({ diff --git a/lib/src/helper/pluto_column_group_helper.dart b/lib/src/helper/pluto_column_group_helper.dart index 96aed7129..62ef977b0 100644 --- a/lib/src/helper/pluto_column_group_helper.dart +++ b/lib/src/helper/pluto_column_group_helper.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Helper class for handling [PlutoColumnGroup]. class PlutoColumnGroupHelper { diff --git a/lib/src/helper/pluto_double_tap_detector.dart b/lib/src/helper/pluto_double_tap_detector.dart new file mode 100644 index 000000000..a4789e15a --- /dev/null +++ b/lib/src/helper/pluto_double_tap_detector.dart @@ -0,0 +1,24 @@ +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; + +class PlutoDoubleTapDetector { + static PlutoCell? _prevTappedCell; + static int _lastTap = DateTime.now().millisecondsSinceEpoch; + static int _consecutiveTaps = 1; + + static bool isDoubleTap(PlutoCell cell) { + int now = DateTime.now().millisecondsSinceEpoch; + bool doubleTap = false; + if (now - _lastTap < 300) { + _consecutiveTaps++; + if (_consecutiveTaps >= 2 && _prevTappedCell == cell) { + doubleTap = true; + } + } else { + _consecutiveTaps = 1; + doubleTap = false; + } + _lastTap = now; + _prevTappedCell = cell; + return doubleTap; + } +} diff --git a/lib/src/helper/pluto_key_manager_event.dart b/lib/src/helper/pluto_key_manager_event.dart index 91267675c..855c39e17 100644 --- a/lib/src/helper/pluto_key_manager_event.dart +++ b/lib/src/helper/pluto_key_manager_event.dart @@ -1,210 +1,241 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; - -class PlutoKeyManagerEvent { - FocusNode focusNode; - RawKeyEvent event; - - PlutoKeyManagerEvent({ - required this.focusNode, - required this.event, - }); - - bool get needsThrottle => isMoving || isTab || isPageUp || isPageDown; - - bool get isKeyDownEvent => event.runtimeType == RawKeyDownEvent; - - bool get isKeyUpEvent => event.runtimeType == RawKeyUpEvent; - - bool get isMoving => isHorizontal || isVertical; - - bool get isHorizontal => isLeft || isRight; - - bool get isVertical => isUp || isDown; - - bool get isLeft => - event.logicalKey.keyId == LogicalKeyboardKey.arrowLeft.keyId; - - bool get isRight => - event.logicalKey.keyId == LogicalKeyboardKey.arrowRight.keyId; - - bool get isUp => event.logicalKey.keyId == LogicalKeyboardKey.arrowUp.keyId; - - bool get isDown => - event.logicalKey.keyId == LogicalKeyboardKey.arrowDown.keyId; - - bool get isHome => event.logicalKey.keyId == LogicalKeyboardKey.home.keyId; - - bool get isEnd => event.logicalKey.keyId == LogicalKeyboardKey.end.keyId; - - bool get isPageUp { - // windows 에서 pageUp keyId 가 0x10700000021. - return event.logicalKey.keyId == LogicalKeyboardKey.pageUp.keyId || - event.logicalKey.keyId == 0x10700000021; - } - - bool get isPageDown { - // windows 에서 pageDown keyId 가 0x10700000022. - return event.logicalKey.keyId == LogicalKeyboardKey.pageDown.keyId || - event.logicalKey.keyId == 0x10700000022; - } - - bool get isEsc => event.logicalKey.keyId == LogicalKeyboardKey.escape.keyId; - - bool get isEnter => - event.logicalKey.keyId == LogicalKeyboardKey.enter.keyId || - event.logicalKey.keyId == LogicalKeyboardKey.numpadEnter.keyId; - - bool get isTab => event.logicalKey.keyId == LogicalKeyboardKey.tab.keyId; - - bool get isF2 => event.logicalKey.keyId == LogicalKeyboardKey.f2.keyId; - - bool get isF3 => event.logicalKey.keyId == LogicalKeyboardKey.f3.keyId; - - bool get isF4 => event.logicalKey.keyId == LogicalKeyboardKey.f4.keyId; - - bool get isBackspace => - event.logicalKey.keyId == LogicalKeyboardKey.backspace.keyId; - - bool get isShift => - event.logicalKey.keyId == LogicalKeyboardKey.shift.keyId || - event.logicalKey.keyId == LogicalKeyboardKey.shiftLeft.keyId || - event.logicalKey.keyId == LogicalKeyboardKey.shiftRight.keyId; - - bool get isControl => - event.logicalKey.keyId == LogicalKeyboardKey.control.keyId || - event.logicalKey.keyId == LogicalKeyboardKey.controlLeft.keyId || - event.logicalKey.keyId == LogicalKeyboardKey.controlRight.keyId; - - bool get isCharacter => _characters.contains(event.logicalKey.keyId); - - bool get isCtrlC { - return isCtrlPressed && - event.logicalKey.keyId == LogicalKeyboardKey.keyC.keyId; - } - - bool get isCtrlV { - return isCtrlPressed && - event.logicalKey.keyId == LogicalKeyboardKey.keyV.keyId; - } - - bool get isCtrlA { - return isCtrlPressed && - event.logicalKey.keyId == LogicalKeyboardKey.keyA.keyId; - } - - bool get isShiftPressed { - return event.isShiftPressed; - } - - bool get isCtrlPressed { - return event.isMetaPressed || event.isControlPressed; - } - - bool get isAltPressed { - return event.isAltPressed; - } - - bool get isModifierPressed { - return isShiftPressed || isCtrlPressed || isAltPressed; - } -} - -const _characters = { - 0x0000000041, // keyA, - 0x0000000042, // keyB, - 0x0000000043, // keyC, - 0x0000000044, // keyD, - 0x0000000045, // keyE, - 0x0000000046, // keyF, - 0x0000000047, // keyG, - 0x0000000048, // keyH, - 0x0000000049, // keyI, - 0x000000004a, // keyJ, - 0x000000004b, // keyK, - 0x000000004c, // keyL, - 0x000000004d, // keyM, - 0x000000004e, // keyN, - 0x000000004f, // keyO, - 0x0000000050, // keyP, - 0x0000000051, // keyQ, - 0x0000000052, // keyR, - 0x0000000053, // keyS, - 0x0000000054, // keyT, - 0x0000000055, // keyU, - 0x0000000056, // keyV, - 0x0000000057, // keyW, - 0x0000000058, // keyX, - 0x0000000059, // keyY, - 0x000000005a, // keyZ, - 0x0000000061, // keyA, - 0x0000000062, // keyB, - 0x0000000063, // keyC, - 0x0000000064, // keyD, - 0x0000000065, // keyE, - 0x0000000066, // keyF, - 0x0000000067, // keyG, - 0x0000000068, // keyH, - 0x0000000069, // keyI, - 0x000000006a, // keyJ, - 0x000000006b, // keyK, - 0x000000006c, // keyL, - 0x000000006d, // keyM, - 0x000000006e, // keyN, - 0x000000006f, // keyO, - 0x0000000070, // keyP, - 0x0000000071, // keyQ, - 0x0000000072, // keyR, - 0x0000000073, // keyS, - 0x0000000074, // keyT, - 0x0000000075, // keyU, - 0x0000000076, // keyV, - 0x0000000077, // keyW, - 0x0000000078, // keyX, - 0x0000000079, // keyY, - 0x000000007a, // keyZ, - 0x0000000031, // digit1, - 0x0000000032, // digit2, - 0x0000000033, // digit3, - 0x0000000034, // digit4, - 0x0000000035, // digit5, - 0x0000000036, // digit6, - 0x0000000037, // digit7, - 0x0000000038, // digit8, - 0x0000000039, // digit9, - 0x0000000030, // digit0, - 0x0000000020, // space, - 0x000000002d, // minus, - 0x000000003d, // equal, - 0x000000005b, // bracketLeft, - 0x000000005d, // bracketRight, - 0x000000005c, // backslash, - 0x000000003b, // semicolon, - 0x0000000027, // quote, - 0x0000000060, // backquote, - 0x000000002c, // comma, - 0x000000002e, // period, - 0x000000002f, // slash, - 0x0100070054, // numpadDivide, - 0x0100070055, // numpadMultiply, - 0x0100070056, // numpadSubtract, - 0x0100070057, // numpadAdd, - 0x0100070059, // numpad1, - 0x010007005a, // numpad2, - 0x010007005b, // numpad3, - 0x010007005c, // numpad4, - 0x010007005d, // numpad5, - 0x010007005e, // numpad6, - 0x010007005f, // numpad7, - 0x0100070060, // numpad8, - 0x0100070061, // numpad9, - 0x0100070062, // numpad0, - 0x0100070063, // numpadDecimal, - 0x0100070064, // intlBackslash, - 0x0100070067, // numpadEqual, - 0x0100070085, // numpadComma, - 0x0100070087, // intlRo, - 0x0100070089, // intlYen, - 0x01000700b6, // numpadParenLeft, - 0x01000700b7, // numpadParenRight, -}; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class PlutoKeyManagerEvent { + FocusNode focusNode; + KeyEvent event; + bool Function(LogicalKeyboardKey key)? isLogicalKeyPressed; + + PlutoKeyManagerEvent({ + required this.focusNode, + required this.event, + this.isLogicalKeyPressed, + }); + + bool get needsThrottle => isMoving || isTab || isPageUp || isPageDown; + + bool get isKeyDownEvent => event.runtimeType == KeyDownEvent; + + bool get isKeyUpEvent => event.runtimeType == KeyUpEvent; + + bool get isMoving => isHorizontal || isVertical; + + bool get isHorizontal => isLeft || isRight; + + bool get isVertical => isUp || isDown; + + bool get isLeft => + event.logicalKey.keyId == LogicalKeyboardKey.arrowLeft.keyId; + + bool get isRight => + event.logicalKey.keyId == LogicalKeyboardKey.arrowRight.keyId; + + bool get isUp => event.logicalKey.keyId == LogicalKeyboardKey.arrowUp.keyId; + + bool get isDown => + event.logicalKey.keyId == LogicalKeyboardKey.arrowDown.keyId; + + bool get isHome => event.logicalKey.keyId == LogicalKeyboardKey.home.keyId; + + bool get isEnd => event.logicalKey.keyId == LogicalKeyboardKey.end.keyId; + + bool get isPageUp { + // windows 에서 pageUp keyId 가 0x10700000021. + return event.logicalKey.keyId == LogicalKeyboardKey.pageUp.keyId || + event.logicalKey.keyId == 0x10700000021; + } + + bool get isPageDown { + // windows 에서 pageDown keyId 가 0x10700000022. + return event.logicalKey.keyId == LogicalKeyboardKey.pageDown.keyId || + event.logicalKey.keyId == 0x10700000022; + } + + bool get isEsc => event.logicalKey.keyId == LogicalKeyboardKey.escape.keyId; + + bool get isEnter => + event.logicalKey.keyId == LogicalKeyboardKey.enter.keyId || + event.logicalKey.keyId == LogicalKeyboardKey.numpadEnter.keyId; + + bool get isTab => event.logicalKey.keyId == LogicalKeyboardKey.tab.keyId; + + bool get isF2 => event.logicalKey.keyId == LogicalKeyboardKey.f2.keyId; + + bool get isF3 => event.logicalKey.keyId == LogicalKeyboardKey.f3.keyId; + + bool get isF4 => event.logicalKey.keyId == LogicalKeyboardKey.f4.keyId; + + bool get isBackspace => + event.logicalKey.keyId == LogicalKeyboardKey.backspace.keyId; + + /// This can be: + /// + /// LogicalKeyboardKey.shift + /// LogicalKeyboardKey.shiftLeft + /// LogicalKeyboardKey.shiftRight + bool get isShift => [ + LogicalKeyboardKey.shift, + LogicalKeyboardKey.shiftLeft, + LogicalKeyboardKey.shiftRight, + ].any((lKey) => lKey.keyId == event.logicalKey.keyId); + + bool get isLeftShift => [ + LogicalKeyboardKey.shiftLeft, + ].any((lKey) => lKey.keyId == event.logicalKey.keyId); + + bool get isRightShift => [ + LogicalKeyboardKey.shiftRight, + ].any((lKey) => lKey.keyId == event.logicalKey.keyId); + + /// This can be: + /// + /// LogicalKeyboardKey.control + /// LogicalKeyboardKey.controlLeft + /// LogicalKeyboardKey.controlRight + bool get isControl => [ + LogicalKeyboardKey.control, + LogicalKeyboardKey.controlLeft, + LogicalKeyboardKey.controlRight, + ].any((lKey) => lKey.keyId == event.logicalKey.keyId); + + bool get isLeftControl => [ + LogicalKeyboardKey.controlLeft, + ].any((lKey) => lKey.keyId == event.logicalKey.keyId); + + bool get isRightControl => [ + LogicalKeyboardKey.controlRight, + ].any((lKey) => lKey.keyId == event.logicalKey.keyId); + + bool get isCharacter => _characters.contains(event.logicalKey.keyId); + + bool get isCtrlC { + return isCtrlPressed && + event.logicalKey.keyId == LogicalKeyboardKey.keyC.keyId; + } + + bool get isCtrlV { + return isCtrlPressed && + event.logicalKey.keyId == LogicalKeyboardKey.keyV.keyId; + } + + bool get isCtrlA { + return isCtrlPressed && + event.logicalKey.keyId == LogicalKeyboardKey.keyA.keyId; + } + + bool get isShiftPressed { + return HardwareKeyboard.instance.isShiftPressed; + } + + bool get isCtrlPressed { + return HardwareKeyboard.instance.isMetaPressed || + HardwareKeyboard.instance.isControlPressed; + } + + bool get isAltPressed { + return HardwareKeyboard.instance.isAltPressed; + } + + bool get isModifierPressed { + return isShiftPressed || isCtrlPressed || isAltPressed; + } +} + +const _characters = { + 0x0000000041, // keyA, + 0x0000000042, // keyB, + 0x0000000043, // keyC, + 0x0000000044, // keyD, + 0x0000000045, // keyE, + 0x0000000046, // keyF, + 0x0000000047, // keyG, + 0x0000000048, // keyH, + 0x0000000049, // keyI, + 0x000000004a, // keyJ, + 0x000000004b, // keyK, + 0x000000004c, // keyL, + 0x000000004d, // keyM, + 0x000000004e, // keyN, + 0x000000004f, // keyO, + 0x0000000050, // keyP, + 0x0000000051, // keyQ, + 0x0000000052, // keyR, + 0x0000000053, // keyS, + 0x0000000054, // keyT, + 0x0000000055, // keyU, + 0x0000000056, // keyV, + 0x0000000057, // keyW, + 0x0000000058, // keyX, + 0x0000000059, // keyY, + 0x000000005a, // keyZ, + 0x0000000061, // keyA, + 0x0000000062, // keyB, + 0x0000000063, // keyC, + 0x0000000064, // keyD, + 0x0000000065, // keyE, + 0x0000000066, // keyF, + 0x0000000067, // keyG, + 0x0000000068, // keyH, + 0x0000000069, // keyI, + 0x000000006a, // keyJ, + 0x000000006b, // keyK, + 0x000000006c, // keyL, + 0x000000006d, // keyM, + 0x000000006e, // keyN, + 0x000000006f, // keyO, + 0x0000000070, // keyP, + 0x0000000071, // keyQ, + 0x0000000072, // keyR, + 0x0000000073, // keyS, + 0x0000000074, // keyT, + 0x0000000075, // keyU, + 0x0000000076, // keyV, + 0x0000000077, // keyW, + 0x0000000078, // keyX, + 0x0000000079, // keyY, + 0x000000007a, // keyZ, + 0x0000000031, // digit1, + 0x0000000032, // digit2, + 0x0000000033, // digit3, + 0x0000000034, // digit4, + 0x0000000035, // digit5, + 0x0000000036, // digit6, + 0x0000000037, // digit7, + 0x0000000038, // digit8, + 0x0000000039, // digit9, + 0x0000000030, // digit0, + 0x0000000020, // space, + 0x000000002d, // minus, + 0x000000003d, // equal, + 0x000000005b, // bracketLeft, + 0x000000005d, // bracketRight, + 0x000000005c, // backslash, + 0x000000003b, // semicolon, + 0x0000000027, // quote, + 0x0000000060, // backquote, + 0x000000002c, // comma, + 0x000000002e, // period, + 0x000000002f, // slash, + 0x0100070054, // numpadDivide, + 0x0100070055, // numpadMultiply, + 0x0100070056, // numpadSubtract, + 0x0100070057, // numpadAdd, + 0x0100070059, // numpad1, + 0x010007005a, // numpad2, + 0x010007005b, // numpad3, + 0x010007005c, // numpad4, + 0x010007005d, // numpad5, + 0x010007005e, // numpad6, + 0x010007005f, // numpad7, + 0x0100070060, // numpad8, + 0x0100070061, // numpad9, + 0x0100070062, // numpad0, + 0x0100070063, // numpadDecimal, + 0x0100070064, // intlBackslash, + 0x0100070067, // numpadEqual, + 0x0100070085, // numpadComma, + 0x0100070087, // intlRo, + 0x0100070089, // intlYen, + 0x01000700b6, // numpadParenLeft, + 0x01000700b7, // numpadParenRight, +}; diff --git a/lib/src/helper/pluto_row_group_delegate.dart b/lib/src/helper/pluto_row_group_delegate.dart index d7cb67981..627514fe3 100644 --- a/lib/src/helper/pluto_row_group_delegate.dart +++ b/lib/src/helper/pluto_row_group_delegate.dart @@ -1,7 +1,7 @@ import 'package:collection/collection.dart'; import 'package:flutter/foundation.dart'; import 'package:intl/intl.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// {@template pluto_row_group_delegate_type} /// Determines the grouping type of the row. diff --git a/lib/src/helper/pluto_row_group_helper.dart b/lib/src/helper/pluto_row_group_helper.dart index fb70069b8..b23dc728e 100644 --- a/lib/src/helper/pluto_row_group_helper.dart +++ b/lib/src/helper/pluto_row_group_helper.dart @@ -1,5 +1,5 @@ import 'package:collection/collection.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Helper class for grouping rows. class PlutoRowGroupHelper { diff --git a/lib/src/helper/show_column_menu.dart b/lib/src/helper/show_column_menu.dart index 878eab54c..585a65f16 100644 --- a/lib/src/helper/show_column_menu.dart +++ b/lib/src/helper/show_column_menu.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class PlutoColumnMenuDelegate { List> buildMenuItems({ diff --git a/lib/src/manager/event/pluto_grid_cannot_move_current_cell_event.dart b/lib/src/manager/event/pluto_grid_cannot_move_current_cell_event.dart index 315130990..583ed0efe 100644 --- a/lib/src/manager/event/pluto_grid_cannot_move_current_cell_event.dart +++ b/lib/src/manager/event/pluto_grid_cannot_move_current_cell_event.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Occurs when the keyboard hits the end of the grid. class PlutoGridCannotMoveCurrentCellEvent extends PlutoGridEvent { diff --git a/lib/src/manager/event/pluto_grid_cell_gesture_event.dart b/lib/src/manager/event/pluto_grid_cell_gesture_event.dart index 8714d59a4..10b23f1f1 100644 --- a/lib/src/manager/event/pluto_grid_cell_gesture_event.dart +++ b/lib/src/manager/event/pluto_grid_cell_gesture_event.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// [PlutoCell] This event handles the gesture of the widget. class PlutoGridCellGestureEvent extends PlutoGridEvent { diff --git a/lib/src/manager/event/pluto_grid_change_column_filter_event.dart b/lib/src/manager/event/pluto_grid_change_column_filter_event.dart index 3a2722dfc..432f92b0e 100644 --- a/lib/src/manager/event/pluto_grid_change_column_filter_event.dart +++ b/lib/src/manager/event/pluto_grid_change_column_filter_event.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Event called when the value of the TextField /// that handles the filter under the column changes. @@ -7,21 +7,19 @@ class PlutoGridChangeColumnFilterEvent extends PlutoGridEvent { final PlutoFilterType filterType; final String filterValue; final int? debounceMilliseconds; + final PlutoGridEventType? eventType; PlutoGridChangeColumnFilterEvent({ required this.column, required this.filterType, required this.filterValue, this.debounceMilliseconds, + this.eventType, }) : super( - type: PlutoGridEventType.debounce, + type: eventType ?? PlutoGridEventType.normal, duration: Duration( - milliseconds: debounceMilliseconds == null - ? PlutoGridSettings.debounceMillisecondsForColumnFilter - : debounceMilliseconds < 0 - ? 0 - : debounceMilliseconds, - ), + milliseconds: debounceMilliseconds?.abs() ?? + PlutoGridSettings.debounceMillisecondsForColumnFilter), ); List _getFilterRows(PlutoGridStateManager? stateManager) { diff --git a/lib/src/manager/event/pluto_grid_change_column_sort_event.dart b/lib/src/manager/event/pluto_grid_change_column_sort_event.dart index 45b88d62c..dfb4fd7c9 100644 --- a/lib/src/manager/event/pluto_grid_change_column_sort_event.dart +++ b/lib/src/manager/event/pluto_grid_change_column_sort_event.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Event issued when the sort state of a column is changed. class PlutoGridChangeColumnSortEvent extends PlutoGridEvent { diff --git a/lib/src/manager/event/pluto_grid_clear_columns_filter_event.dart b/lib/src/manager/event/pluto_grid_clear_columns_filter_event.dart new file mode 100644 index 000000000..c873b7e9f --- /dev/null +++ b/lib/src/manager/event/pluto_grid_clear_columns_filter_event.dart @@ -0,0 +1,24 @@ +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; + +/// Event to clear the provided columns there filter +class PlutoGridClearColumnsFilterEvent extends PlutoGridEvent { + final Iterable? columns; + final int? debounceMilliseconds; + final PlutoGridEventType? eventType; + + PlutoGridClearColumnsFilterEvent({ + this.columns, + this.debounceMilliseconds, + this.eventType, + }) : super( + type: eventType ?? PlutoGridEventType.normal, + duration: Duration( + milliseconds: debounceMilliseconds?.abs() ?? + PlutoGridSettings.debounceMillisecondsForColumnFilter), + ); + + @override + void handler(PlutoGridStateManager stateManager) { + stateManager.setFilterWithFilterRows([]); + } +} diff --git a/lib/src/manager/event/pluto_grid_drag_rows_event.dart b/lib/src/manager/event/pluto_grid_drag_rows_event.dart index 7971fe125..d1f8f06ea 100644 --- a/lib/src/manager/event/pluto_grid_drag_rows_event.dart +++ b/lib/src/manager/event/pluto_grid_drag_rows_event.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Event called when a row is dragged. class PlutoGridDragRowsEvent extends PlutoGridEvent { diff --git a/lib/src/manager/event/pluto_grid_event.dart b/lib/src/manager/event/pluto_grid_event.dart index 20c8d447e..1c5ab8e54 100644 --- a/lib/src/manager/event/pluto_grid_event.dart +++ b/lib/src/manager/event/pluto_grid_event.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; enum PlutoGridEventType { normal, diff --git a/lib/src/manager/event/pluto_grid_row_hover_event.dart b/lib/src/manager/event/pluto_grid_row_hover_event.dart new file mode 100644 index 000000000..4987d459f --- /dev/null +++ b/lib/src/manager/event/pluto_grid_row_hover_event.dart @@ -0,0 +1,48 @@ +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; + +/// [PlutoRow] This event handles the hover status of the widget. +class PlutoGridRowHoverEvent extends PlutoGridEvent { + final int rowIdx; + bool isHovered; + + PlutoGridRowHoverEvent({ + required this.rowIdx, + required this.isHovered, + }); + + @override + void handler(PlutoGridStateManager stateManager) { + bool enableRowHoverColor = stateManager.configuration.style.enableRowHoverColor; + + // only change current hovered row index + // if row hover color effect is enabled + if (enableRowHoverColor) { + // set the hovered row index to either the row index or null + if (isHovered == true) { + stateManager.setHoveredRowIdx(rowIdx, notify: true); + } else { + stateManager.setHoveredRowIdx(null, notify: true); + } + } + + // call the onRowEnter callback if it is not null + if (stateManager.onRowEnter != null && isHovered == true) { + stateManager.onRowEnter!( + PlutoGridOnRowEnterEvent( + row: stateManager.getRowByIdx(rowIdx), + rowIdx: rowIdx, + ), + ); + } + + // call the onRowExit callback if it is not null + if (stateManager.onRowExit != null && isHovered == false) { + stateManager.onRowExit!( + PlutoGridOnRowExitEvent( + row: stateManager.getRowByIdx(rowIdx), + rowIdx: rowIdx, + ), + ); + } + } +} diff --git a/lib/src/manager/event/pluto_grid_scroll_update_event.dart b/lib/src/manager/event/pluto_grid_scroll_update_event.dart index 142a547cb..27c6eb2b4 100644 --- a/lib/src/manager/event/pluto_grid_scroll_update_event.dart +++ b/lib/src/manager/event/pluto_grid_scroll_update_event.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; enum PlutoGridScrollUpdateDirection { all, diff --git a/lib/src/manager/event/pluto_grid_set_column_filter_event.dart b/lib/src/manager/event/pluto_grid_set_column_filter_event.dart index 80a214a7a..6d2d34961 100644 --- a/lib/src/manager/event/pluto_grid_set_column_filter_event.dart +++ b/lib/src/manager/event/pluto_grid_set_column_filter_event.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// If the value of [PlutoGridStateManager.filterOnlyEvent] is true, /// an event is issued. diff --git a/lib/src/manager/pluto_change_notifier_filter.dart b/lib/src/manager/pluto_change_notifier_filter.dart index 6a15ef96e..51ae80324 100644 --- a/lib/src/manager/pluto_change_notifier_filter.dart +++ b/lib/src/manager/pluto_change_notifier_filter.dart @@ -1,5 +1,5 @@ import 'package:flutter/cupertino.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../ui/ui.dart'; @@ -145,6 +145,10 @@ abstract class PlutoChangeNotifierFilterResolver { stateManager.clearCurrentSelecting.hashCode: 'clearCurrentSelecting', stateManager.toggleSelectingRow.hashCode: 'toggleSelectingRow', stateManager.handleAfterSelectingRow.hashCode: 'handleAfterSelectingRow', + + /// hovering_state + stateManager.setHoveredRowIdx.hashCode: 'setHoveredRowIdx', + stateManager.isRowIdxHovered.hashCode: 'isRowIdxHovered', }; } } @@ -156,29 +160,29 @@ class PlutoNotifierFilterResolverDefault @override Set resolve(PlutoGridStateManager stateManager, Type type) { switch (type) { - case PlutoGrid: + case const (PlutoGrid): return defaultGridFilter(stateManager); - case PlutoBodyColumns: - case PlutoBodyColumnsFooter: - case PlutoLeftFrozenColumns: - case PlutoLeftFrozenColumnsFooter: - case PlutoRightFrozenColumns: - case PlutoRightFrozenColumnsFooter: + case const (PlutoBodyColumns): + case const (PlutoBodyColumnsFooter): + case const (PlutoLeftFrozenColumns): + case const (PlutoLeftFrozenColumnsFooter): + case const (PlutoRightFrozenColumns): + case const (PlutoRightFrozenColumnsFooter): return defaultColumnsFilter(stateManager); - case PlutoBodyRows: - case PlutoLeftFrozenRows: - case PlutoRightFrozenRows: + case const (PlutoBodyRows): + case const (PlutoLeftFrozenRows): + case const (PlutoRightFrozenRows): return defaultRowsFilter(stateManager); - case PlutoNoRowsWidget: + case const (PlutoNoRowsWidget): return { ...defaultRowsFilter(stateManager), stateManager.setShowLoading.hashCode, }; - case PlutoAggregateColumnFooter: + case const (PlutoAggregateColumnFooter): return defaultAggregateColumnFooterFilter(stateManager); - case CheckboxSelectionWidget: + case const (CheckboxSelectionWidget): return defaultCheckboxFilter(stateManager); - case CheckboxAllSelectionWidget: + case const (CheckboxAllSelectionWidget): return defaultCheckboxAllFilter(stateManager); } diff --git a/lib/src/manager/pluto_grid_event_manager.dart b/lib/src/manager/pluto_grid_event_manager.dart index f448fd7a5..7cf74b013 100644 --- a/lib/src/manager/pluto_grid_event_manager.dart +++ b/lib/src/manager/pluto_grid_event_manager.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'package:rxdart/rxdart.dart'; class PlutoGridEventManager { @@ -32,7 +32,7 @@ class PlutoGridEventManager { .where((event) => event.type.isThrottleLeading) .transform( ThrottleStreamTransformer( - (_) => TimerStream(_, _.duration as Duration), + (e) => TimerStream(e, e.duration as Duration), trailing: false, leading: true, ), @@ -42,7 +42,7 @@ class PlutoGridEventManager { .where((event) => event.type.isThrottleTrailing) .transform( ThrottleStreamTransformer( - (_) => TimerStream(_, _.duration as Duration), + (e) => TimerStream(e, e.duration as Duration), trailing: true, leading: false, ), @@ -51,7 +51,7 @@ class PlutoGridEventManager { final debounceStream = _subject.stream.where((event) => event.type.isDebounce).transform( DebounceStreamTransformer( - (_) => TimerStream(_, _.duration as Duration), + (e) => TimerStream(e, e.duration as Duration), ), ); diff --git a/lib/src/manager/pluto_grid_key_manager.dart b/lib/src/manager/pluto_grid_key_manager.dart index ba952c790..5d0dfb6ef 100644 --- a/lib/src/manager/pluto_grid_key_manager.dart +++ b/lib/src/manager/pluto_grid_key_manager.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'package:rxdart/rxdart.dart'; /// 2021-11-19 @@ -10,7 +10,7 @@ import 'package:rxdart/rxdart.dart'; /// 이슈 해결 후 : 삭제 /// /// desktop 에서만 발생 -/// skipRemainingHandlers 을 리턴하면 pluto_grid.dart 의 FocusScope 의 +/// skipRemainingHandlers 을 리턴하면 pluto_grid_plus.dart 의 FocusScope 의 /// 콜백이 호출 되지 않고 TextField 에 키 입력이 되어야 하는데 /// 방향키, 백스페이스 등이 입력되지 않음.(문자등은 입력 됨) /// https://github.com/flutter/flutter/issues/93873 @@ -66,7 +66,8 @@ class PlutoGridKeyManager { final movingStream = _subject.stream.where((event) => event.needsThrottle).transform( ThrottleStreamTransformer( - (_) => TimerStream(_, const Duration(milliseconds: 1)), + // ignore: void_checks + (e) => TimerStream(e, const Duration(milliseconds: 1)), ), ); @@ -79,7 +80,7 @@ class PlutoGridKeyManager { if (stateManager.configuration.shortcut.handle( keyEvent: keyEvent, stateManager: stateManager, - state: RawKeyboard.instance, + state: HardwareKeyboard.instance, )) { return; } diff --git a/lib/src/manager/pluto_grid_state_manager.dart b/lib/src/manager/pluto_grid_state_manager.dart index 5e0a6f031..b977d151a 100644 --- a/lib/src/manager/pluto_grid_state_manager.dart +++ b/lib/src/manager/pluto_grid_state_manager.dart @@ -4,7 +4,7 @@ import 'dart:collection'; import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'state/cell_state.dart'; import 'state/column_group_state.dart'; @@ -23,6 +23,7 @@ import 'state/row_state.dart'; import 'state/scroll_state.dart'; import 'state/selecting_state.dart'; import 'state/visibility_layout_state.dart'; +import 'state/hovering_state.dart'; abstract class IPlutoGridState implements @@ -43,7 +44,8 @@ abstract class IPlutoGridState IRowState, IScrollState, ISelectingState, - IVisibilityLayoutState {} + IVisibilityLayoutState, + IHoveringState {} class PlutoGridStateChangeNotifier extends PlutoChangeNotifier with @@ -63,22 +65,29 @@ class PlutoGridStateChangeNotifier extends PlutoChangeNotifier RowState, ScrollState, SelectingState, - VisibilityLayoutState { + VisibilityLayoutState, + HoveringState { PlutoGridStateChangeNotifier({ required List columns, required List rows, required this.gridFocusNode, required this.scroll, List? columnGroups, + this.rowWrapper, + this.editCellWrapper, this.onChanged, this.onSelected, this.onSorted, this.onRowChecked, this.onRowDoubleTap, this.onRowSecondaryTap, + this.onRowEnter, + this.onRowExit, this.onRowsMoved, + this.onActiveCellChanged, this.onColumnsMoved, this.rowColorCallback, + this.selectDateCallback, this.createHeader, this.createFooter, PlutoColumnMenuDelegate? columnMenuDelegate, @@ -100,6 +109,14 @@ class PlutoGridStateChangeNotifier extends PlutoChangeNotifier _initialize(); } + /// {@macro pluto_grid_row_wrapper} + @override + final RowWrapper? rowWrapper; + + @override + final Widget Function(Widget editCellWidget, PlutoCell cell, + TextEditingController controller)? editCellWrapper; + @override final FilteredList refColumns; @@ -133,9 +150,18 @@ class PlutoGridStateChangeNotifier extends PlutoChangeNotifier @override final PlutoOnRowSecondaryTapEventCallback? onRowSecondaryTap; + @override + final PlutoOnRowEnterEventCallback? onRowEnter; + + @override + final PlutoOnRowExitEventCallback? onRowExit; + @override final PlutoOnRowsMovedEventCallback? onRowsMoved; + @override + final PlutoOnActiveCellChangedEventCallback? onActiveCellChanged; + @override final PlutoOnColumnsMovedEventCallback? onColumnsMoved; @@ -148,6 +174,9 @@ class PlutoGridStateChangeNotifier extends PlutoChangeNotifier @override final CreateFooterCallBack? createFooter; + @override + final PlutoSelectDateCallBack? selectDateCallback; + @override final PlutoColumnMenuDelegate columnMenuDelegate; @@ -205,14 +234,16 @@ class PlutoGridStateChangeNotifier extends PlutoChangeNotifier /// stateManager.refRows.addAll(FilteredList(initialList: value)); /// stateManager.notifyListeners(); /// }); -/// {@endtemplate} /// ``` +/// {@endtemplate} class PlutoGridStateManager extends PlutoGridStateChangeNotifier { PlutoGridStateManager({ required super.columns, required super.rows, required super.gridFocusNode, required super.scroll, + super.rowWrapper, + super.editCellWrapper, super.columnGroups, super.onChanged, super.onSelected, @@ -220,9 +251,13 @@ class PlutoGridStateManager extends PlutoGridStateChangeNotifier { super.onRowChecked, super.onRowDoubleTap, super.onRowSecondaryTap, + super.onRowEnter, + super.onRowExit, super.onRowsMoved, + super.onActiveCellChanged, super.onColumnsMoved, super.rowColorCallback, + super.selectDateCallback, super.createHeader, super.createFooter, super.columnMenuDelegate, diff --git a/lib/src/manager/shortcut/pluto_grid_shortcut.dart b/lib/src/manager/shortcut/pluto_grid_shortcut.dart index 57907ab4d..e926e34a2 100644 --- a/lib/src/manager/shortcut/pluto_grid_shortcut.dart +++ b/lib/src/manager/shortcut/pluto_grid_shortcut.dart @@ -1,6 +1,6 @@ import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Class for setting shortcut actions. /// @@ -27,7 +27,7 @@ class PlutoGridShortcut { bool handle({ required PlutoKeyManagerEvent keyEvent, required PlutoGridStateManager stateManager, - required RawKeyboard state, + required HardwareKeyboard state, }) { for (final action in actions.entries) { if (action.key.accepts(keyEvent.event, state)) { diff --git a/lib/src/manager/shortcut/pluto_grid_shortcut_action.dart b/lib/src/manager/shortcut/pluto_grid_shortcut_action.dart index 26110d358..e2284058a 100644 --- a/lib/src/manager/shortcut/pluto_grid_shortcut_action.dart +++ b/lib/src/manager/shortcut/pluto_grid_shortcut_action.dart @@ -1,5 +1,5 @@ import 'package:flutter/services.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Define the action by implementing the [execute] method /// as an action that can be mapped to a shortcut key. @@ -250,7 +250,7 @@ class PlutoGridActionDefaultTab extends PlutoGridShortcutAction { final saveIsEditing = stateManager.isEditing; - keyEvent.event.isShiftPressed + keyEvent.isShiftPressed ? _moveCellPrevious(stateManager) : _moveCellNext(stateManager); @@ -408,7 +408,7 @@ class PlutoGridActionDefaultEnterKey extends PlutoGridShortcutAction { } if (enterKeyAction.isEditingAndMoveDown) { - if (keyEvent.event.isShiftPressed) { + if (keyEvent.isShiftPressed) { stateManager.moveCurrentCell( PlutoMoveDirection.up, notify: false, @@ -420,7 +420,7 @@ class PlutoGridActionDefaultEnterKey extends PlutoGridShortcutAction { ); } } else if (enterKeyAction.isEditingAndMoveRight) { - if (keyEvent.event.isShiftPressed) { + if (keyEvent.isShiftPressed) { stateManager.moveCurrentCell( PlutoMoveDirection.left, force: true, @@ -658,6 +658,9 @@ class PlutoGridActionPasteValues extends PlutoGridShortcutAction { } Clipboard.getData('text/plain').then((value) { + if (value == null) { + return; + } List> textList = PlutoClipboardTransformation.stringToList(value!.text!); diff --git a/lib/src/manager/state/cell_state.dart b/lib/src/manager/state/cell_state.dart index c5ca41133..61b3426af 100644 --- a/lib/src/manager/state/cell_state.dart +++ b/lib/src/manager/state/cell_state.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class ICellState { /// currently selected cell. @@ -213,6 +213,11 @@ mixin CellState implements IPlutoGridState { setEditing(autoEditing, notify: false); notifyListeners(notify, setCurrentCell.hashCode); + + onActiveCellChanged?.call(PlutoGridOnActiveCellChangedEvent( + idx: rowIdx, + cell: _state._currentCell, + )); } @override diff --git a/lib/src/manager/state/column_group_state.dart b/lib/src/manager/state/column_group_state.dart index 8fdeb1274..8904b88a4 100644 --- a/lib/src/manager/state/column_group_state.dart +++ b/lib/src/manager/state/column_group_state.dart @@ -1,5 +1,5 @@ import 'package:flutter/cupertino.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class IColumnGroupState { List get columnGroups; diff --git a/lib/src/manager/state/column_sizing_state.dart b/lib/src/manager/state/column_sizing_state.dart index ea6d2e0cb..39df3e521 100644 --- a/lib/src/manager/state/column_sizing_state.dart +++ b/lib/src/manager/state/column_sizing_state.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Automatically adjust column width or manage width adjustment mode. abstract class IColumnSizingState { diff --git a/lib/src/manager/state/column_state.dart b/lib/src/manager/state/column_state.dart index 77109320d..525198431 100644 --- a/lib/src/manager/state/column_state.dart +++ b/lib/src/manager/state/column_state.dart @@ -1,7 +1,10 @@ import 'dart:collection'; +import 'dart:math' as math; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; + +import '../../../pluto_grid_plus.dart'; +import '../../ui/cells/pluto_default_cell.dart'; abstract class IColumnState { /// Columns provided at grid start. @@ -304,12 +307,12 @@ mixin ColumnState implements IPlutoGridState { @override PlutoColumn? get currentColumn { - return currentCell == null ? null : currentCell!.column; + return currentCell?.column; } @override String? get currentColumnField { - return currentCell == null ? null : currentCell!.column.field; + return currentCell?.column.field; } @override @@ -571,47 +574,72 @@ mixin ColumnState implements IPlutoGridState { @override void autoFitColumn(BuildContext context, PlutoColumn column) { - final String maxValue = refRows.fold('', (previousValue, element) { - final value = column.formattedValueForDisplay( - element.cells.entries - .firstWhere((element) => element.key == column.field) - .value - .value, - ); + String maxValue = ''; + bool hasExpandableRowGroup = false; + for (final row in refRows) { + final cell = row.cells.entries + .firstWhere((element) => element.key == column.field) + .value; + var value = column.formattedValueForDisplay(cell.value); + if (hasRowGroups) { + if (PlutoDefaultCell.showGroupCount(rowGroupDelegate!, cell)) { + final groupCountValue = + PlutoDefaultCell.groupCountText(rowGroupDelegate!, row); + if (groupCountValue.isNotEmpty) { + value = '$value $groupCountValue'; + } + } - if (previousValue.length < value.length) { - return value; + hasExpandableRowGroup |= + PlutoDefaultCell.canExpand(rowGroupDelegate!, cell); } - - return previousValue; - }); + if (maxValue.length < value.length) { + maxValue = value; + } + } // Get size after rendering virtually // https://stackoverflow.com/questions/54351655/flutter-textfield-width-should-match-width-of-contained-text - TextSpan textSpan = TextSpan( - style: DefaultTextStyle.of(context).style, - text: maxValue, - ); - - TextPainter textPainter = TextPainter( - text: textSpan, - textDirection: TextDirection.ltr, - ); - - textPainter.layout(); - - // todo : Apply (popup type icon, checkbox, drag indicator, renderer) + final titleTextWidth = + _visualTextWidth(column.title, style.columnTextStyle); + final maxValueTextWidth = _visualTextWidth(maxValue, style.cellTextStyle); + + // todo : Handle (renderer) width + + final calculatedTileWidth = titleTextWidth - + column.width + + [ + (column.titlePadding ?? style.defaultColumnTitlePadding).horizontal, + if (column.enableRowChecked) + _getEffectiveButtonWidth(context, checkBox: true), + if (column.isShowRightIcon) style.iconSize, + 8, + ].reduce((acc, a) => acc + a); + + final calculatedCellWidth = maxValueTextWidth - + column.width + + [ + (column.cellPadding ?? style.defaultCellPadding).horizontal, + if (hasExpandableRowGroup) _getEffectiveButtonWidth(context), + if (column.enableRowChecked) + _getEffectiveButtonWidth(context, checkBox: true), + if (column.isShowRightIcon) style.iconSize, + 2, + ].reduce((acc, a) => acc + a); - EdgeInsets cellPadding = - column.cellPadding ?? configuration.style.defaultCellPadding; + resizeColumn(column, math.max(calculatedTileWidth, calculatedCellWidth)); + } - resizeColumn( - column, - textPainter.width - - column.width + - (cellPadding.left + cellPadding.right) + - 2, - ); + double _visualTextWidth(String text, TextStyle style) { + if (text.isEmpty) return 0; + final painter = TextPainter( + text: TextSpan( + style: style, + text: text, + ), + textDirection: isRTL ? TextDirection.rtl : TextDirection.ltr, + )..layout(); + return painter.width; } @override @@ -726,15 +754,15 @@ mixin ColumnState implements IPlutoGridState { final columns = [ PlutoColumn( - title: configuration.localeText.setColumnsTitle, - field: titleField, - type: PlutoColumnType.text(), - enableRowChecked: true, - enableEditingMode: false, - enableDropToResize: true, - enableContextMenu: false, - enableColumnDrag: false, - ), + title: configuration.localeText.setColumnsTitle, + field: titleField, + type: PlutoColumnType.text(), + enableRowChecked: true, + enableEditingMode: false, + enableDropToResize: true, + enableContextMenu: false, + enableColumnDrag: false, + backgroundColor: configuration.style.filterHeaderColor), PlutoColumn( title: 'hidden column', field: columnField, @@ -1031,4 +1059,22 @@ mixin ColumnState implements IPlutoGridState { return resizeHelper.update(); } + + double _getEffectiveButtonWidth(BuildContext context, + {bool checkBox = false}) { + final theme = Theme.of(context); + late double width; + switch (theme.materialTapTargetSize) { + case MaterialTapTargetSize.padded: + width = kMinInteractiveDimension; + break; + case MaterialTapTargetSize.shrinkWrap: + width = kMinInteractiveDimension - 8.0; + break; + } + if (!checkBox) { + return width; + } + return width + theme.visualDensity.baseSizeAdjustment.dx; + } } diff --git a/lib/src/manager/state/dragging_row_state.dart b/lib/src/manager/state/dragging_row_state.dart index 0f1d9f4b5..8a27db127 100644 --- a/lib/src/manager/state/dragging_row_state.dart +++ b/lib/src/manager/state/dragging_row_state.dart @@ -1,6 +1,6 @@ import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class IDraggingRowState { bool get isDraggingRow; diff --git a/lib/src/manager/state/editing_state.dart b/lib/src/manager/state/editing_state.dart index d07fbd6f2..991ea52d8 100644 --- a/lib/src/manager/state/editing_state.dart +++ b/lib/src/manager/state/editing_state.dart @@ -1,7 +1,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class IEditingState { /// Editing status of the current. @@ -58,6 +58,9 @@ class _State { mixin EditingState implements IPlutoGridState { final _State _state = _State(); + Widget Function(Widget editCellWidget, PlutoCell cell, + TextEditingController controller)? get editCellWrapper; + @override bool get isEditing => _state._isEditing; diff --git a/lib/src/manager/state/filtering_row_state.dart b/lib/src/manager/state/filtering_row_state.dart index 1db515b4d..a064c7dfb 100644 --- a/lib/src/manager/state/filtering_row_state.dart +++ b/lib/src/manager/state/filtering_row_state.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class IFilteringRowState { List get filterRows; diff --git a/lib/src/manager/state/focus_state.dart b/lib/src/manager/state/focus_state.dart index 5e42eedb5..d0f516a67 100644 --- a/lib/src/manager/state/focus_state.dart +++ b/lib/src/manager/state/focus_state.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class IFocusState { /// FocusNode to control keyboard input. diff --git a/lib/src/manager/state/grid_state.dart b/lib/src/manager/state/grid_state.dart index aff6f729b..fc405d454 100644 --- a/lib/src/manager/state/grid_state.dart +++ b/lib/src/manager/state/grid_state.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class IGridState { GlobalKey get gridKey; @@ -24,8 +24,14 @@ abstract class IGridState { PlutoOnRowSecondaryTapEventCallback? get onRowSecondaryTap; + PlutoOnRowEnterEventCallback? get onRowEnter; + + PlutoOnRowExitEventCallback? get onRowExit; + PlutoOnRowsMovedEventCallback? get onRowsMoved; + PlutoOnActiveCellChangedEventCallback? get onActiveCellChanged; + PlutoOnColumnsMovedEventCallback? get onColumnsMoved; PlutoColumnMenuDelegate get columnMenuDelegate; @@ -34,6 +40,8 @@ abstract class IGridState { CreateFooterCallBack? get createFooter; + PlutoSelectDateCallBack? get selectDateCallback; + PlutoGridLocaleText get localeText; PlutoGridStyleConfig get style; @@ -189,6 +197,7 @@ mixin GridState implements IPlutoGridState { @override void handleOnSelected() { + _handleSelectCheckRowBehavior(); if (mode.isSelectMode == true && onSelected != null) { onSelected!( PlutoGridOnSelectedEvent( @@ -201,6 +210,52 @@ mixin GridState implements IPlutoGridState { } } + void _handleSelectCheckRowBehavior() { + final stateManager = eventManager?.stateManager; + if (currentRow == null || stateManager == null) return; + final checkedRowsViaSelect = stateManager.checkedRowsViaSelect; + switch (configuration.rowSelectionCheckBoxBehavior) { + case PlutoGridRowSelectionCheckBoxBehavior.none: + break; + case PlutoGridRowSelectionCheckBoxBehavior.checkRow: + stateManager.setRowChecked(currentRow!, true, checkedViaSelect: true); + break; + case PlutoGridRowSelectionCheckBoxBehavior.toggleCheckRow: + if (checkedRowsViaSelect.contains(currentRow)) { + stateManager.setRowChecked( + currentRow!, + (!(currentRow?.checked ?? false)), + checkedViaSelect: true, + ); + } else { + eventManager!.stateManager.setRowChecked( + currentRow!, + (!(currentRow?.checked ?? true)), + checkedViaSelect: true, + ); + } + break; + case PlutoGridRowSelectionCheckBoxBehavior.singleRowCheck: + for (var row in checkedRowsViaSelect) { + row.setChecked(false); + } + currentRow!.setChecked(true, viaSelect: true); + stateManager.notifyListeners(); + break; + case PlutoGridRowSelectionCheckBoxBehavior.toggleSingleRowCheck: + for (var row in checkedRowsViaSelect) { + row.setChecked(false); + } + if (checkedRowsViaSelect.contains(currentRow)) { + currentRow!.setChecked(false, viaSelect: false); + } else { + currentRow!.setChecked(true, viaSelect: true); + } + stateManager.notifyListeners(); + break; + } + } + @override void setSortOnlyEvent(bool flag) { _state._sortOnlyEvent = flag; diff --git a/lib/src/manager/state/hovering_state.dart b/lib/src/manager/state/hovering_state.dart new file mode 100644 index 000000000..59b30b646 --- /dev/null +++ b/lib/src/manager/state/hovering_state.dart @@ -0,0 +1,50 @@ +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; + +abstract class IHoveringState { + + int? get hoveredRowIdx; + + void setHoveredRowIdx( + int? rowIdx, + {bool notify = true} + ); + + bool isRowIdxHovered(int rowIdx); +} + +class _State { + int? _hoverRowIdx; +} + +mixin HoveringState implements IPlutoGridState { + final _State _state = _State(); + + @override + int? get hoveredRowIdx => _state._hoverRowIdx; + + @override + void setHoveredRowIdx( + int? rowIdx, + {bool notify = true,} + ) { + if (hoveredRowIdx == rowIdx) { + return; + } + + _state._hoverRowIdx = rowIdx; + + notifyListeners(notify, setHoveredRowIdx.hashCode); + } + + @override + bool isRowIdxHovered(int rowIdx) { + if (hoveredRowIdx == null) { + return false; + } + if (hoveredRowIdx == rowIdx) { + return true; + } else { + return false; + } + } +} diff --git a/lib/src/manager/state/keyboard_state.dart b/lib/src/manager/state/keyboard_state.dart index 7fda0df69..4194241b0 100644 --- a/lib/src/manager/state/keyboard_state.dart +++ b/lib/src/manager/state/keyboard_state.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class IKeyboardState { /// Currently pressed key diff --git a/lib/src/manager/state/layout_state.dart b/lib/src/manager/state/layout_state.dart index 0732270bb..339dd710a 100644 --- a/lib/src/manager/state/layout_state.dart +++ b/lib/src/manager/state/layout_state.dart @@ -1,6 +1,6 @@ import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class ILayoutState { ChangeNotifier get resizingChangeNotifier; @@ -95,6 +95,10 @@ abstract class ILayoutState { bool get isRTL; + double get gridPadding; + + double get gridBorderWidth; + /// Update screen size information when LayoutBuilder builds. void setLayout(BoxConstraints size); @@ -299,12 +303,18 @@ mixin LayoutState implements IPlutoGridState { @override double get rowTotalHeight => rowHeight + PlutoGridSettings.rowBorderWidth; + @override + double get gridPadding => configuration.style.gridPadding; + + @override + double get gridBorderWidth => configuration.style.gridBorderWidth; + @override double get bodyTopOffset => gridGlobalOffset!.dy + - PlutoGridSettings.gridPadding + + gridPadding + headerHeight + - PlutoGridSettings.gridBorderWidth + + gridBorderWidth + columnGroupHeight + columnHeight + columnFilterHeight; @@ -312,22 +322,22 @@ mixin LayoutState implements IPlutoGridState { @override double get bodyLeftOffset { return (showFrozenColumn && leftFrozenColumnsWidth > 0) - ? leftFrozenColumnsWidth + PlutoGridSettings.gridBorderWidth + ? leftFrozenColumnsWidth + gridBorderWidth : 0; } @override double get bodyRightOffset { return (showFrozenColumn && rightFrozenColumnsWidth > 0) - ? rightFrozenColumnsWidth + PlutoGridSettings.gridBorderWidth + ? rightFrozenColumnsWidth + gridBorderWidth : 0; } @override double get bodyLeftScrollOffset { return gridGlobalOffset!.dx + - PlutoGridSettings.gridPadding + - PlutoGridSettings.gridBorderWidth + + gridPadding + + gridBorderWidth + PlutoGridSettings.offsetScrollingFromEdge; } @@ -377,9 +387,9 @@ mixin LayoutState implements IPlutoGridState { if (showFrozenColumn) { offset += - leftFrozenColumnsWidth > 0 ? PlutoGridSettings.gridBorderWidth : 0; + leftFrozenColumnsWidth > 0 ? gridBorderWidth: 0; offset += - rightFrozenColumnsWidth > 0 ? PlutoGridSettings.gridBorderWidth : 0; + rightFrozenColumnsWidth > 0 ? gridBorderWidth : 0; } return offset; diff --git a/lib/src/manager/state/pagination_row_state.dart b/lib/src/manager/state/pagination_row_state.dart index 1c038128b..b057b4b3a 100644 --- a/lib/src/manager/state/pagination_row_state.dart +++ b/lib/src/manager/state/pagination_row_state.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class IPaginationRowState { int get page; diff --git a/lib/src/manager/state/row_group_state.dart b/lib/src/manager/state/row_group_state.dart index 1b9f74b76..76e0ef3b5 100644 --- a/lib/src/manager/state/row_group_state.dart +++ b/lib/src/manager/state/row_group_state.dart @@ -1,6 +1,6 @@ import 'package:collection/collection.dart'; import 'package:flutter/foundation.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /* todo diff --git a/lib/src/manager/state/row_state.dart b/lib/src/manager/state/row_state.dart index c8a8c53c9..8aeb7fa26 100644 --- a/lib/src/manager/state/row_state.dart +++ b/lib/src/manager/state/row_state.dart @@ -1,6 +1,6 @@ import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class IRowState { List get rows; @@ -24,6 +24,8 @@ abstract class IRowState { List get checkedRows; + List get checkedRowsViaSelect; + List get unCheckedRows; bool get hasCheckedRow; @@ -39,6 +41,13 @@ abstract class IRowState { /// Row of currently selected cell. PlutoRow? get currentRow; + /// {@template pluto_grid_row_wrapper} + /// + /// A wrapper that wraps arround each row. + /// + /// {@endtemplate} + RowWrapper? get rowWrapper; + PlutoRowColorCallback? get rowColorCallback; int? getRowIdxByOffset(double offset); @@ -108,6 +117,10 @@ mixin RowState implements IPlutoGridState { growable: false, ); + @override + List get checkedRowsViaSelect => + checkedRows.where((row) => row.checkedViaSelect).toList(growable: false); + @override List get unCheckedRows => refRows.where((row) => !row.checked!).toList( @@ -219,6 +232,7 @@ mixin RowState implements IPlutoGridState { PlutoRow row, bool flag, { bool notify = true, + bool checkedViaSelect = false, }) { final findRow = refRows.firstWhereOrNull( (element) => element.key == row.key, @@ -228,7 +242,7 @@ mixin RowState implements IPlutoGridState { return; } - findRow.setChecked(flag); + findRow.setChecked(flag, viaSelect: checkedViaSelect); notifyListeners(notify, setRowChecked.hashCode); } diff --git a/lib/src/manager/state/scroll_state.dart b/lib/src/manager/state/scroll_state.dart index 4f9d1d4d0..141cf4ec5 100644 --- a/lib/src/manager/state/scroll_state.dart +++ b/lib/src/manager/state/scroll_state.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class IScrollState { /// Controller to control the scrolling of the grid. diff --git a/lib/src/manager/state/selecting_state.dart b/lib/src/manager/state/selecting_state.dart index 834055bd5..dfcd95971 100644 --- a/lib/src/manager/state/selecting_state.dart +++ b/lib/src/manager/state/selecting_state.dart @@ -2,7 +2,7 @@ import 'dart:math'; import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class ISelectingState { /// Multi-selection state. @@ -289,7 +289,7 @@ mixin SelectingState implements IPlutoGridState { } final double gridBodyOffsetDy = gridGlobalOffset!.dy + - PlutoGridSettings.gridBorderWidth + + gridBorderWidth + headerHeight + columnGroupHeight + columnHeight + diff --git a/lib/src/manager/state/visibility_layout_state.dart b/lib/src/manager/state/visibility_layout_state.dart index 096973347..3c132957c 100644 --- a/lib/src/manager/state/visibility_layout_state.dart +++ b/lib/src/manager/state/visibility_layout_state.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class IVisibilityLayoutState { /// Set [PlutoColumn.startPosition] to [PlutoColumn.width]. @@ -36,11 +36,11 @@ mixin VisibilityLayoutState implements IPlutoGridState { if (showFrozenColumn) { if (hasLeftFrozenColumns) { - offset += PlutoGridSettings.gridBorderWidth; + offset += gridBorderWidth; } if (hasRightFrozenColumns) { - offset += PlutoGridSettings.gridBorderWidth; + offset += gridBorderWidth; } } diff --git a/lib/src/model/pluto_cell.dart b/lib/src/model/pluto_cell.dart index 072ef58b5..85d7896d8 100644 --- a/lib/src/model/pluto_cell.dart +++ b/lib/src/model/pluto_cell.dart @@ -1,17 +1,20 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; class PlutoCell { PlutoCell({ dynamic value, Key? key, }) : _key = key ?? UniqueKey(), - _value = value; + _value = value, + _originalValue = value; final Key _key; dynamic _value; + final dynamic _originalValue; + dynamic _valueForSorting; /// Set initial value according to [PlutoColumn] setting. @@ -52,6 +55,10 @@ class PlutoCell { return _value; } + dynamic get originalValue { + return _originalValue; + } + set value(dynamic changed) { if (_value == changed) { return; diff --git a/lib/src/model/pluto_column.dart b/lib/src/model/pluto_column.dart index 4945d6632..5dc568165 100644 --- a/lib/src/model/pluto_column.dart +++ b/lib/src/model/pluto_column.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; typedef PlutoColumnValueFormatter = String Function(dynamic value); @@ -147,6 +147,8 @@ class PlutoColumn { /// A checkbox appears in the cell of the column. bool enableRowChecked; + int rowCheckBoxGroupDepth; // + bool enableTitleChecked; /// Sort rows by tapping on the column heading. bool enableSorting; @@ -176,6 +178,27 @@ class PlutoColumn { /// Valid only when [enableContextMenu] is activated. bool enableFilterMenuItem; + ///Set hint text for filter field + String? filterHintText; + + ///Set hint text color for filter field + Color? filterHintTextColor; + + ///Set suffix icon for filter field + Icon? filterSuffixIcon; + + ///Set custom widget + @Deprecated("Use new filterWidgetBuilder to provide some parameters") + Widget? filterWidget; + + Widget Function( + FocusNode focusNode, + TextEditingController controller, + bool enabled, + void Function(String changed) handleOnChanged, + PlutoGridStateManager stateManager, + )? filterWidgetBuilder; + /// Displays Hide column menu in the column context menu. /// Valid only when [enableContextMenu] is activated. bool enableHideColumnMenuItem; @@ -192,6 +215,8 @@ class PlutoColumn { /// Hide the column. bool hide; + LinearGradient? backgroundGradient; + PlutoColumn({ required this.title, required this.field, @@ -217,15 +242,24 @@ class PlutoColumn { this.enableColumnDrag = true, this.enableRowDrag = false, this.enableRowChecked = false, + this.rowCheckBoxGroupDepth = 0, + this.enableTitleChecked = true, this.enableSorting = true, this.enableContextMenu = true, this.enableDropToResize = true, this.enableFilterMenuItem = true, + this.filterHintText, + this.filterHintTextColor, + this.filterSuffixIcon, + @Deprecated("Use new filterWidgetBuilder to provide some parameters") + this.filterWidget, this.enableHideColumnMenuItem = true, this.enableSetColumnsMenuItem = true, this.enableAutoEditing = false, this.enableEditingMode = true, this.hide = false, + this.backgroundGradient, + this.filterWidgetBuilder, }) : _key = UniqueKey(), _checkReadOnly = checkReadOnly; diff --git a/lib/src/model/pluto_column_group.dart b/lib/src/model/pluto_column_group.dart index 0f200f4c1..24bbbf70f 100644 --- a/lib/src/model/pluto_column_group.dart +++ b/lib/src/model/pluto_column_group.dart @@ -1,5 +1,5 @@ import 'package:flutter/cupertino.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; class PlutoColumnGroup { final String title; diff --git a/lib/src/model/pluto_column_type.dart b/lib/src/model/pluto_column_type.dart index 12203c48b..01cb713cf 100644 --- a/lib/src/model/pluto_column_type.dart +++ b/lib/src/model/pluto_column_type.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart' as intl; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class PlutoColumnType { dynamic get defaultValue; @@ -93,16 +94,21 @@ abstract class PlutoColumnType { /// The default icon is displayed, and if this value is set to null , the icon does not appear. factory PlutoColumnType.select( List items, { + final Function(PlutoGridOnSelectedEvent event)? onItemSelected, dynamic defaultValue = '', bool enableColumnFilter = false, IconData? popupIcon = Icons.arrow_drop_down, + Widget Function(dynamic item)? builder, + double? width, }) { return PlutoColumnTypeSelect( - defaultValue: defaultValue, - items: items, - enableColumnFilter: enableColumnFilter, - popupIcon: popupIcon, - ); + onItemSelected: onItemSelected ?? (event) {}, + defaultValue: defaultValue, + items: items, + enableColumnFilter: enableColumnFilter, + popupIcon: popupIcon, + builder: builder, + width: width); } /// Set as a date column. @@ -358,17 +364,24 @@ class PlutoColumnTypeSelect final List items; + final Widget Function(dynamic item)? builder; + final bool enableColumnFilter; + final Function(PlutoGridOnSelectedEvent event) onItemSelected; + + final double? width; @override final IconData? popupIcon; - const PlutoColumnTypeSelect({ - this.defaultValue, - required this.items, - required this.enableColumnFilter, - this.popupIcon, - }); + const PlutoColumnTypeSelect( + {required this.onItemSelected, + this.defaultValue, + required this.items, + required this.enableColumnFilter, + this.popupIcon, + this.builder, + this.width}); @override bool isValid(dynamic value) => items.contains(value) == true; diff --git a/lib/src/model/pluto_row.dart b/lib/src/model/pluto_row.dart index c30c1a712..709754859 100644 --- a/lib/src/model/pluto_row.dart +++ b/lib/src/model/pluto_row.dart @@ -1,11 +1,12 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; -class PlutoRow { +class PlutoRow { PlutoRow({ required this.cells, PlutoRowType? type, this.sortIdx = 0, + this.data, bool checked = false, Key? key, }) : type = type ?? PlutoRowTypeNormal.instance, @@ -17,6 +18,8 @@ class PlutoRow { final Key _key; + T? data; + Map cells; /// Value to maintain the default sort order when sorting columns. @@ -25,6 +28,8 @@ class PlutoRow { bool? _checked; + bool? _checkedViaSelect; + PlutoRow? _parent; PlutoRowState _state; @@ -67,6 +72,10 @@ class PlutoRow { return type.isGroup ? _tristateCheckedRow : _checked; } + bool get checkedViaSelect { + return (checked ?? false) && (_checkedViaSelect ?? false); + } + bool? get _tristateCheckedRow { if (!type.isGroup) return false; @@ -119,8 +128,11 @@ class PlutoRow { _parent = row; } - void setChecked(bool? flag) { + void setData(T data) => this.data = data; + + void setChecked(bool? flag, {bool viaSelect = false}) { _checked = flag; + _checkedViaSelect = viaSelect; if (type.isGroup) { for (final child in type.group.children) { child.setChecked(flag); diff --git a/lib/src/model/pluto_row_type.dart b/lib/src/model/pluto_row_type.dart index 57c51ee33..851773a6c 100644 --- a/lib/src/model/pluto_row_type.dart +++ b/lib/src/model/pluto_row_type.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class PlutoRowType { factory PlutoRowType.normal() { diff --git a/lib/src/plugin/pluto_aggregate_column_footer.dart b/lib/src/plugin/pluto_aggregate_column_footer.dart index d5076a5df..d254c35b4 100644 --- a/lib/src/plugin/pluto_aggregate_column_footer.dart +++ b/lib/src/plugin/pluto_aggregate_column_footer.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../ui/ui.dart'; diff --git a/lib/src/plugin/pluto_infinity_scroll_rows.dart b/lib/src/plugin/pluto_infinity_scroll_rows.dart index 93914bcf2..756d0232f 100644 --- a/lib/src/plugin/pluto_infinity_scroll_rows.dart +++ b/lib/src/plugin/pluto_infinity_scroll_rows.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// A callback function to implement when the scroll reaches the end. typedef PlutoInfinityScrollRowsFetch = Future @@ -199,6 +199,15 @@ class _PlutoInfinityScrollRowsState extends State { _isFetching = false; _isLast = response.isLast; + + if (!_isLast) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (scroll.hasClients && scroll.position.maxScrollExtent == 0) { + var lastRow = stateManager.rows.isNotEmpty ? stateManager.rows.last : null; + _update(lastRow); + } + }); + } }); } diff --git a/lib/src/plugin/pluto_lazy_pagination.dart b/lib/src/plugin/pluto_lazy_pagination.dart index 3e25dbea2..6126c8cc4 100644 --- a/lib/src/plugin/pluto_lazy_pagination.dart +++ b/lib/src/plugin/pluto_lazy_pagination.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Callback function to implement to add lazy pagination data. typedef PlutoLazyPaginationFetch = Future Function( @@ -180,6 +180,7 @@ class _PlutoLazyPaginationState extends State { ), ) .then((data) { + if(!mounted)return; stateManager.scroll.bodyRowsVertical!.jumpTo(0); stateManager.refRows.clearFromOriginal(); @@ -413,9 +414,7 @@ class _PaginationWidgetState extends State<_PaginationWidget> { ? SystemMouseCursors.basic : SystemMouseCursors.click, ), - ..._pageNumbers - .map(_makeNumberButton) - .toList(growable: false), + ..._pageNumbers.map(_makeNumberButton), IconButton( onPressed: _isLastPage ? null : _nextPage, icon: const Icon(Icons.navigate_next), diff --git a/lib/src/plugin/pluto_pagination.dart b/lib/src/plugin/pluto_pagination.dart index 84d69fa91..a952f9056 100644 --- a/lib/src/plugin/pluto_pagination.dart +++ b/lib/src/plugin/pluto_pagination.dart @@ -1,7 +1,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../ui/ui.dart'; @@ -237,9 +237,7 @@ class PlutoPaginationState extends _PlutoPaginationStateWithChange { ? SystemMouseCursors.basic : SystemMouseCursors.click, ), - ..._pageNumbers - .map(_makeNumberButton) - .toList(growable: false), + ..._pageNumbers.map(_makeNumberButton), IconButton( onPressed: _isLastPage ? null : _nextPage, icon: const Icon(Icons.navigate_next), diff --git a/lib/src/pluto_dual_grid.dart b/lib/src/pluto_dual_grid.dart index 167686ba1..43ecb6576 100644 --- a/lib/src/pluto_dual_grid.dart +++ b/lib/src/pluto_dual_grid.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; typedef PlutoDualOnSelectedEventCallback = void Function( PlutoDualOnSelectedEvent event); @@ -68,8 +68,8 @@ class PlutoDualGrid extends StatefulWidget { this.onSelected, this.display, this.divider = const PlutoDualGridDivider(), - Key? key, - }) : super(key: key); + super.key, + }); static const double dividerWidth = 10; @@ -262,8 +262,8 @@ class PlutoDualGridDividerWidget extends StatefulWidget { required this.indicatorColor, required this.draggingColor, required this.dragCallback, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => diff --git a/lib/src/pluto_dual_grid_popup.dart b/lib/src/pluto_dual_grid_popup.dart index 9fa974111..249c26c97 100644 --- a/lib/src/pluto_dual_grid_popup.dart +++ b/lib/src/pluto_dual_grid_popup.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// [PlutoDualGridPopup] can connect the keyboard movement between the two grids /// by arranging two [PlutoGrid] left and right. diff --git a/lib/src/pluto_grid.dart b/lib/src/pluto_grid.dart index 54d8e96ee..459280a66 100644 --- a/lib/src/pluto_grid.dart +++ b/lib/src/pluto_grid.dart @@ -4,7 +4,7 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:intl/date_symbol_data_local.dart'; import 'package:intl/intl.dart' show Intl; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'helper/platform_helper.dart'; import 'ui/ui.dart'; @@ -30,6 +30,12 @@ typedef PlutoOnRowDoubleTapEventCallback = void Function( typedef PlutoOnRowSecondaryTapEventCallback = void Function( PlutoGridOnRowSecondaryTapEvent event); +typedef PlutoOnRowEnterEventCallback = void Function( + PlutoGridOnRowEnterEvent event); + +typedef PlutoOnRowExitEventCallback = void Function( + PlutoGridOnRowExitEvent event); + typedef PlutoOnRowsMovedEventCallback = void Function( PlutoGridOnRowsMovedEvent event); @@ -45,6 +51,15 @@ typedef CreateFooterCallBack = Widget Function( typedef PlutoRowColorCallback = Color Function( PlutoRowColorContext rowColorContext); +typedef PlutoSelectDateCallBack = Future Function( + PlutoCell dateCell, PlutoColumn column); + +typedef PlutoOnActiveCellChangedEventCallback = void Function( + PlutoGridOnActiveCellChangedEvent event); + +typedef RowWrapper = Widget Function( + BuildContext context, Widget row, PlutoGridStateManager stateManager); + /// [PlutoGrid] is a widget that receives columns and rows and is expressed as a grid-type UI. /// /// [PlutoGrid] supports movement and editing with the keyboard, @@ -55,9 +70,11 @@ typedef PlutoRowColorCallback = Color Function( /// Also, the popup to set the filter or column inside the grid is implemented through the setting of [PlutoGrid]. class PlutoGrid extends PlutoStatefulWidget { const PlutoGrid({ - Key? key, + super.key, required this.columns, required this.rows, + this.rowWrapper, + this.editCellWrapper, this.columnGroups, this.onLoaded, this.onChanged, @@ -66,17 +83,27 @@ class PlutoGrid extends PlutoStatefulWidget { this.onRowChecked, this.onRowDoubleTap, this.onRowSecondaryTap, + this.onRowEnter, + this.onRowExit, this.onRowsMoved, + this.onActiveCellChanged, this.onColumnsMoved, this.createHeader, this.createFooter, this.noRowsWidget, this.rowColorCallback, + this.selectDateCallback, this.columnMenuDelegate, this.configuration = const PlutoGridConfiguration(), this.notifierFilterResolver, this.mode = PlutoGridMode.normal, - }) : super(key: key); + }); + + /// {@macro pluto_grid_row_wrapper} + final RowWrapper? rowWrapper; + + final Widget Function(Widget editCellWidget, PlutoCell cell, + TextEditingController controller)? editCellWrapper; /// {@template pluto_grid_property_columns} /// The [PlutoColumn] column is delivered as a list and can be added or deleted after grid creation. @@ -186,12 +213,28 @@ class PlutoGrid extends PlutoStatefulWidget { /// {@endtemplate} final PlutoOnRowSecondaryTapEventCallback? onRowSecondaryTap; + /// {@template pluto_grid_property_onRowEnter} + /// [onRowEnter] is called when the mouse enters the row. + /// {@endtemplate} + final PlutoOnRowEnterEventCallback? onRowEnter; + + /// {@template pluto_grid_property_onRowExit} + /// [onRowExit] is called when the mouse exits the row. + /// {@endtemplate} + final PlutoOnRowExitEventCallback? onRowExit; + /// {@template pluto_grid_property_onRowsMoved} /// [onRowsMoved] is called after the row is dragged and moved /// if [PlutoColumn.enableRowDrag] is enabled. /// {@endtemplate} final PlutoOnRowsMovedEventCallback? onRowsMoved; + /// {@template pluto_grid_property_onActiveCellChanged} + /// Callback for receiving events + /// when the active cell is changed + /// {@endtemplate} + final PlutoOnActiveCellChangedEventCallback? onActiveCellChanged; + /// {@template pluto_grid_property_onColumnsMoved} /// Callback for receiving events /// when the column is moved by dragging the column @@ -291,6 +334,8 @@ class PlutoGrid extends PlutoStatefulWidget { /// {@endtemplate} final PlutoRowColorCallback? rowColorCallback; + final PlutoSelectDateCallBack? selectDateCallback; + /// {@template pluto_grid_property_columnMenuDelegate} /// Column menu can be customized. /// @@ -500,6 +545,8 @@ class PlutoGridState extends PlutoStateWithChange { _stateManager = PlutoGridStateManager( columns: widget.columns, rows: widget.rows, + rowWrapper: widget.rowWrapper, + editCellWrapper: widget.editCellWrapper, gridFocusNode: _gridFocusNode, scroll: PlutoGridScrollController( vertical: _verticalScroll, @@ -512,9 +559,13 @@ class PlutoGridState extends PlutoStateWithChange { onRowChecked: widget.onRowChecked, onRowDoubleTap: widget.onRowDoubleTap, onRowSecondaryTap: widget.onRowSecondaryTap, + onRowEnter: widget.onRowEnter, + onRowExit: widget.onRowExit, onRowsMoved: widget.onRowsMoved, + onActiveCellChanged: widget.onActiveCellChanged, onColumnsMoved: widget.onColumnsMoved, rowColorCallback: widget.rowColorCallback, + selectDateCallback: widget.selectDateCallback, createHeader: widget.createHeader, createFooter: widget.createFooter, columnMenuDelegate: widget.columnMenuDelegate, @@ -593,7 +644,7 @@ class PlutoGridState extends PlutoStateWithChange { } } - KeyEventResult _handleGridFocusOnKey(FocusNode focusNode, RawKeyEvent event) { + KeyEventResult _handleGridFocusOnKey(FocusNode focusNode, KeyEvent event) { if (_keyManager.eventResult.isSkip == false) { _keyManager.subject.add(PlutoKeyManagerEvent( focusNode: focusNode, @@ -608,7 +659,7 @@ class PlutoGridState extends PlutoStateWithChange { Widget build(BuildContext context) { return FocusScope( onFocusChange: _stateManager.setKeepFocus, - onKey: _handleGridFocusOnKey, + onKeyEvent: _handleGridFocusOnKey, child: _GridContainer( stateManager: _stateManager, child: LayoutBuilder( @@ -822,11 +873,13 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { columnsTopOffset += s.height; } + final gridBorderWidth = _stateManager.configuration.style.gridBorderWidth; + if (hasChild(_StackName.headerDivider)) { layoutChild( _StackName.headerDivider, BoxConstraints.tight( - Size(size.width, PlutoGridSettings.gridBorderWidth), + Size(size.width, gridBorderWidth), ), ); @@ -857,7 +910,7 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { layoutChild( _StackName.footerDivider, BoxConstraints.tight( - Size(size.width, PlutoGridSettings.gridBorderWidth), + Size(size.width, gridBorderWidth), ), ); @@ -893,7 +946,7 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { _StackName.leftFrozenDivider, BoxConstraints.tight( Size( - PlutoGridSettings.gridBorderWidth, + gridBorderWidth, _safe(size.height - columnsTopOffset - bodyRowsBottomOffset), ), ), @@ -901,7 +954,7 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { final double posX = isLTR ? bodyLeftOffset - : size.width - bodyRightOffset - PlutoGridSettings.gridBorderWidth; + : size.width - bodyRightOffset - gridBorderWidth; positionChild( _StackName.leftFrozenDivider, @@ -921,8 +974,7 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { BoxConstraints.loose(size), ); - final double posX = - isLTR ? size.width - s.width + PlutoGridSettings.gridBorderWidth : 0; + final double posX = isLTR ? size.width - s.width + gridBorderWidth : 0; positionChild( _StackName.rightFrozenColumns, @@ -941,14 +993,14 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { _StackName.rightFrozenDivider, BoxConstraints.tight( Size( - PlutoGridSettings.gridBorderWidth, + gridBorderWidth, _safe(size.height - columnsTopOffset - bodyRowsBottomOffset), ), ), ); final double posX = isLTR - ? size.width - bodyRightOffset - PlutoGridSettings.gridBorderWidth + ? size.width - bodyRightOffset - gridBorderWidth : bodyLeftOffset; positionChild( @@ -1013,7 +1065,7 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { var s = layoutChild( _StackName.columnFooterDivider, BoxConstraints.tight( - Size(size.width, PlutoGridSettings.gridBorderWidth), + Size(size.width, gridBorderWidth), ), ); @@ -1028,7 +1080,7 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { var s = layoutChild( _StackName.columnRowDivider, BoxConstraints.tight( - Size(size.width, PlutoGridSettings.gridBorderWidth), + Size(size.width, gridBorderWidth), ), ); @@ -1039,14 +1091,13 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { bodyRowsTopOffset += s.height; } else { - bodyRowsTopOffset += PlutoGridSettings.gridBorderWidth; + bodyRowsTopOffset += gridBorderWidth; } if (hasChild(_StackName.leftFrozenRows)) { final double offset = isLTR ? bodyLeftOffset : bodyRightOffset; - final double posX = isLTR - ? 0 - : size.width - bodyRightOffset + PlutoGridSettings.gridBorderWidth; + final double posX = + isLTR ? 0 : size.width - bodyRightOffset + gridBorderWidth; layoutChild( _StackName.leftFrozenRows, @@ -1066,9 +1117,8 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { if (hasChild(_StackName.leftFrozenColumnFooters)) { final double offset = isLTR ? bodyLeftOffset : bodyRightOffset; - final double posX = isLTR - ? 0 - : size.width - bodyRightOffset + PlutoGridSettings.gridBorderWidth; + final double posX = + isLTR ? 0 : size.width - bodyRightOffset + gridBorderWidth; layoutChild( _StackName.leftFrozenColumnFooters, @@ -1085,9 +1135,8 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { if (hasChild(_StackName.rightFrozenRows)) { final double offset = isLTR ? bodyRightOffset : bodyLeftOffset; - final double posX = isLTR - ? size.width - bodyRightOffset + PlutoGridSettings.gridBorderWidth - : 0; + final double posX = + isLTR ? size.width - bodyRightOffset + gridBorderWidth : 0; layoutChild( _StackName.rightFrozenRows, @@ -1112,8 +1161,7 @@ class PlutoGridLayoutDelegate extends MultiChildLayoutDelegate { BoxConstraints.loose(Size(offset, size.height)), ); - final double posX = - isLTR ? size.width - s.width + PlutoGridSettings.gridBorderWidth : 0; + final double posX = isLTR ? size.width - s.width + gridBorderWidth : 0; positionChild( _StackName.rightFrozenColumnFooters, @@ -1204,8 +1252,7 @@ class _GridContainer extends StatelessWidget { const _GridContainer({ required this.stateManager, required this.child, - Key? key, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -1226,11 +1273,11 @@ class _GridContainer extends StatelessWidget { borderRadius: style.gridBorderRadius, border: Border.all( color: style.gridBorderColor, - width: PlutoGridSettings.gridBorderWidth, + width: style.gridBorderWidth, ), ), child: Padding( - padding: const EdgeInsets.all(PlutoGridSettings.gridPadding), + padding: EdgeInsets.all(style.gridPadding), child: borderRadius == BorderRadius.zero ? child : ClipRRect(borderRadius: borderRadius, child: child), @@ -1241,220 +1288,6 @@ class _GridContainer extends StatelessWidget { } } -/// [PlutoGrid.onLoaded] Argument received by registering callback. -class PlutoGridOnLoadedEvent { - final PlutoGridStateManager stateManager; - - const PlutoGridOnLoadedEvent({ - required this.stateManager, - }); -} - -/// Event called when the value of [PlutoCell] is changed. -/// -/// Notice. -/// [columnIdx], [rowIdx] are the values in the current screen state. -/// Values in their current state, not actual data values -/// with filtering, sorting, or pagination applied. -/// This value is from -/// [PlutoGridStateManager.columns] and [PlutoGridStateManager.rows]. -/// -/// All data is in -/// [PlutoGridStateManager.refColumns.originalList] -/// [PlutoGridStateManager.refRows.originalList] -class PlutoGridOnChangedEvent { - final int columnIdx; - final PlutoColumn column; - final int rowIdx; - final PlutoRow row; - final dynamic value; - final dynamic oldValue; - - const PlutoGridOnChangedEvent({ - required this.columnIdx, - required this.column, - required this.rowIdx, - required this.row, - this.value, - this.oldValue, - }); - - @override - String toString() { - String out = '[PlutoOnChangedEvent] '; - out += 'ColumnIndex : $columnIdx, RowIndex : $rowIdx\n'; - out += '::: oldValue : $oldValue\n'; - out += '::: newValue : $value'; - return out; - } -} - -/// This is the argument value of the [PlutoGrid.onSelected] callback -/// that is called when the [PlutoGrid.mode] value is in select mode. -/// -/// If [row], [rowIdx], [cell] is [PlutoGridMode.select] or [PlutoGridMode.selectWithOneTap], -/// Information of the row selected with the tab or enter key. -/// If the Escape key is pressed, these values are null. -/// -/// [selectedRows] is valid only in case of [PlutoGridMode.multiSelect]. -/// If rows are selected by tab or keyboard, the selected rows are included. -/// If the Escape key is pressed, this value is null. -class PlutoGridOnSelectedEvent { - final PlutoRow? row; - final int? rowIdx; - final PlutoCell? cell; - final List? selectedRows; - - const PlutoGridOnSelectedEvent({ - this.row, - this.rowIdx, - this.cell, - this.selectedRows, - }); - - @override - String toString() { - return '[PlutoGridOnSelectedEvent] rowIdx: $rowIdx, selectedRows: ${selectedRows?.length}'; - } -} - -/// Argument of [PlutoGrid.onSorted] callback for receiving column sort change event. -class PlutoGridOnSortedEvent { - final PlutoColumn column; - - final PlutoColumnSort oldSort; - - const PlutoGridOnSortedEvent({ - required this.column, - required this.oldSort, - }); - - @override - String toString() { - return '[PlutoGridOnSortedEvent] ${column.title} (changed: ${column.sort}, old: $oldSort)'; - } -} - -/// Argument of [PlutoGrid.onRowChecked] callback to receive row checkbox event. -/// -/// [runtimeType] is [PlutoGridOnRowCheckedAllEvent] if [isAll] is true. -/// When [isAll] is true, it means the entire check button event of the column. -/// -/// [runtimeType] is [PlutoGridOnRowCheckedOneEvent] if [isRow] is true. -/// If [isRow] is true, it means the check button event of a specific row. -abstract class PlutoGridOnRowCheckedEvent { - bool get isAll => runtimeType == PlutoGridOnRowCheckedAllEvent; - - bool get isRow => runtimeType == PlutoGridOnRowCheckedOneEvent; - - final PlutoRow? row; - final int? rowIdx; - final bool? isChecked; - - const PlutoGridOnRowCheckedEvent({ - this.row, - this.rowIdx, - this.isChecked, - }); - - @override - String toString() { - String checkMessage = isAll ? 'All rows ' : 'RowIdx $rowIdx '; - checkMessage += isChecked == true ? 'checked' : 'unchecked'; - return '[PlutoGridOnRowCheckedEvent] $checkMessage'; - } -} - -/// Argument of [PlutoGrid.onRowChecked] callback when the checkbox of the row is tapped. -class PlutoGridOnRowCheckedOneEvent extends PlutoGridOnRowCheckedEvent { - const PlutoGridOnRowCheckedOneEvent({ - required PlutoRow row, - required int rowIdx, - required bool? isChecked, - }) : super(row: row, rowIdx: rowIdx, isChecked: isChecked); -} - -/// Argument of [PlutoGrid.onRowChecked] callback when all checkboxes of the column are tapped. -class PlutoGridOnRowCheckedAllEvent extends PlutoGridOnRowCheckedEvent { - const PlutoGridOnRowCheckedAllEvent({ - bool? isChecked, - }) : super(row: null, rowIdx: null, isChecked: isChecked); -} - -/// The argument of the [PlutoGrid.onRowDoubleTap] callback -/// to receive the event of double-tapping the row. -class PlutoGridOnRowDoubleTapEvent { - final PlutoRow row; - final int rowIdx; - final PlutoCell cell; - - const PlutoGridOnRowDoubleTapEvent({ - required this.row, - required this.rowIdx, - required this.cell, - }); -} - -/// Argument of the [PlutoGrid.onRowSecondaryTap] callback -/// to receive the event of tapping the row with the right mouse button. -class PlutoGridOnRowSecondaryTapEvent { - final PlutoRow row; - final int rowIdx; - final PlutoCell cell; - final Offset offset; - - const PlutoGridOnRowSecondaryTapEvent({ - required this.row, - required this.rowIdx, - required this.cell, - required this.offset, - }); -} - -/// Argument of [PlutoGrid.onRowsMoved] callback -/// to receive the event of moving the row by dragging it. -class PlutoGridOnRowsMovedEvent { - final int idx; - final List rows; - - const PlutoGridOnRowsMovedEvent({ - required this.idx, - required this.rows, - }); -} - -/// Argument of [PlutoGrid.onColumnsMoved] callback -/// to move columns by dragging or receive left or right fixed events. -/// -/// [idx] means the actual index of -/// [PlutoGridStateManager.columns] or [PlutoGridStateManager.refColumns]. -/// -/// [visualIdx] means the order displayed on the screen, not the actual index. -/// For example, if there are 5 columns of [0, 1, 2, 3, 4] -/// If 1 column is frozen to the right, [visualIndex] becomes 4. -/// But the actual index is preserved. -class PlutoGridOnColumnsMovedEvent { - final int idx; - final int visualIdx; - final List columns; - - const PlutoGridOnColumnsMovedEvent({ - required this.idx, - required this.visualIdx, - required this.columns, - }); - - @override - String toString() { - String text = - '[PlutoGridOnColumnsMovedEvent] idx: $idx, visualIdx: $visualIdx\n'; - - text += columns.map((e) => e.title).join(','); - - return text; - } -} - /// Argument of [PlutoGrid.rowColumnCallback] callback /// to dynamically change the background color of a row. class PlutoRowColorContext { @@ -1517,187 +1350,6 @@ class PlutoOptional { final T? value; } -abstract class PlutoGridSettings { - /// If there is a frozen column, the minimum width of the body - /// (if it is less than the value, the frozen column is released) - static const double bodyMinWidth = 200.0; - - /// Default column width - static const double columnWidth = 200.0; - - /// Column width - static const double minColumnWidth = 80.0; - - /// Frozen column division line (ShadowLine) size - static const double shadowLineSize = 3.0; - - /// Sum of frozen column division line width - static const double totalShadowLineWidth = - PlutoGridSettings.shadowLineSize * 2; - - /// Grid - padding - static const double gridPadding = 2.0; - - /// Grid - border width - static const double gridBorderWidth = 1.0; - - static const double gridInnerSpacing = - (gridPadding * 2) + (gridBorderWidth * 2); - - /// Row - Default row height - static const double rowHeight = 45.0; - - /// Row - border width - static const double rowBorderWidth = 1.0; - - /// Row - total height - static const double rowTotalHeight = rowHeight + rowBorderWidth; - - /// Cell - padding - static const EdgeInsets cellPadding = EdgeInsets.symmetric(horizontal: 10); - - /// Column title - padding - static const EdgeInsets columnTitlePadding = - EdgeInsets.symmetric(horizontal: 10); - - static const EdgeInsets columnFilterPadding = EdgeInsets.all(5); - - /// Cell - fontSize - static const double cellFontSize = 14; - - /// Scroll when multi-selection is as close as that value from the edge - static const double offsetScrollingFromEdge = 10.0; - - /// Size that scrolls from the edge at once when selecting multiple - static const double offsetScrollingFromEdgeAtOnce = 200.0; - - static const int debounceMillisecondsForColumnFilter = 300; -} - -enum PlutoGridMode { - /// {@template pluto_grid_mode_normal} - /// Basic mode with most functions not limited, such as editing and selection. - /// {@endtemplate} - normal, - - /// {@template pluto_grid_mode_readOnly} - /// Cell cannot be edited. - /// To try to edit by force, it is possible as follows. - /// - /// ```dart - /// stateManager.changeCellValue( - /// stateManager.currentCell!, - /// 'test', - /// force: true, - /// ); - /// ``` - /// {@endtemplate} - readOnly, - - /// {@template pluto_grid_mode_select} - /// Mode for selecting one list from a specific list. - /// Tap a row or press Enter to select the current row. - /// - /// [select] - /// Call the [PlutoGrid.onSelected] callback when the selected row is tapped. - /// To select an unselected row, select the row and then tap once more. - /// [selectWithOneTap] - /// Same as [select], but calls [PlutoGrid.onSelected] with one tap. - /// - /// This mode is non-editable, but programmatically possible. - /// ```dart - /// stateManager.changeCellValue( - /// stateManager.currentRow!.cells['column_1']!, - /// value, - /// force: true, - /// ); - /// ``` - /// {@endtemplate} - select, - - /// {@macro pluto_grid_mode_select} - selectWithOneTap, - - /// {@template pluto_grid_mode_multiSelect} - /// Mode to select multiple rows. - /// When a row is tapped, it is selected or deselected and the [PlutoGrid.onSelected] callback is called. - /// [PlutoGridOnSelectedEvent.selectedRows] contains the selected rows. - /// When a row is selected with keyboard shift + arrowDown/Up keys, - /// the [PlutoGrid.onSelected] callback is called only when the Enter key is pressed. - /// When the Escape key is pressed, - /// the selected row is canceled and the [PlutoGrid.onSelected] callback is called - /// with a [PlutoGridOnSelectedEvent.selectedRows] value of null. - /// {@endtemplate} - multiSelect, - - /// {@template pluto_grid_mode_popup} - /// This is a mode for popup type. - /// It is used when calling a popup for filtering or column setting - /// inside [PlutoGrid], and it is not a mode for users. - /// - /// If the user wants to run [PlutoGrid] as a popup, - /// use [PlutoGridPopup] or [PlutoGridDualGridPopup]. - /// {@endtemplate} - popup; - - bool get isNormal => this == PlutoGridMode.normal; - - bool get isReadOnly => this == PlutoGridMode.readOnly; - - bool get isEditableMode => isNormal || isPopup; - - bool get isSelectMode => isSingleSelectMode || isMultiSelectMode; - - bool get isSingleSelectMode => isSelect || isSelectWithOneTap; - - bool get isMultiSelectMode => isMultiSelect; - - bool get isSelect => this == PlutoGridMode.select; - - bool get isSelectWithOneTap => this == PlutoGridMode.selectWithOneTap; - - bool get isMultiSelect => this == PlutoGridMode.multiSelect; - - bool get isPopup => this == PlutoGridMode.popup; -} - -/// When calling loading screen with [PlutoGridStateManager.setShowLoading] method -/// Determines the level of loading. -/// -/// {@template pluto_grid_loading_level_grid} -/// [grid] makes the entire grid opaque and puts the loading indicator in the center. -/// The user is in a state where no interaction is possible. -/// {@endtemplate} -/// -/// {@template pluto_grid_loading_level_rows} -/// [rows] represents the [LinearProgressIndicator] at the top of the widget area -/// that displays the rows. -/// User can interact. -/// {@endtemplate} -/// -/// {@template pluto_grid_loading_level_rowsBottomCircular} -/// [rowsBottomCircular] represents the [CircularProgressIndicator] at the bottom of the widget -/// that displays the rows. -/// User can interact. -/// {@endtemplate} -enum PlutoGridLoadingLevel { - /// {@macro pluto_grid_loading_level_grid} - grid, - - /// {@macro pluto_grid_loading_level_rows} - rows, - - /// {@macro pluto_grid_loading_level_rowsBottomCircular} - rowsBottomCircular; - - bool get isGrid => this == PlutoGridLoadingLevel.grid; - - bool get isRows => this == PlutoGridLoadingLevel.rows; - - bool get isRowsBottomCircular => - this == PlutoGridLoadingLevel.rowsBottomCircular; -} - enum _StackName { header, headerDivider, diff --git a/lib/src/pluto_grid_configuration.dart b/lib/src/pluto_grid_configuration.dart index 9b946b169..c3bed1f8b 100644 --- a/lib/src/pluto_grid_configuration.dart +++ b/lib/src/pluto_grid_configuration.dart @@ -2,7 +2,7 @@ import 'package:collection/collection.dart' show IterableExtension; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; class PlutoGridConfiguration { /// When you select a value in the pop-up grid, it moves down. @@ -11,6 +11,24 @@ class PlutoGridConfiguration { /// Moves the current cell when focus reaches the left or right edge in the edit state. final bool enableMoveHorizontalInEditing; + /// [PlutoGridRowSelectionCheckBoxBehavior.none] + /// Selecting a row does nothing to its checkbox + /// + /// [PlutoGridRowSelectionCheckBoxBehavior.checkRow] + /// Automatically enables the checkbox of the selected rows + /// + /// [PlutoGridRowSelectionCheckBoxBehavior.toggleCheckRow] + /// Automatically toggles the checkbox of the selected rows + /// + /// [PlutoGridRowSelectionCheckBoxBehavior.singleRowCheck] + /// Automatically enabels the checkbox of a selected row (if another row is checked via select, the previous one is unchecked) + /// + /// [PlutoGridRowSelectionCheckBoxBehavior.singleRowCheck] + /// Automatically toggles the checkbox of a selected row (if another row is checked via select, the previous one is unchecked) + /// + /// Important: Only works with mode: PlutoGridMode.selectWithOneTap, + final PlutoGridRowSelectionCheckBoxBehavior rowSelectionCheckBoxBehavior; + /// [PlutoEnterKeyAction.EditingAndMoveDown] /// It switches to the editing state, and moves down in the editing state. /// @@ -76,6 +94,8 @@ class PlutoGridConfiguration { const PlutoGridConfiguration({ this.enableMoveDownAfterSelecting = false, this.enableMoveHorizontalInEditing = false, + this.rowSelectionCheckBoxBehavior = + PlutoGridRowSelectionCheckBoxBehavior.none, this.enterKeyAction = PlutoGridEnterKeyAction.editingAndMoveDown, this.tabKeyAction = PlutoGridTabKeyAction.normal, this.shortcut = const PlutoGridShortcut(), @@ -89,6 +109,8 @@ class PlutoGridConfiguration { const PlutoGridConfiguration.dark({ this.enableMoveDownAfterSelecting = false, this.enableMoveHorizontalInEditing = false, + this.rowSelectionCheckBoxBehavior = + PlutoGridRowSelectionCheckBoxBehavior.none, this.enterKeyAction = PlutoGridEnterKeyAction.editingAndMoveDown, this.tabKeyAction = PlutoGridTabKeyAction.normal, this.shortcut = const PlutoGridShortcut(), @@ -198,12 +220,16 @@ class PlutoGridStyleConfig { this.enableCellBorderVertical = true, this.enableCellBorderHorizontal = true, this.enableRowColorAnimation = false, + this.enableRowHoverColor = false, this.gridBackgroundColor = Colors.white, this.rowColor = Colors.white, this.oddRowColor, this.evenRowColor, this.activatedColor = const Color(0xFFDCF5FF), - this.checkedColor = const Color(0x11757575), + Color? columnCheckedColor, + Color? cellCheckedColor, + this.rowCheckedColor = const Color(0x11757575), + this.rowHoveredColor = const Color(0xFFB1B3B7), this.cellColorInEditState = Colors.white, this.cellColorInReadOnlyState = const Color(0xFFDBDBDC), this.cellColorGroupedRow, @@ -228,6 +254,10 @@ class PlutoGridStyleConfig { fontSize: 14, fontWeight: FontWeight.w600, ), + Color? columnUnselectedColor, + Color? columnActiveColor, + Color? cellUnselectedColor, + Color? cellActiveColor, this.cellTextStyle = const TextStyle( color: Colors.black, fontSize: 14, @@ -245,7 +275,16 @@ class PlutoGridStyleConfig { this.rowGroupEmptyIcon = Icons.noise_control_off, this.gridBorderRadius = BorderRadius.zero, this.gridPopupBorderRadius = BorderRadius.zero, - }); + this.gridPadding = PlutoGridSettings.gridPadding, + this.gridBorderWidth = PlutoGridSettings.gridBorderWidth, + this.filterHeaderColor, + this.filterHeaderIconColor, + }) : columnCheckedColor = (columnCheckedColor ?? activatedColor), + cellCheckedColor = (cellCheckedColor ?? activatedColor), + columnUnselectedColor = (columnUnselectedColor ?? iconColor), + columnActiveColor = (columnActiveColor ?? activatedBorderColor), + cellUnselectedColor = (cellUnselectedColor ?? iconColor), + cellActiveColor = (cellActiveColor ?? activatedBorderColor); const PlutoGridStyleConfig.dark({ this.enableGridBorderShadow = false, @@ -254,12 +293,16 @@ class PlutoGridStyleConfig { this.enableCellBorderVertical = true, this.enableCellBorderHorizontal = true, this.enableRowColorAnimation = false, + this.enableRowHoverColor = false, this.gridBackgroundColor = const Color(0xFF111111), this.rowColor = const Color(0xFF111111), this.oddRowColor, this.evenRowColor, this.activatedColor = const Color(0xFF313131), - this.checkedColor = const Color(0x11202020), + Color? columnCheckedColor, + Color? cellCheckedColor, + this.rowCheckedColor = const Color(0x11202020), + this.rowHoveredColor = const Color(0xFF3D3D3D), this.cellColorInEditState = const Color(0xFF666666), this.cellColorInReadOnlyState = const Color(0xFF222222), this.cellColorGroupedRow, @@ -284,6 +327,10 @@ class PlutoGridStyleConfig { fontSize: 14, fontWeight: FontWeight.w600, ), + Color? columnUnselectedColor, + Color? columnActiveColor, + Color? cellUnselectedColor, + Color? cellActiveColor, this.cellTextStyle = const TextStyle( color: Colors.white, fontSize: 14, @@ -301,7 +348,16 @@ class PlutoGridStyleConfig { this.rowGroupEmptyIcon = Icons.noise_control_off, this.gridBorderRadius = BorderRadius.zero, this.gridPopupBorderRadius = BorderRadius.zero, - }); + this.gridPadding = PlutoGridSettings.gridPadding, + this.gridBorderWidth = PlutoGridSettings.gridBorderWidth, + this.filterHeaderColor, + this.filterHeaderIconColor, + }) : columnCheckedColor = (columnCheckedColor ?? activatedColor), + cellCheckedColor = (cellCheckedColor ?? activatedColor), + columnUnselectedColor = (columnUnselectedColor ?? iconColor), + columnActiveColor = (columnActiveColor ?? activatedBorderColor), + cellUnselectedColor = (cellUnselectedColor ?? iconColor), + cellActiveColor = (cellActiveColor ?? activatedBorderColor); /// Enable borderShadow in [PlutoGrid]. final bool enableGridBorderShadow; @@ -322,6 +378,14 @@ class PlutoGridStyleConfig { /// such as when the current row or rows are dragged. final bool enableRowColorAnimation; + /// Hover effect on rows. + /// If true, the background color of the row changes to [rowHoveredColor] + /// when the mouse hovers over it. + /// If false, the background color of the row does not change and + /// the background color of the row is the same as [rowColor]. + /// [rowHoveredColor] is therefore not used. + final bool enableRowHoverColor; + final Color gridBackgroundColor; /// Default row background color @@ -344,8 +408,17 @@ class PlutoGridStyleConfig { /// Activated Color. (Current or Selected row, cell) final Color activatedColor; - /// Checked Color. (Checked rows) - final Color checkedColor; + /// Checked Color for the column title. (Checked rows) + final Color columnCheckedColor; + + /// Checked Color for the cell. (Checked rows) + final Color cellCheckedColor; + + /// Checked Color for the row. (Checked rows) + final Color rowCheckedColor; + + /// Hovered Color. (Currently hovered row) + final Color rowHoveredColor; /// Cell color in edit state. (only current cell) final Color cellColorInEditState; @@ -412,6 +485,18 @@ class PlutoGridStyleConfig { /// Column - text style final TextStyle columnTextStyle; + /// Unselected color of the column. + final Color columnUnselectedColor; + + /// Active color of the column. + final Color columnActiveColor; + + /// Unselected color of the default cell. + final Color cellUnselectedColor; + + /// Active color of the default cell. + final Color cellActiveColor; + /// Cell - text style final TextStyle cellTextStyle; @@ -448,6 +533,18 @@ class PlutoGridStyleConfig { /// Apply border radius to popup opened inside [PlutoGrid]. final BorderRadiusGeometry gridPopupBorderRadius; + /// Defaults to [PlutoGridSettings.gridPadding] + final double gridPadding; + + /// Defaults to [PlutoGridSettings.gridBorderWidth] + final double gridBorderWidth; + + /// Set color of filter popup header + final Color? filterHeaderColor; + + /// Set color of filter popup header icon + final Color? filterHeaderIconColor; + PlutoGridStyleConfig copyWith({ bool? enableGridBorderShadow, bool? enableColumnBorderVertical, @@ -460,7 +557,8 @@ class PlutoGridStyleConfig { PlutoOptional? oddRowColor, PlutoOptional? evenRowColor, Color? activatedColor, - Color? checkedColor, + Color? columnCheckedColor, + Color? cellCheckedColor, Color? cellColorInEditState, Color? cellColorInReadOnlyState, PlutoOptional? cellColorGroupedRow, @@ -480,6 +578,10 @@ class PlutoGridStyleConfig { EdgeInsets? defaultColumnFilterPadding, EdgeInsets? defaultCellPadding, TextStyle? columnTextStyle, + Color? columnUnselectedColor, + Color? columnActiveColor, + Color? cellUnselectedColor, + Color? cellActiveColor, TextStyle? cellTextStyle, IconData? columnContextIcon, IconData? columnResizeIcon, @@ -490,70 +592,80 @@ class PlutoGridStyleConfig { IconData? rowGroupEmptyIcon, BorderRadiusGeometry? gridBorderRadius, BorderRadiusGeometry? gridPopupBorderRadius, + double? gridPadding, + double? gridBorderWidth, }) { return PlutoGridStyleConfig( - enableGridBorderShadow: - enableGridBorderShadow ?? this.enableGridBorderShadow, - enableColumnBorderVertical: - enableColumnBorderVertical ?? this.enableColumnBorderVertical, - enableColumnBorderHorizontal: - enableColumnBorderHorizontal ?? this.enableColumnBorderHorizontal, - enableCellBorderVertical: - enableCellBorderVertical ?? this.enableCellBorderVertical, - enableCellBorderHorizontal: - enableCellBorderHorizontal ?? this.enableCellBorderHorizontal, - enableRowColorAnimation: - enableRowColorAnimation ?? this.enableRowColorAnimation, - gridBackgroundColor: gridBackgroundColor ?? this.gridBackgroundColor, - rowColor: rowColor ?? this.rowColor, - oddRowColor: oddRowColor == null ? this.oddRowColor : oddRowColor.value, - evenRowColor: - evenRowColor == null ? this.evenRowColor : evenRowColor.value, - activatedColor: activatedColor ?? this.activatedColor, - checkedColor: checkedColor ?? this.checkedColor, - cellColorInEditState: cellColorInEditState ?? this.cellColorInEditState, - cellColorInReadOnlyState: - cellColorInReadOnlyState ?? this.cellColorInReadOnlyState, - cellColorGroupedRow: cellColorGroupedRow == null - ? this.cellColorGroupedRow - : cellColorGroupedRow.value, - dragTargetColumnColor: - dragTargetColumnColor ?? this.dragTargetColumnColor, - iconColor: iconColor ?? this.iconColor, - disabledIconColor: disabledIconColor ?? this.disabledIconColor, - menuBackgroundColor: menuBackgroundColor ?? this.menuBackgroundColor, - gridBorderColor: gridBorderColor ?? this.gridBorderColor, - borderColor: borderColor ?? this.borderColor, - activatedBorderColor: activatedBorderColor ?? this.activatedBorderColor, - inactivatedBorderColor: - inactivatedBorderColor ?? this.inactivatedBorderColor, - iconSize: iconSize ?? this.iconSize, - rowHeight: rowHeight ?? this.rowHeight, - columnHeight: columnHeight ?? this.columnHeight, - columnFilterHeight: columnFilterHeight ?? this.columnFilterHeight, - defaultColumnTitlePadding: - defaultColumnTitlePadding ?? this.defaultColumnTitlePadding, - defaultColumnFilterPadding: - defaultColumnFilterPadding ?? this.defaultColumnFilterPadding, - defaultCellPadding: defaultCellPadding ?? this.defaultCellPadding, - columnTextStyle: columnTextStyle ?? this.columnTextStyle, - cellTextStyle: cellTextStyle ?? this.cellTextStyle, - columnContextIcon: columnContextIcon ?? this.columnContextIcon, - columnResizeIcon: columnResizeIcon ?? this.columnResizeIcon, - columnAscendingIcon: columnAscendingIcon == null - ? this.columnAscendingIcon - : columnAscendingIcon.value, - columnDescendingIcon: columnDescendingIcon == null - ? this.columnDescendingIcon - : columnDescendingIcon.value, - rowGroupExpandedIcon: rowGroupExpandedIcon ?? this.rowGroupExpandedIcon, - rowGroupCollapsedIcon: - rowGroupCollapsedIcon ?? this.rowGroupCollapsedIcon, - rowGroupEmptyIcon: rowGroupEmptyIcon ?? this.rowGroupEmptyIcon, - gridBorderRadius: gridBorderRadius ?? this.gridBorderRadius, - gridPopupBorderRadius: - gridPopupBorderRadius ?? this.gridPopupBorderRadius, - ); + enableGridBorderShadow: + enableGridBorderShadow ?? this.enableGridBorderShadow, + enableColumnBorderVertical: + enableColumnBorderVertical ?? this.enableColumnBorderVertical, + enableColumnBorderHorizontal: + enableColumnBorderHorizontal ?? this.enableColumnBorderHorizontal, + enableCellBorderVertical: + enableCellBorderVertical ?? this.enableCellBorderVertical, + enableCellBorderHorizontal: + enableCellBorderHorizontal ?? this.enableCellBorderHorizontal, + enableRowColorAnimation: + enableRowColorAnimation ?? this.enableRowColorAnimation, + gridBackgroundColor: gridBackgroundColor ?? this.gridBackgroundColor, + rowColor: rowColor ?? this.rowColor, + oddRowColor: oddRowColor == null ? this.oddRowColor : oddRowColor.value, + evenRowColor: + evenRowColor == null ? this.evenRowColor : evenRowColor.value, + activatedColor: activatedColor ?? this.activatedColor, + columnCheckedColor: columnCheckedColor ?? this.columnCheckedColor, + cellCheckedColor: cellCheckedColor ?? this.cellCheckedColor, + cellColorInEditState: cellColorInEditState ?? this.cellColorInEditState, + cellColorInReadOnlyState: + cellColorInReadOnlyState ?? this.cellColorInReadOnlyState, + cellColorGroupedRow: cellColorGroupedRow == null + ? this.cellColorGroupedRow + : cellColorGroupedRow.value, + dragTargetColumnColor: + dragTargetColumnColor ?? this.dragTargetColumnColor, + iconColor: iconColor ?? this.iconColor, + disabledIconColor: disabledIconColor ?? this.disabledIconColor, + menuBackgroundColor: menuBackgroundColor ?? this.menuBackgroundColor, + gridBorderColor: gridBorderColor ?? this.gridBorderColor, + borderColor: borderColor ?? this.borderColor, + activatedBorderColor: activatedBorderColor ?? this.activatedBorderColor, + inactivatedBorderColor: + inactivatedBorderColor ?? this.inactivatedBorderColor, + iconSize: iconSize ?? this.iconSize, + rowHeight: rowHeight ?? this.rowHeight, + columnHeight: columnHeight ?? this.columnHeight, + columnFilterHeight: columnFilterHeight ?? this.columnFilterHeight, + defaultColumnTitlePadding: + defaultColumnTitlePadding ?? this.defaultColumnTitlePadding, + defaultColumnFilterPadding: + defaultColumnFilterPadding ?? this.defaultColumnFilterPadding, + defaultCellPadding: defaultCellPadding ?? this.defaultCellPadding, + columnTextStyle: columnTextStyle ?? this.columnTextStyle, + columnUnselectedColor: columnUnselectedColor ?? this.columnUnselectedColor, + columnActiveColor: columnActiveColor ?? this.columnActiveColor, + cellUnselectedColor: cellUnselectedColor ?? this.cellUnselectedColor, + cellActiveColor: cellActiveColor ?? this.cellActiveColor, + cellTextStyle: cellTextStyle ?? this.cellTextStyle, + columnContextIcon: columnContextIcon ?? this.columnContextIcon, + columnResizeIcon: columnResizeIcon ?? this.columnResizeIcon, + columnAscendingIcon: columnAscendingIcon == null + ? this.columnAscendingIcon + : columnAscendingIcon.value, + columnDescendingIcon: columnDescendingIcon == null + ? this.columnDescendingIcon + : columnDescendingIcon.value, + rowGroupExpandedIcon: rowGroupExpandedIcon ?? this.rowGroupExpandedIcon, + rowGroupCollapsedIcon: + rowGroupCollapsedIcon ?? this.rowGroupCollapsedIcon, + rowGroupEmptyIcon: rowGroupEmptyIcon ?? this.rowGroupEmptyIcon, + gridBorderRadius: gridBorderRadius ?? this.gridBorderRadius, + gridPopupBorderRadius: + gridPopupBorderRadius ?? this.gridPopupBorderRadius, + gridPadding: gridPadding ?? this.gridPadding, + gridBorderWidth: gridBorderWidth ?? this.gridBorderWidth, + filterHeaderColor: filterHeaderColor ?? filterHeaderColor, + filterHeaderIconColor: filterHeaderIconColor ?? filterHeaderIconColor); } @override @@ -573,7 +685,8 @@ class PlutoGridStyleConfig { oddRowColor == other.oddRowColor && evenRowColor == other.evenRowColor && activatedColor == other.activatedColor && - checkedColor == other.checkedColor && + columnCheckedColor == other.columnCheckedColor && + cellCheckedColor == other.cellCheckedColor && cellColorInEditState == other.cellColorInEditState && cellColorInReadOnlyState == other.cellColorInReadOnlyState && cellColorGroupedRow == other.cellColorGroupedRow && @@ -593,6 +706,10 @@ class PlutoGridStyleConfig { defaultColumnFilterPadding == other.defaultColumnFilterPadding && defaultCellPadding == other.defaultCellPadding && columnTextStyle == other.columnTextStyle && + columnUnselectedColor == other.columnUnselectedColor && + columnActiveColor == other.columnActiveColor && + cellUnselectedColor == other.cellUnselectedColor && + cellActiveColor == other.cellActiveColor && cellTextStyle == other.cellTextStyle && columnContextIcon == other.columnContextIcon && columnResizeIcon == other.columnResizeIcon && @@ -602,7 +719,9 @@ class PlutoGridStyleConfig { rowGroupCollapsedIcon == other.rowGroupCollapsedIcon && rowGroupEmptyIcon == other.rowGroupEmptyIcon && gridBorderRadius == other.gridBorderRadius && - gridPopupBorderRadius == other.gridPopupBorderRadius; + gridPopupBorderRadius == other.gridPopupBorderRadius && + gridPadding == other.gridPadding && + gridBorderWidth == other.gridBorderWidth; } @override @@ -618,7 +737,8 @@ class PlutoGridStyleConfig { oddRowColor, evenRowColor, activatedColor, - checkedColor, + columnCheckedColor, + cellCheckedColor, cellColorInEditState, cellColorInReadOnlyState, cellColorGroupedRow, @@ -638,6 +758,10 @@ class PlutoGridStyleConfig { defaultColumnFilterPadding, defaultCellPadding, columnTextStyle, + columnUnselectedColor, + columnActiveColor, + cellUnselectedColor, + cellActiveColor, cellTextStyle, columnContextIcon, columnResizeIcon, @@ -648,6 +772,8 @@ class PlutoGridStyleConfig { rowGroupEmptyIcon, gridBorderRadius, gridPopupBorderRadius, + gridPadding, + gridBorderWidth, ]); } @@ -1655,6 +1781,19 @@ class PlutoGridLocaleText { ]); } +enum PlutoGridRowSelectionCheckBoxBehavior { + /// Selecting a row does nothing to its checkbox + none, + /// Automatically enables the checkbox of the selected rows + checkRow, + /// Automatically toggles the checkbox of the selected rows + toggleCheckRow, + /// Automatically enabels the checkbox of a selected row (if another row is checked via select, the previous one is unchecked) + singleRowCheck, + /// Automatically toggles the checkbox of a selected row (if another row is checked via select, the previous one is unchecked) + toggleSingleRowCheck, +} + /// Behavior of the Enter key when a cell is selected. enum PlutoGridEnterKeyAction { /// When the Enter key is pressed, the cell is changed to the edit state, diff --git a/lib/src/pluto_grid_date_picker.dart b/lib/src/pluto_grid_date_picker.dart index 21bd1f854..32a3b7aa0 100644 --- a/lib/src/pluto_grid_date_picker.dart +++ b/lib/src/pluto_grid_date_picker.dart @@ -3,7 +3,7 @@ import 'dart:math' show min; import 'package:flutter/material.dart'; import 'package:intl/intl.dart' as intl; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui/ui.dart'; @@ -221,8 +221,8 @@ class PlutoGridDatePicker { currentMonth = offsetDate.month; final List days = PlutoDateTimeHelper.getDaysInBetween( - DateTime(offsetDate.year, offsetDate.month, 1), - DateTime(offsetDate.year, offsetDate.month + 1, 0), + DateTime.utc(offsetDate.year, offsetDate.month, 1), + DateTime.utc(offsetDate.year, offsetDate.month + 1, 0), ); final popupRows = _buildRows(days); diff --git a/lib/src/pluto_grid_enums.dart b/lib/src/pluto_grid_enums.dart new file mode 100644 index 000000000..478cbbc0f --- /dev/null +++ b/lib/src/pluto_grid_enums.dart @@ -0,0 +1,123 @@ +enum PlutoGridMode { + /// {@template pluto_grid_mode_normal} + /// Basic mode with most functions not limited, such as editing and selection. + /// {@endtemplate} + normal, + + /// {@template pluto_grid_mode_readOnly} + /// Cell cannot be edited. + /// To try to edit by force, it is possible as follows. + /// + /// ```dart + /// stateManager.changeCellValue( + /// stateManager.currentCell!, + /// 'test', + /// force: true, + /// ); + /// ``` + /// {@endtemplate} + readOnly, + + /// {@template pluto_grid_mode_select} + /// Mode for selecting one list from a specific list. + /// Tap a row or press Enter to select the current row. + /// + /// [select] + /// Call the [PlutoGrid.onSelected] callback when the selected row is tapped. + /// To select an unselected row, select the row and then tap once more. + /// [selectWithOneTap] + /// Same as [select], but calls [PlutoGrid.onSelected] with one tap. + /// + /// This mode is non-editable, but programmatically possible. + /// ```dart + /// stateManager.changeCellValue( + /// stateManager.currentRow!.cells['column_1']!, + /// value, + /// force: true, + /// ); + /// ``` + /// {@endtemplate} + select, + + /// {@macro pluto_grid_mode_select} + selectWithOneTap, + + /// {@template pluto_grid_mode_multiSelect} + /// Mode to select multiple rows. + /// When a row is tapped, it is selected or deselected and the [PlutoGrid.onSelected] callback is called. + /// [PlutoGridOnSelectedEvent.selectedRows] contains the selected rows. + /// When a row is selected with keyboard shift + arrowDown/Up keys, + /// the [PlutoGrid.onSelected] callback is called only when the Enter key is pressed. + /// When the Escape key is pressed, + /// the selected row is canceled and the [PlutoGrid.onSelected] callback is called + /// with a [PlutoGridOnSelectedEvent.selectedRows] value of null. + /// {@endtemplate} + multiSelect, + + /// {@template pluto_grid_mode_popup} + /// This is a mode for popup type. + /// It is used when calling a popup for filtering or column setting + /// inside [PlutoGrid], and it is not a mode for users. + /// + /// If the user wants to run [PlutoGrid] as a popup, + /// use [PlutoGridPopup] or [PlutoGridDualGridPopup]. + /// {@endtemplate} + popup; + + bool get isNormal => this == PlutoGridMode.normal; + + bool get isReadOnly => this == PlutoGridMode.readOnly; + + bool get isEditableMode => isNormal || isPopup; + + bool get isSelectMode => isSingleSelectMode || isMultiSelectMode; + + bool get isSingleSelectMode => isSelect || isSelectWithOneTap; + + bool get isMultiSelectMode => isMultiSelect; + + bool get isSelect => this == PlutoGridMode.select; + + bool get isSelectWithOneTap => this == PlutoGridMode.selectWithOneTap; + + bool get isMultiSelect => this == PlutoGridMode.multiSelect; + + bool get isPopup => this == PlutoGridMode.popup; +} + +/// When calling loading screen with [PlutoGridStateManager.setShowLoading] method +/// Determines the level of loading. +/// +/// {@template pluto_grid_loading_level_grid} +/// [grid] makes the entire grid opaque and puts the loading indicator in the center. +/// The user is in a state where no interaction is possible. +/// {@endtemplate} +/// +/// {@template pluto_grid_loading_level_rows} +/// [rows] represents the [LinearProgressIndicator] at the top of the widget area +/// that displays the rows. +/// User can interact. +/// {@endtemplate} +/// +/// {@template pluto_grid_loading_level_rowsBottomCircular} +/// [rowsBottomCircular] represents the [CircularProgressIndicator] at the bottom of the widget +/// that displays the rows. +/// User can interact. +/// {@endtemplate} +enum PlutoGridLoadingLevel { + /// {@macro pluto_grid_loading_level_grid} + grid, + + /// {@macro pluto_grid_loading_level_rows} + rows, + + /// {@macro pluto_grid_loading_level_rowsBottomCircular} + rowsBottomCircular; + + bool get isGrid => this == PlutoGridLoadingLevel.grid; + + bool get isRows => this == PlutoGridLoadingLevel.rows; + + bool get isRowsBottomCircular => + this == PlutoGridLoadingLevel.rowsBottomCircular; +} diff --git a/lib/src/pluto_grid_events.dart b/lib/src/pluto_grid_events.dart new file mode 100644 index 000000000..ff81963cc --- /dev/null +++ b/lib/src/pluto_grid_events.dart @@ -0,0 +1,251 @@ +import 'package:flutter/material.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; + +/// [PlutoGrid.onLoaded] Argument received by registering callback. +class PlutoGridOnLoadedEvent { + final PlutoGridStateManager stateManager; + + const PlutoGridOnLoadedEvent({ + required this.stateManager, + }); +} + +/// Event called when the value of [PlutoCell] is changed. +/// +/// Notice. +/// [columnIdx], [rowIdx] are the values in the current screen state. +/// Values in their current state, not actual data values +/// with filtering, sorting, or pagination applied. +/// This value is from +/// [PlutoGridStateManager.columns] and [PlutoGridStateManager.rows]. +/// +/// All data is in +/// [PlutoGridStateManager.refColumns.originalList] +/// [PlutoGridStateManager.refRows.originalList] +class PlutoGridOnChangedEvent { + final int columnIdx; + final PlutoColumn column; + final int rowIdx; + final PlutoRow row; + final dynamic value; + final dynamic oldValue; + + const PlutoGridOnChangedEvent({ + required this.columnIdx, + required this.column, + required this.rowIdx, + required this.row, + this.value, + this.oldValue, + }); + + @override + String toString() { + String out = '[PlutoOnChangedEvent] '; + out += 'ColumnIndex : $columnIdx, RowIndex : $rowIdx\n'; + out += '::: oldValue : $oldValue\n'; + out += '::: newValue : $value'; + return out; + } +} + +/// This is the argument value of the [PlutoGrid.onSelected] callback +/// that is called when the [PlutoGrid.mode] value is in select mode. +/// +/// If [row], [rowIdx], [cell] is [PlutoGridMode.select] or [PlutoGridMode.selectWithOneTap], +/// Information of the row selected with the tab or enter key. +/// If the Escape key is pressed, these values are null. +/// +/// [selectedRows] is valid only in case of [PlutoGridMode.multiSelect]. +/// If rows are selected by tab or keyboard, the selected rows are included. +/// If the Escape key is pressed, this value is null. +class PlutoGridOnSelectedEvent { + final PlutoRow? row; + final int? rowIdx; + final PlutoCell? cell; + final List? selectedRows; + + const PlutoGridOnSelectedEvent({ + this.row, + this.rowIdx, + this.cell, + this.selectedRows, + }); + + @override + String toString() { + return '[PlutoGridOnSelectedEvent] rowIdx: $rowIdx, selectedRows: ${selectedRows?.length}'; + } +} + +/// Argument of [PlutoGrid.onSorted] callback for receiving column sort change event. +class PlutoGridOnSortedEvent { + final PlutoColumn column; + + final PlutoColumnSort oldSort; + + const PlutoGridOnSortedEvent({ + required this.column, + required this.oldSort, + }); + + @override + String toString() { + return '[PlutoGridOnSortedEvent] ${column.title} (changed: ${column.sort}, old: $oldSort)'; + } +} + +/// Argument of [PlutoGrid.onRowChecked] callback to receive row checkbox event. +/// +/// [runtimeType] is [PlutoGridOnRowCheckedAllEvent] if [isAll] is true. +/// When [isAll] is true, it means the entire check button event of the column. +/// +/// [runtimeType] is [PlutoGridOnRowCheckedOneEvent] if [isRow] is true. +/// If [isRow] is true, it means the check button event of a specific row. +abstract class PlutoGridOnRowCheckedEvent { + bool get isAll => runtimeType == PlutoGridOnRowCheckedAllEvent; + + bool get isRow => runtimeType == PlutoGridOnRowCheckedOneEvent; + + final PlutoRow? row; + final int? rowIdx; + final bool? isChecked; + + const PlutoGridOnRowCheckedEvent({ + this.row, + this.rowIdx, + this.isChecked, + }); + + @override + String toString() { + String checkMessage = isAll ? 'All rows ' : 'RowIdx $rowIdx '; + checkMessage += isChecked == true ? 'checked' : 'unchecked'; + return '[PlutoGridOnRowCheckedEvent] $checkMessage'; + } +} + +/// Argument of [PlutoGrid.onRowChecked] callback when the checkbox of the row is tapped. +class PlutoGridOnRowCheckedOneEvent extends PlutoGridOnRowCheckedEvent { + const PlutoGridOnRowCheckedOneEvent({ + required PlutoRow super.row, + required int super.rowIdx, + required super.isChecked, + }); +} + +/// Argument of [PlutoGrid.onRowChecked] callback when all checkboxes of the column are tapped. +class PlutoGridOnRowCheckedAllEvent extends PlutoGridOnRowCheckedEvent { + const PlutoGridOnRowCheckedAllEvent({ + super.isChecked, + }) : super(row: null, rowIdx: null); +} + +/// The argument of the [PlutoGrid.onRowDoubleTap] callback +/// to receive the event of double-tapping the row. +class PlutoGridOnRowDoubleTapEvent { + final PlutoRow row; + final int rowIdx; + final PlutoCell cell; + + const PlutoGridOnRowDoubleTapEvent({ + required this.row, + required this.rowIdx, + required this.cell, + }); +} + +/// Argument of the [PlutoGrid.onRowSecondaryTap] callback +/// to receive the event of tapping the row with the right mouse button. +class PlutoGridOnRowSecondaryTapEvent { + final PlutoRow row; + final int rowIdx; + final PlutoCell cell; + final Offset offset; + + const PlutoGridOnRowSecondaryTapEvent({ + required this.row, + required this.rowIdx, + required this.cell, + required this.offset, + }); +} + +/// Argument of [PlutoGrid.onRowEnter] callback +/// to receive the event of entering the row with the mouse. +class PlutoGridOnRowEnterEvent { + final PlutoRow? row; + final int? rowIdx; + + const PlutoGridOnRowEnterEvent({ + this.row, + this.rowIdx, + }); +} + +/// Argument of [PlutoGrid.onRowExit] callback +/// to receive the event of exiting the row with the mouse. +class PlutoGridOnRowExitEvent { + final PlutoRow? row; + final int? rowIdx; + + const PlutoGridOnRowExitEvent({ + this.row, + this.rowIdx, + }); +} + +/// Argument of [PlutoGrid.onRowsMoved] callback +/// to receive the event of moving the row by dragging it. +class PlutoGridOnRowsMovedEvent { + final int idx; + final List rows; + + const PlutoGridOnRowsMovedEvent({ + required this.idx, + required this.rows, + }); +} + +/// Argument of [PlutoGrid.onColumnsMoved] callback +/// to move columns by dragging or receive left or right fixed events. +/// +/// [idx] means the actual index of +/// [PlutoGridStateManager.columns] or [PlutoGridStateManager.refColumns]. +/// +/// [visualIdx] means the order displayed on the screen, not the actual index. +/// For example, if there are 5 columns of [0, 1, 2, 3, 4] +/// If 1 column is frozen to the right, [visualIndex] becomes 4. +/// But the actual index is preserved. +class PlutoGridOnColumnsMovedEvent { + final int idx; + final int visualIdx; + final List columns; + + const PlutoGridOnColumnsMovedEvent({ + required this.idx, + required this.visualIdx, + required this.columns, + }); + + @override + String toString() { + String text = + '[PlutoGridOnColumnsMovedEvent] idx: $idx, visualIdx: $visualIdx\n'; + + text += columns.map((e) => e.title).join(','); + + return text; + } +} + +/// When the active cell changes this callback is called +class PlutoGridOnActiveCellChangedEvent { + final int idx; + final PlutoCell? cell; + + const PlutoGridOnActiveCellChangedEvent({ + required this.idx, + required this.cell, + }); +} diff --git a/lib/src/pluto_grid_popup.dart b/lib/src/pluto_grid_popup.dart index 710e2c350..9ed7d967d 100644 --- a/lib/src/pluto_grid_popup.dart +++ b/lib/src/pluto_grid_popup.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// [PlutoGridPopup] calls [PlutoGrid] in the form of a popup. class PlutoGridPopup { @@ -38,6 +38,9 @@ class PlutoGridPopup { /// {@macro pluto_grid_property_onRowsMoved} final PlutoOnRowsMovedEventCallback? onRowsMoved; + /// {@macro pluto_grid_property_onActiveCellChanged} + final PlutoOnActiveCellChangedEventCallback? onActiveCellChanged; + /// {@macro pluto_grid_property_onColumnsMoved} final PlutoOnColumnsMovedEventCallback? onColumnsMoved; @@ -75,6 +78,8 @@ class PlutoGridPopup { final double? height; + final bool? barrierDismissible; // + PlutoGridPopup({ required this.context, required this.columns, @@ -88,6 +93,7 @@ class PlutoGridPopup { this.onRowDoubleTap, this.onRowSecondaryTap, this.onRowsMoved, + this.onActiveCellChanged, this.onColumnsMoved, this.createHeader, this.createFooter, @@ -98,10 +104,20 @@ class PlutoGridPopup { this.mode = PlutoGridMode.normal, this.width, this.height, + this.barrierDismissible, }) { open(); } + setColumnConfig() { + columns.map((element) { + if (configuration.style.filterHeaderColor != null) { + element.backgroundColor = configuration.style.filterHeaderColor!; + } + }).toList(); + return columns; + } + Future open() async { final textDirection = Directionality.of(context); @@ -112,6 +128,7 @@ class PlutoGridPopup { PlutoGridOnSelectedEvent? selected = await showDialog( context: context, + barrierDismissible: barrierDismissible ?? true, builder: (BuildContext ctx) { return Dialog( shape: borderRadius == BorderRadius.zero @@ -126,7 +143,7 @@ class PlutoGridPopup { child: Directionality( textDirection: textDirection, child: PlutoGrid( - columns: columns, + columns: setColumnConfig(), rows: rows, columnGroups: columnGroups, onLoaded: onLoaded, @@ -139,6 +156,7 @@ class PlutoGridPopup { onRowDoubleTap: onRowDoubleTap, onRowSecondaryTap: onRowSecondaryTap, onRowsMoved: onRowsMoved, + onActiveCellChanged: onActiveCellChanged, onColumnsMoved: onColumnsMoved, createHeader: createHeader, createFooter: createFooter, diff --git a/lib/src/pluto_grid_settings.dart b/lib/src/pluto_grid_settings.dart new file mode 100644 index 000000000..9c9495399 --- /dev/null +++ b/lib/src/pluto_grid_settings.dart @@ -0,0 +1,58 @@ +import 'package:flutter/material.dart'; + +abstract class PlutoGridSettings { + /// If there is a frozen column, the minimum width of the body + /// (if it is less than the value, the frozen column is released) + static const double bodyMinWidth = 200.0; + + /// Default column width + static const double columnWidth = 200.0; + + /// Column width + static const double minColumnWidth = 80.0; + + /// Frozen column division line (ShadowLine) size + static const double shadowLineSize = 3.0; + + /// Sum of frozen column division line width + static const double totalShadowLineWidth = + PlutoGridSettings.shadowLineSize * 2; + + /// Grid - padding + static const double gridPadding = 2.0; + + /// Grid - border width + static const double gridBorderWidth = 1.0; + + static const double gridInnerSpacing = + (gridPadding * 2) + (gridBorderWidth * 2); + + /// Row - Default row height + static const double rowHeight = 45.0; + + /// Row - border width + static const double rowBorderWidth = 1.0; + + /// Row - total height + static const double rowTotalHeight = rowHeight + rowBorderWidth; + + /// Cell - padding + static const EdgeInsets cellPadding = EdgeInsets.symmetric(horizontal: 10); + + /// Column title - padding + static const EdgeInsets columnTitlePadding = + EdgeInsets.symmetric(horizontal: 10); + + static const EdgeInsets columnFilterPadding = EdgeInsets.all(5); + + /// Cell - fontSize + static const double cellFontSize = 14; + + /// Scroll when multi-selection is as close as that value from the edge + static const double offsetScrollingFromEdge = 10.0; + + /// Size that scrolls from the edge at once when selecting multiple + static const double offsetScrollingFromEdgeAtOnce = 200.0; + + static const int debounceMillisecondsForColumnFilter = 300; +} diff --git a/lib/src/ui/cells/pluto_currency_cell.dart b/lib/src/ui/cells/pluto_currency_cell.dart index 8a23b1a46..216a489cd 100644 --- a/lib/src/ui/cells/pluto_currency_cell.dart +++ b/lib/src/ui/cells/pluto_currency_cell.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'decimal_input_formatter.dart'; import 'text_cell.dart'; @@ -23,8 +23,8 @@ class PlutoCurrencyCell extends StatefulWidget implements TextCell { required this.cell, required this.column, required this.row, - Key? key, - }) : super(key: key); + super.key, + }); @override PlutoCurrencyCellState createState() => PlutoCurrencyCellState(); diff --git a/lib/src/ui/cells/pluto_date_cell.dart b/lib/src/ui/cells/pluto_date_cell.dart index bb5302b49..cf8d3d628 100644 --- a/lib/src/ui/cells/pluto_date_cell.dart +++ b/lib/src/ui/cells/pluto_date_cell.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'popup_cell.dart'; @@ -21,8 +21,8 @@ class PlutoDateCell extends StatefulWidget implements PopupCell { required this.cell, required this.column, required this.row, - Key? key, - }) : super(key: key); + super.key, + }); @override PlutoDateCellState createState() => PlutoDateCellState(); @@ -42,26 +42,33 @@ class PlutoDateCellState extends State IconData? get icon => widget.column.type.date.popupIcon; @override - void openPopup() { + void openPopup() async { if (widget.column.checkReadOnly(widget.row, widget.cell)) { return; } - isOpenedPopup = true; - - PlutoGridDatePicker( - context: context, - initDate: PlutoDateTimeHelper.parseOrNullWithFormat( - widget.cell.value, - widget.column.type.date.format, - ), - startDate: widget.column.type.date.startDate, - endDate: widget.column.type.date.endDate, - dateFormat: widget.column.type.date.dateFormat, - headerDateFormat: widget.column.type.date.headerDateFormat, - onSelected: onSelected, - itemHeight: widget.stateManager.rowTotalHeight, - configuration: widget.stateManager.configuration, - ); + if (widget.stateManager.selectDateCallback != null) { + final sm = widget.stateManager; + final date = await sm.selectDateCallback!(widget.cell, widget.column); + isOpenedPopup = false; + if (date != null) { + handleSelected(widget.column.type.date.dateFormat.format(date)); // Consider call onSelected + } + } else { + PlutoGridDatePicker( + context: context, + initDate: PlutoDateTimeHelper.parseOrNullWithFormat( + widget.cell.value, + widget.column.type.date.format, + ), + startDate: widget.column.type.date.startDate, + endDate: widget.column.type.date.endDate, + dateFormat: widget.column.type.date.dateFormat, + headerDateFormat: widget.column.type.date.headerDateFormat, + onSelected: onSelected, + itemHeight: widget.stateManager.rowTotalHeight, + configuration: widget.stateManager.configuration, + ); + } } } diff --git a/lib/src/ui/cells/pluto_default_cell.dart b/lib/src/ui/cells/pluto_default_cell.dart index ed117d365..d68b955fd 100644 --- a/lib/src/ui/cells/pluto_default_cell.dart +++ b/lib/src/ui/cells/pluto_default_cell.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../ui.dart'; @@ -22,11 +22,42 @@ class PlutoDefaultCell extends PlutoStatefulWidget { required this.rowIdx, required this.row, required this.stateManager, - Key? key, - }) : super(key: key); + super.key, + }); @override State createState() => _PlutoDefaultCellState(); + + static String groupCountText(PlutoRowGroupDelegate delegate, PlutoRow row) { + final compactCount = delegate.enableCompactCount; + final count = compactCount + ? delegate.compactNumber(row.type.group.children.length) + : row.type.group.children.length.toString(); + return '($count)'; + } + + static TextStyle groupCountTextStyle(PlutoGridStyleConfig style) { + return style.cellTextStyle.copyWith( + decoration: TextDecoration.none, + fontWeight: FontWeight.normal, + ); + } + + static bool canExpand(PlutoRowGroupDelegate? delegate, PlutoCell cell) { + if (delegate == null) return false; + if (!cell.row.type.isGroup || !delegate.enabled) { + return false; + } + return delegate.isExpandableCell(cell); + } + + static bool showGroupCount(PlutoRowGroupDelegate? delegate, PlutoCell cell) { + if (delegate == null) return false; + return delegate.enabled && + delegate.isExpandableCell(cell) && + cell.row.type.isGroup && + delegate.showCount; + } } class _PlutoDefaultCellState extends PlutoStateWithChange { @@ -41,24 +72,16 @@ class _PlutoDefaultCellState extends PlutoStateWithChange { @override PlutoGridStateManager get stateManager => widget.stateManager; - bool get _canExpand { - if (!widget.row.type.isGroup || !stateManager.enabledRowGroups) { - return false; - } - - return _isExpandableCell; - } - - bool get _isExpandableCell => - stateManager.rowGroupDelegate!.isExpandableCell(widget.cell); - bool get _showSpacing { if (!stateManager.enabledRowGroups || !stateManager.rowGroupDelegate!.showFirstExpandableIcon) { return false; } - if (_canExpand) return true; + if (PlutoDefaultCell.canExpand( + stateManager.rowGroupDelegate!, widget.cell)) { + return true; + } final parentCell = widget.row.parent?.cells[widget.column.field]; @@ -68,19 +91,6 @@ class _PlutoDefaultCellState extends PlutoStateWithChange { bool get _isEmptyGroup => widget.row.type.group.children.isEmpty; - bool get _showGroupCount => - stateManager.enabledRowGroups && - _isExpandableCell && - widget.row.type.isGroup && - stateManager.rowGroupDelegate!.showCount; - - String get _groupCount => _compactCount - ? stateManager.rowGroupDelegate! - .compactNumber(widget.row.type.group.children.length) - : widget.row.type.group.children.length.toString(); - - bool get _compactCount => stateManager.rowGroupDelegate!.enableCompactCount; - @override void initState() { super.initState(); @@ -119,6 +129,12 @@ class _PlutoDefaultCellState extends PlutoStateWithChange { @override Widget build(BuildContext context) { + int depth = 0; // + PlutoRow? row = widget.row; + while (row?.parent != null) { + depth++; + row = row?.parent; + } final cellWidget = _DefaultCellWidget( stateManager: stateManager, rowIdx: widget.rowIdx, @@ -140,8 +156,10 @@ class _PlutoDefaultCellState extends PlutoStateWithChange { } Widget? expandIcon; - if (_canExpand) { + if (PlutoDefaultCell.canExpand( + stateManager.rowGroupDelegate, widget.cell)) { expandIcon = IconButton( + padding: const EdgeInsets.only(bottom: 0.0), onPressed: _isEmptyGroup ? null : _handleToggleExpandedRowGroup, icon: _isEmptyGroup ? Icon( @@ -177,7 +195,8 @@ class _PlutoDefaultCellState extends PlutoStateWithChange { color: style.iconColor, ), ), - if (widget.column.enableRowChecked) + if (widget.column.enableRowChecked && + depth >= widget.column.rowCheckBoxGroupDepth) CheckboxSelectionWidget( column: widget.column, row: widget.row, @@ -187,13 +206,12 @@ class _PlutoDefaultCellState extends PlutoStateWithChange { if (spacingWidget != null) spacingWidget, if (expandIcon != null) expandIcon, Expanded(child: cellWidget), - if (_showGroupCount) + if (PlutoDefaultCell.showGroupCount( + stateManager.rowGroupDelegate, widget.cell)) Text( - '($_groupCount)', - style: stateManager.configuration.style.cellTextStyle.copyWith( - decoration: TextDecoration.none, - fontWeight: FontWeight.normal, - ), + PlutoDefaultCell.groupCountText( + stateManager.rowGroupDelegate!, widget.row), + style: PlutoDefaultCell.groupCountTextStyle(stateManager.style), ), ]); } @@ -219,8 +237,7 @@ class _RowDragIconWidget extends StatelessWidget { required this.stateManager, required this.dragIcon, required this.feedbackWidget, - Key? key, - }) : super(key: key); + }); List get _draggingRows { if (stateManager.currentSelectingRows.isEmpty) { @@ -398,9 +415,9 @@ class CheckboxSelectionWidgetState handleOnChanged: _handleOnChanged, tristate: _tristate, scale: 0.86, - unselectedColor: stateManager.configuration.style.iconColor, - activeColor: stateManager.configuration.style.activatedBorderColor, - checkColor: stateManager.configuration.style.activatedColor, + unselectedColor: stateManager.configuration.style.cellUnselectedColor, + activeColor: stateManager.configuration.style.cellActiveColor, + checkColor: stateManager.configuration.style.cellCheckedColor, ); } } @@ -422,8 +439,7 @@ class _DefaultCellWidget extends StatelessWidget { required this.row, required this.column, required this.cell, - Key? key, - }) : super(key: key); + }); bool get _showText { if (!stateManager.enabledRowGroups) { diff --git a/lib/src/ui/cells/pluto_number_cell.dart b/lib/src/ui/cells/pluto_number_cell.dart index 19c901cda..757f0ef50 100644 --- a/lib/src/ui/cells/pluto_number_cell.dart +++ b/lib/src/ui/cells/pluto_number_cell.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'decimal_input_formatter.dart'; import 'text_cell.dart'; @@ -23,8 +23,8 @@ class PlutoNumberCell extends StatefulWidget implements TextCell { required this.cell, required this.column, required this.row, - Key? key, - }) : super(key: key); + super.key, + }); @override PlutoNumberCellState createState() => PlutoNumberCellState(); diff --git a/lib/src/ui/cells/pluto_select_cell.dart b/lib/src/ui/cells/pluto_select_cell.dart index b5b6ecd2d..f96f649a7 100644 --- a/lib/src/ui/cells/pluto_select_cell.dart +++ b/lib/src/ui/cells/pluto_select_cell.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'popup_cell.dart'; @@ -21,8 +21,8 @@ class PlutoSelectCell extends StatefulWidget implements PopupCell { required this.cell, required this.column, required this.row, - Key? key, - }) : super(key: key); + super.key, + }); @override PlutoSelectCellState createState() => PlutoSelectCellState(); @@ -58,12 +58,13 @@ class PlutoSelectCellState extends State columnFilterHeight + rowsHeight + PlutoGridSettings.gridInnerSpacing + - PlutoGridSettings.gridBorderWidth; + widget.stateManager.configuration.style.gridBorderWidth; fieldOnSelected = widget.column.title; popupColumns = [ PlutoColumn( + width: widget.column.type.select.width ?? PlutoGridSettings.columnWidth, title: widget.column.title, field: widget.column.title, readOnly: true, @@ -72,6 +73,14 @@ class PlutoSelectCellState extends State enableFilterMenuItem: enableColumnFilter, enableHideColumnMenuItem: false, enableSetColumnsMenuItem: false, + renderer: widget.column.type.select.builder == null + ? null + : (rendererContext) { + var item = + widget.column.type.select.items[rendererContext.rowIdx]; + + return widget.column.type.select.builder!(item); + }, ) ]; @@ -84,6 +93,12 @@ class PlutoSelectCellState extends State }).toList(); } + @override + void onSelected(PlutoGridOnSelectedEvent event) { + widget.column.type.select.onItemSelected(event); + super.onSelected(event); + } + @override void onLoaded(PlutoGridOnLoadedEvent event) { super.onLoaded(event); diff --git a/lib/src/ui/cells/pluto_text_cell.dart b/lib/src/ui/cells/pluto_text_cell.dart index f15eda94a..852862412 100644 --- a/lib/src/ui/cells/pluto_text_cell.dart +++ b/lib/src/ui/cells/pluto_text_cell.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'text_cell.dart'; @@ -21,8 +21,8 @@ class PlutoTextCell extends StatefulWidget implements TextCell { required this.cell, required this.column, required this.row, - Key? key, - }) : super(key: key); + super.key, + }); @override PlutoTextCellState createState() => PlutoTextCellState(); diff --git a/lib/src/ui/cells/pluto_time_cell.dart b/lib/src/ui/cells/pluto_time_cell.dart index 52a13da72..ec6bf9b9d 100644 --- a/lib/src/ui/cells/pluto_time_cell.dart +++ b/lib/src/ui/cells/pluto_time_cell.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'popup_cell.dart'; @@ -21,8 +21,8 @@ class PlutoTimeCell extends StatefulWidget implements PopupCell { required this.cell, required this.column, required this.row, - Key? key, - }) : super(key: key); + super.key, + }); @override PlutoTimeCellState createState() => PlutoTimeCellState(); diff --git a/lib/src/ui/cells/popup_cell.dart b/lib/src/ui/cells/popup_cell.dart index e2e6149da..ae9af6114 100644 --- a/lib/src/ui/cells/popup_cell.dart +++ b/lib/src/ui/cells/popup_cell.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class PopupCell extends StatefulWidget { final PlutoGridStateManager stateManager; @@ -15,8 +15,8 @@ abstract class PopupCell extends StatefulWidget { required this.cell, required this.column, required this.row, - Key? key, - }) : super(key: key); + super.key, + }); } abstract class GridPopupProps { @@ -62,7 +62,7 @@ mixin PopupCellState on State ..text = widget.column.formattedValueForDisplayInEditing(widget.cell.value); - textFocus = FocusNode(onKey: _handleKeyboardFocusOnKey); + textFocus = FocusNode(onKeyEvent: _handleKeyboardFocusOnKey); } @override @@ -175,7 +175,7 @@ mixin PopupCellState on State } } - KeyEventResult _handleKeyboardFocusOnKey(FocusNode node, RawKeyEvent event) { + KeyEventResult _handleKeyboardFocusOnKey(FocusNode node, KeyEvent event) { var keyManager = PlutoKeyManagerEvent( focusNode: node, event: event, diff --git a/lib/src/ui/cells/text_cell.dart b/lib/src/ui/cells/text_cell.dart index b007e4f35..631ee6f6c 100644 --- a/lib/src/ui/cells/text_cell.dart +++ b/lib/src/ui/cells/text_cell.dart @@ -1,8 +1,8 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/helper/platform_helper.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/helper/platform_helper.dart'; abstract class TextCell extends StatefulWidget { final PlutoGridStateManager stateManager; @@ -18,8 +18,8 @@ abstract class TextCell extends StatefulWidget { required this.cell, required this.column, required this.row, - Key? key, - }) : super(key: key); + super.key, + }); } abstract class TextFieldProps { @@ -52,7 +52,7 @@ mixin TextCellState on State implements TextFieldProps { void initState() { super.initState(); - cellFocus = FocusNode(onKey: _handleOnKey); + cellFocus = FocusNode(onKeyEvent: _handleOnKey); widget.stateManager.setTextEditingController(_textController); @@ -172,7 +172,7 @@ mixin TextCellState on State implements TextFieldProps { }); } - KeyEventResult _handleOnKey(FocusNode node, RawKeyEvent event) { + KeyEventResult _handleOnKey(FocusNode node, KeyEvent event) { var keyManager = PlutoKeyManagerEvent( focusNode: node, event: event, @@ -231,7 +231,7 @@ mixin TextCellState on State implements TextFieldProps { cellFocus.requestFocus(); } - return TextField( + Widget w = TextField( focusNode: cellFocus, controller: _textController, readOnly: widget.column.checkReadOnly(widget.row, widget.cell), @@ -252,6 +252,12 @@ mixin TextCellState on State implements TextFieldProps { textAlignVertical: TextAlignVertical.center, textAlign: widget.column.textAlign.value, ); + + if (widget.stateManager.editCellWrapper != null) { + w = widget.stateManager.editCellWrapper!(w, widget.cell, _textController); + } + + return w; } } diff --git a/lib/src/ui/columns/pluto_column_filter.dart b/lib/src/ui/columns/pluto_column_filter.dart index da1749122..e669d5152 100644 --- a/lib/src/ui/columns/pluto_column_filter.dart +++ b/lib/src/ui/columns/pluto_column_filter.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../ui.dart'; @@ -83,7 +83,7 @@ class PlutoColumnFilterState extends PlutoStateWithChange { initState() { super.initState(); - _focusNode = FocusNode(onKey: _handleOnKey); + _focusNode = FocusNode(onKeyEvent: _handleOnKey); widget.column.setFilterFocusNode(_focusNode); @@ -145,7 +145,7 @@ class PlutoColumnFilterState extends PlutoStateWithChange { stateManager.notifyListeners(); } - KeyEventResult _handleOnKey(FocusNode node, RawKeyEvent event) { + KeyEventResult _handleOnKey(FocusNode node, KeyEvent event) { var keyManager = PlutoKeyManagerEvent( focusNode: node, event: event, @@ -227,6 +227,7 @@ class PlutoColumnFilterState extends PlutoStateWithChange { column: widget.column, filterType: widget.column.defaultFilter, filterValue: changed, + eventType: PlutoGridEventType.debounce, debounceMilliseconds: stateManager.configuration.columnFilter.debounceMilliseconds, ), @@ -254,27 +255,32 @@ class PlutoColumnFilterState extends PlutoStateWithChange { ), child: Padding( padding: _padding, - child: Center( - child: TextField( - focusNode: _focusNode, - controller: _controller, - enabled: _enabled, - style: style.cellTextStyle, - onTap: _handleOnTap, - onChanged: _handleOnChanged, - onEditingComplete: _handleOnEditingComplete, - decoration: InputDecoration( - hintText: _enabled ? widget.column.defaultFilter.title : '', - filled: true, - fillColor: _textFieldColor, - border: _border, - enabledBorder: _border, - disabledBorder: _disabledBorder, - focusedBorder: _enabledBorder, - contentPadding: const EdgeInsets.all(5), + child: widget.column.filterWidget ?? + widget.column.filterWidgetBuilder?.call(_focusNode, _controller, + _enabled, _handleOnChanged, stateManager) ?? + TextField( + focusNode: _focusNode, + controller: _controller, + enabled: _enabled, + style: style.cellTextStyle, + onTap: _handleOnTap, + onChanged: _handleOnChanged, + onEditingComplete: _handleOnEditingComplete, + decoration: InputDecoration( + suffixIcon: widget.column.filterSuffixIcon, + hintText: widget.column.filterHintText ?? + (_enabled ? widget.column.defaultFilter.title : ''), + filled: true, + hintStyle: + TextStyle(color: widget.column.filterHintTextColor), + fillColor: _textFieldColor, + border: _border, + enabledBorder: _border, + disabledBorder: _disabledBorder, + focusedBorder: _enabledBorder, + contentPadding: const EdgeInsets.all(5), + ), ), - ), - ), ), ), ); diff --git a/lib/src/ui/columns/pluto_column_title.dart b/lib/src/ui/columns/pluto_column_title.dart index a9d46cd0f..79f75573b 100644 --- a/lib/src/ui/columns/pluto_column_title.dart +++ b/lib/src/ui/columns/pluto_column_title.dart @@ -1,7 +1,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../ui.dart'; @@ -205,8 +205,8 @@ class PlutoGridColumnIcon extends StatelessWidget { this.icon = Icons.dehaze, this.ascendingIcon, this.descendingIcon, - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { @@ -248,8 +248,7 @@ class _DraggableWidget extends StatelessWidget { required this.stateManager, required this.column, required this.child, - Key? key, - }) : super(key: key); + }); void _handleOnPointerMove(PointerMoveEvent event) { stateManager.eventManager!.addEvent(PlutoGridScrollUpdateEvent( @@ -307,11 +306,10 @@ class _SortableWidget extends StatelessWidget { final Widget child; const _SortableWidget({ - Key? key, required this.stateManager, required this.column, required this.child, - }) : super(key: key); + }); void _onTap() { stateManager.toggleSortColumn(column); @@ -343,8 +341,7 @@ class _ColumnWidget extends StatelessWidget { required this.stateManager, required this.column, required this.height, - Key? key, - }) : super(key: key); + }); EdgeInsets get padding => column.titlePadding ?? @@ -357,17 +354,17 @@ class _ColumnWidget extends StatelessWidget { @override Widget build(BuildContext context) { return DragTarget( - onWillAccept: (PlutoColumn? columnToDrag) { - return columnToDrag != null && - columnToDrag.key != column.key && + onWillAcceptWithDetails: (columnToDrag) { + return columnToDrag.data.key != column.key && !stateManager.limitMoveColumn( - column: columnToDrag, + column: columnToDrag.data, targetColumn: column, ); }, - onAccept: (PlutoColumn columnToMove) { - if (columnToMove.key != column.key) { - stateManager.moveColumn(column: columnToMove, targetColumn: column); + onAcceptWithDetails: (columnToMove) { + if (columnToMove.data.key != column.key) { + stateManager.moveColumn( + column: columnToMove.data, targetColumn: column); } }, builder: (dragContext, candidate, rejected) { @@ -380,9 +377,12 @@ class _ColumnWidget extends StatelessWidget { height: height, child: DecoratedBox( decoration: BoxDecoration( - color: noDragTarget - ? column.backgroundColor - : style.dragTargetColumnColor, + gradient: column.backgroundGradient, // + color: column.backgroundGradient == null + ? (noDragTarget + ? column.backgroundColor + : style.dragTargetColumnColor) + : null, border: BorderDirectional( end: style.enableColumnBorderVertical ? BorderSide(color: style.borderColor, width: 1.0) @@ -395,7 +395,9 @@ class _ColumnWidget extends StatelessWidget { alignment: Alignment.centerLeft, child: Row( children: [ - if (column.enableRowChecked) + if (column.enableRowChecked && + column.rowCheckBoxGroupDepth == 0 && + column.enableTitleChecked) CheckboxAllSelectionWidget(stateManager: stateManager), Expanded( child: _ColumnTextWidget( @@ -419,8 +421,7 @@ class _ColumnWidget extends StatelessWidget { class CheckboxAllSelectionWidget extends PlutoStatefulWidget { final PlutoGridStateManager stateManager; - const CheckboxAllSelectionWidget({required this.stateManager, Key? key}) - : super(key: key); + const CheckboxAllSelectionWidget({required this.stateManager, super.key}); @override CheckboxAllSelectionWidgetState createState() => @@ -478,9 +479,9 @@ class CheckboxAllSelectionWidgetState handleOnChanged: _handleOnChanged, tristate: true, scale: 0.86, - unselectedColor: stateManager.configuration.style.iconColor, - activeColor: stateManager.configuration.style.activatedBorderColor, - checkColor: stateManager.configuration.style.activatedColor, + unselectedColor: stateManager.configuration.style.columnUnselectedColor, + activeColor: stateManager.configuration.style.columnActiveColor, + checkColor: stateManager.configuration.style.columnCheckedColor, ); } } @@ -496,8 +497,7 @@ class _ColumnTextWidget extends PlutoStatefulWidget { required this.stateManager, required this.column, required this.height, - Key? key, - }) : super(key: key); + }); @override _ColumnTextWidgetState createState() => _ColumnTextWidgetState(); diff --git a/lib/src/ui/miscellaneous/pluto_no_rows_widget.dart b/lib/src/ui/miscellaneous/pluto_no_rows_widget.dart index 4bf682067..c3981d1a7 100644 --- a/lib/src/ui/miscellaneous/pluto_no_rows_widget.dart +++ b/lib/src/ui/miscellaneous/pluto_no_rows_widget.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../ui.dart'; diff --git a/lib/src/ui/miscellaneous/pluto_state_with_change.dart b/lib/src/ui/miscellaneous/pluto_state_with_change.dart index 7e214deda..edbdf8486 100644 --- a/lib/src/ui/miscellaneous/pluto_state_with_change.dart +++ b/lib/src/ui/miscellaneous/pluto_state_with_change.dart @@ -1,10 +1,10 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; abstract class PlutoStatefulWidget extends StatefulWidget { - const PlutoStatefulWidget({Key? key}) : super(key: key); + const PlutoStatefulWidget({super.key}); } abstract class PlutoStateWithChange diff --git a/lib/src/ui/miscellaneous/pluto_visibility_layout.dart b/lib/src/ui/miscellaneous/pluto_visibility_layout.dart index 6cd1bef00..26fb19af0 100644 --- a/lib/src/ui/miscellaneous/pluto_visibility_layout.dart +++ b/lib/src/ui/miscellaneous/pluto_visibility_layout.dart @@ -3,7 +3,7 @@ import 'dart:collection'; import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// It is used to lay out the widgets /// of [PlutoCell] or [PlutoColumn], [PlutoColumnGroup] of [PlutoRow] @@ -391,10 +391,10 @@ class PlutoVisibilityLayoutRenderObjectElement extends RenderObjectElement class PlutoVisibilityLayoutId extends LayoutId { PlutoVisibilityLayoutId({ - Key? key, + super.key, required super.id, - required PlutoVisibilityLayoutChild child, - }) : super(key: key, child: child); + required PlutoVisibilityLayoutChild super.child, + }); PlutoVisibilityLayoutChild get layoutChild => child as PlutoVisibilityLayoutChild; diff --git a/lib/src/ui/pluto_base_cell.dart b/lib/src/ui/pluto_base_cell.dart index 2dabd63c4..991cfec91 100644 --- a/lib/src/ui/pluto_base_cell.dart +++ b/lib/src/ui/pluto_base_cell.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/helper/platform_helper.dart'; +import 'package:pluto_grid_plus/src/helper/pluto_double_tap_detector.dart'; import 'ui.dart'; @@ -16,13 +18,13 @@ class PlutoBaseCell extends StatelessWidget final PlutoGridStateManager stateManager; const PlutoBaseCell({ - Key? key, + super.key, required this.cell, required this.column, required this.rowIdx, required this.row, required this.stateManager, - }) : super(key: key); + }); @override double get width => column.width; @@ -46,6 +48,12 @@ class PlutoBaseCell extends StatelessWidget } void _handleOnTapUp(TapUpDetails details) { + if (PlatformHelper.isDesktop && + PlutoDoubleTapDetector.isDoubleTap(cell) && + stateManager.onRowDoubleTap != null) { + _handleOnDoubleTap(); + return; + } _addGestureEvent(PlutoGridGestureType.onTapUp, details.globalPosition); } @@ -94,6 +102,9 @@ class PlutoBaseCell extends StatelessWidget } void Function()? _onDoubleTapOrNull() { + if (PlatformHelper.isDesktop) { + return null; + } return stateManager.onRowDoubleTap == null ? null : _handleOnDoubleTap; } @@ -319,8 +330,7 @@ class _Cell extends PlutoStatefulWidget { required this.row, required this.column, required this.cell, - Key? key, - }) : super(key: key); + }); @override State<_Cell> createState() => _CellState(); diff --git a/lib/src/ui/pluto_base_column.dart b/lib/src/ui/pluto_base_column.dart index 61f651533..38711ca16 100644 --- a/lib/src/ui/pluto_base_column.dart +++ b/lib/src/ui/pluto_base_column.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui.dart'; diff --git a/lib/src/ui/pluto_base_column_footer.dart b/lib/src/ui/pluto_base_column_footer.dart index b721882c9..844beb83b 100644 --- a/lib/src/ui/pluto_base_column_footer.dart +++ b/lib/src/ui/pluto_base_column_footer.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui.dart'; diff --git a/lib/src/ui/pluto_base_column_group.dart b/lib/src/ui/pluto_base_column_group.dart index 84d434976..c3155afc0 100644 --- a/lib/src/ui/pluto_base_column_group.dart +++ b/lib/src/ui/pluto_base_column_group.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui.dart'; diff --git a/lib/src/ui/pluto_base_row.dart b/lib/src/ui/pluto_base_row.dart index 598098294..0c2a7d930 100644 --- a/lib/src/ui/pluto_base_row.dart +++ b/lib/src/ui/pluto_base_row.dart @@ -1,6 +1,7 @@ import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/manager/event/pluto_grid_row_hover_event.dart'; import 'ui.dart'; @@ -24,11 +25,11 @@ class PlutoBaseRow extends StatelessWidget { super.key, }); - bool _checkSameDragRows(PlutoRow draggingRow) { + bool _checkSameDragRows(DragTargetDetails draggingRow) { final List selectedRows = stateManager.currentSelectingRows.isNotEmpty ? stateManager.currentSelectingRows - : [draggingRow]; + : [draggingRow.data]; final end = rowIdx + selectedRows.length; @@ -41,18 +42,14 @@ class PlutoBaseRow extends StatelessWidget { return true; } - bool _handleOnWillAccept(PlutoRow? draggingRow) { - if (draggingRow == null) { - return false; - } - + bool _handleOnWillAccept(DragTargetDetails draggingRow) { return !_checkSameDragRows(draggingRow); } - void _handleOnAccept(PlutoRow draggingRow) async { + void _handleOnAccept(DragTargetDetails draggingRow) async { final draggingRows = stateManager.currentSelectingRows.isNotEmpty ? stateManager.currentSelectingRows - : [draggingRow]; + : [draggingRow.data]; stateManager.eventManager!.addEvent( PlutoGridDragRowsEvent( @@ -108,12 +105,36 @@ class PlutoBaseRow extends StatelessWidget { ); } + void _handleOnEnter() { + // set hovered row index + stateManager.eventManager!.addEvent( + PlutoGridRowHoverEvent( + rowIdx: rowIdx, + isHovered: true, + ), + ); + } + + void _handleOnExit() { + // reset hovered row index + stateManager.eventManager!.addEvent( + PlutoGridRowHoverEvent( + rowIdx: rowIdx, + isHovered: false, + ), + ); + } + @override Widget build(BuildContext context) { - return DragTarget( - onWillAccept: _handleOnWillAccept, - onAccept: _handleOnAccept, - builder: _dragTargetBuilder, + return MouseRegion( + onEnter: (event) => _handleOnEnter(), + onExit: (event) => _handleOnExit(), + child: DragTarget( + onWillAcceptWithDetails: _handleOnWillAccept, + onAcceptWithDetails: _handleOnAccept, + builder: _dragTargetBuilder, + ), ); } } @@ -192,8 +213,8 @@ class _RowContainerWidget extends PlutoStatefulWidget { required this.row, required this.enableRowColorAnimation, required this.child, - Key? key, - }) : super(key: key); + super.key, + }); @override State<_RowContainerWidget> createState() => _RowContainerWidgetState(); @@ -255,6 +276,7 @@ class _RowContainerWidgetState extends PlutoStateWithChange<_RowContainerWidget> required bool isSelecting, required bool hasCurrentSelectingPosition, required bool isCheckedRow, + required bool isHovered, }) { Color color = _getDefaultRowColor(); @@ -270,11 +292,21 @@ class _RowContainerWidgetState extends PlutoStateWithChange<_RowContainerWidget> if (checkCurrentRow || checkSelectedRow) { color = stateManager.configuration.style.activatedColor; + } else { + // If the row is checked, the hover color is not applied. + // If the row is hovered and hover color is enabled, + // the configuration hover color is used. + bool enableRowHoverColor = + stateManager.configuration.style.enableRowHoverColor; + if (isHovered && enableRowHoverColor) { + color = stateManager.configuration.style.rowHoveredColor; + } } } return isCheckedRow - ? Color.alphaBlend(stateManager.configuration.style.checkedColor, color) + ? Color.alphaBlend( + stateManager.configuration.style.rowCheckedColor, color) : color; } @@ -306,12 +338,15 @@ class _RowContainerWidgetState extends PlutoStateWithChange<_RowContainerWidget> final bool isFocusedCurrentRow = isCurrentRow && stateManager.hasFocus; + final bool isHovered = stateManager.isRowIdxHovered(widget.rowIdx); + final Color rowColor = _getRowColor( isDragTarget: isDragTarget, isFocusedCurrentRow: isFocusedCurrentRow, isSelecting: isSelecting, hasCurrentSelectingPosition: hasCurrentSelectingPosition, isCheckedRow: isCheckedRow, + isHovered: isHovered, ); return BoxDecoration( @@ -361,8 +396,7 @@ class _AnimatedOrNormalContainer extends StatelessWidget { required this.enable, required this.child, required this.decoration, - Key? key, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/ui/pluto_body_columns.dart b/lib/src/ui/pluto_body_columns.dart index 417c34a11..154d9d948 100644 --- a/lib/src/ui/pluto_body_columns.dart +++ b/lib/src/ui/pluto_body_columns.dart @@ -1,7 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui.dart'; diff --git a/lib/src/ui/pluto_body_columns_footer.dart b/lib/src/ui/pluto_body_columns_footer.dart index 264747485..1cce136f3 100644 --- a/lib/src/ui/pluto_body_columns_footer.dart +++ b/lib/src/ui/pluto_body_columns_footer.dart @@ -1,7 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui.dart'; diff --git a/lib/src/ui/pluto_body_rows.dart b/lib/src/ui/pluto_body_rows.dart index fc37f7209..558611f0b 100644 --- a/lib/src/ui/pluto_body_rows.dart +++ b/lib/src/ui/pluto_body_rows.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../helper/platform_helper.dart'; import 'ui.dart'; @@ -101,10 +101,12 @@ class PlutoBodyRowsState extends PlutoStateWithChange { scrollDirection: Axis.vertical, physics: const ClampingScrollPhysics(), itemCount: _rows.length, - itemExtent: stateManager.rowTotalHeight, + itemExtent: stateManager.rowWrapper != null + ? null + : stateManager.rowTotalHeight, addRepaintBoundaries: false, itemBuilder: (ctx, i) { - return PlutoBaseRow( + Widget row = PlutoBaseRow( key: ValueKey('body_row_${_rows[i].key}'), rowIdx: i, row: _rows[i], @@ -112,6 +114,10 @@ class PlutoBodyRowsState extends PlutoStateWithChange { stateManager: stateManager, visibilityLayout: true, ); + + return stateManager.rowWrapper + ?.call(context, row, stateManager) ?? + row; }, ), ), diff --git a/lib/src/ui/pluto_left_frozen_columns.dart b/lib/src/ui/pluto_left_frozen_columns.dart index 6329ad9c8..27d0c818d 100644 --- a/lib/src/ui/pluto_left_frozen_columns.dart +++ b/lib/src/ui/pluto_left_frozen_columns.dart @@ -1,6 +1,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui.dart'; diff --git a/lib/src/ui/pluto_left_frozen_columns_footer.dart b/lib/src/ui/pluto_left_frozen_columns_footer.dart index 5708813db..9a6426d32 100644 --- a/lib/src/ui/pluto_left_frozen_columns_footer.dart +++ b/lib/src/ui/pluto_left_frozen_columns_footer.dart @@ -1,6 +1,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui.dart'; diff --git a/lib/src/ui/pluto_left_frozen_rows.dart b/lib/src/ui/pluto_left_frozen_rows.dart index 9cb6a0eb4..984cb1f80 100644 --- a/lib/src/ui/pluto_left_frozen_rows.dart +++ b/lib/src/ui/pluto_left_frozen_rows.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui.dart'; diff --git a/lib/src/ui/pluto_right_frozen_columns.dart b/lib/src/ui/pluto_right_frozen_columns.dart index e7a37f253..eb9a46d8a 100644 --- a/lib/src/ui/pluto_right_frozen_columns.dart +++ b/lib/src/ui/pluto_right_frozen_columns.dart @@ -1,6 +1,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui.dart'; diff --git a/lib/src/ui/pluto_right_frozen_columns_footer.dart b/lib/src/ui/pluto_right_frozen_columns_footer.dart index dc5200f59..2570666a0 100644 --- a/lib/src/ui/pluto_right_frozen_columns_footer.dart +++ b/lib/src/ui/pluto_right_frozen_columns_footer.dart @@ -1,6 +1,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui.dart'; diff --git a/lib/src/ui/pluto_right_frozen_rows.dart b/lib/src/ui/pluto_right_frozen_rows.dart index 90244f1af..67e6b33f4 100644 --- a/lib/src/ui/pluto_right_frozen_rows.dart +++ b/lib/src/ui/pluto_right_frozen_rows.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'ui.dart'; diff --git a/lib/src/widgets/pluto_linked_scroll_controller.dart b/lib/src/widgets/pluto_linked_scroll_controller.dart index aed1fc30e..ad9e88ece 100644 --- a/lib/src/widgets/pluto_linked_scroll_controller.dart +++ b/lib/src/widgets/pluto_linked_scroll_controller.dart @@ -135,9 +135,8 @@ class _LinkedScrollController extends ScrollController { final LinkedScrollControllerGroup _controllers; _LinkedScrollController(this._controllers, - {required double initialScrollOffset}) - : super( - initialScrollOffset: initialScrollOffset, keepScrollOffset: false); + {required super.initialScrollOffset}) + : super(keepScrollOffset: false); @override void dispose() { @@ -211,16 +210,11 @@ class _LinkedScrollController extends ScrollController { class _LinkedScrollPosition extends ScrollPositionWithSingleContext { _LinkedScrollPosition( this.owner, { - required ScrollPhysics physics, - required ScrollContext context, - double? initialPixels, - ScrollPosition? oldPosition, - }) : super( - physics: physics, - context: context, - initialPixels: initialPixels, - oldPosition: oldPosition, - ); + required super.physics, + required super.context, + super.initialPixels = null, + super.oldPosition, + }); final _LinkedScrollController owner; @@ -329,7 +323,7 @@ class _LinkedScrollPosition extends ScrollPositionWithSingleContext { } class _LinkedScrollActivity extends ScrollActivity { - _LinkedScrollActivity(_LinkedScrollPosition delegate) : super(delegate); + _LinkedScrollActivity(_LinkedScrollPosition super.delegate); @override _LinkedScrollPosition get delegate => super.delegate as _LinkedScrollPosition; diff --git a/lib/src/widgets/pluto_loading.dart b/lib/src/widgets/pluto_loading.dart index 6feae1bc4..6a662a8af 100644 --- a/lib/src/widgets/pluto_loading.dart +++ b/lib/src/widgets/pluto_loading.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Widget that is displayed when loading is enabled /// with the [PlutoGridStateManager.setShowLoading] method. diff --git a/lib/src/widgets/pluto_scaled_checkbox.dart b/lib/src/widgets/pluto_scaled_checkbox.dart index e2f7ee0e4..e98308546 100644 --- a/lib/src/widgets/pluto_scaled_checkbox.dart +++ b/lib/src/widgets/pluto_scaled_checkbox.dart @@ -16,7 +16,7 @@ class PlutoScaledCheckbox extends StatelessWidget { final Color checkColor; const PlutoScaledCheckbox({ - Key? key, + super.key, required this.value, required this.handleOnChanged, this.tristate = false, @@ -24,7 +24,7 @@ class PlutoScaledCheckbox extends StatelessWidget { this.unselectedColor = Colors.black26, this.activeColor = Colors.lightBlue, this.checkColor = const Color(0xFFDCF5FF), - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/pluto_scrollbar.dart b/lib/src/widgets/pluto_scrollbar.dart index 007459967..894468551 100644 --- a/lib/src/widgets/pluto_scrollbar.dart +++ b/lib/src/widgets/pluto_scrollbar.dart @@ -34,7 +34,7 @@ const double _kScrollbarCrossAxisMargin = 3.0; class PlutoScrollbar extends StatefulWidget { const PlutoScrollbar({ - Key? key, + super.key, this.horizontalController, this.verticalController, this.isAlwaysShown = false, @@ -60,8 +60,7 @@ class PlutoScrollbar extends StatefulWidget { crossAxisMargin = crossAxisMargin ?? _kScrollbarCrossAxisMargin, scrollBarColor = scrollBarColor ?? _kScrollbarColor, scrollBarTrackColor = scrollBarTrackColor ?? _kTrackColor, - longPressDuration = longPressDuration ?? _kScrollbarLongPressDuration, - super(key: key); + longPressDuration = longPressDuration ?? _kScrollbarLongPressDuration; final ScrollController? horizontalController; final ScrollController? verticalController; @@ -1384,19 +1383,11 @@ String shortHash(Object? object) { // thumb and ignores everything else. class _ThumbPressGestureRecognizer extends LongPressGestureRecognizer { _ThumbPressGestureRecognizer({ - double? postAcceptSlopTolerance, - Set? supportedDevices, required GlobalKey customPaintKey, - required Object debugOwner, - required Duration duration, + required Object super.debugOwner, + required Duration super.duration, this.onlyDraggingThumb = false, - }) : _customPaintKey = customPaintKey, - super( - postAcceptSlopTolerance: postAcceptSlopTolerance, - supportedDevices: supportedDevices, - debugOwner: debugOwner, - duration: duration, - ); + }) : _customPaintKey = customPaintKey; final GlobalKey _customPaintKey; final bool onlyDraggingThumb; diff --git a/lib/src/widgets/pluto_shadow_container.dart b/lib/src/widgets/pluto_shadow_container.dart index 3b003a0b5..c68087ec5 100644 --- a/lib/src/widgets/pluto_shadow_container.dart +++ b/lib/src/widgets/pluto_shadow_container.dart @@ -16,7 +16,7 @@ class PlutoShadowContainer extends StatelessWidget { final Widget child; const PlutoShadowContainer({ - Key? key, + super.key, required this.width, required this.height, required this.child, @@ -26,7 +26,7 @@ class PlutoShadowContainer extends StatelessWidget { this.backgroundColor = Colors.white, this.borderColor = const Color(0xFFA1A5AE), this.alignment = Alignment.centerLeft, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/lib/src/widgets/pluto_shadow_line.dart b/lib/src/widgets/pluto_shadow_line.dart index d314037fd..0496cccbb 100644 --- a/lib/src/widgets/pluto_shadow_line.dart +++ b/lib/src/widgets/pluto_shadow_line.dart @@ -11,8 +11,8 @@ class PlutoShadowLine extends StatelessWidget { this.reverse, this.color, this.shadow, - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { diff --git a/packages/pluto_grid_export/CHANGELOG.md b/packages/pluto_grid_export/CHANGELOG.md deleted file mode 100644 index 29f86e551..000000000 --- a/packages/pluto_grid_export/CHANGELOG.md +++ /dev/null @@ -1,12 +0,0 @@ -## [1.0.2] - 2022. 6. 8 - -* Export of required classes. - -## [1.0.1] - 2022. 5. 29 - -* Updated for pub score. - - -## [1.0.0] - 2022. 5. 25 - -* Convert data from PlutoGrid to CSV and PDF. diff --git a/packages/pluto_grid_export/example/windows/flutter/generated_plugin_registrant.h b/packages/pluto_grid_export/example/windows/flutter/generated_plugin_registrant.h deleted file mode 100644 index dc139d85a..000000000 --- a/packages/pluto_grid_export/example/windows/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void RegisterPlugins(flutter::PluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/packages/pluto_grid_export/pubspec.yaml b/packages/pluto_grid_export/pubspec.yaml deleted file mode 100644 index 5f1c94844..000000000 --- a/packages/pluto_grid_export/pubspec.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: pluto_grid_export -description: PlutoGridExport converts PlutoGrid's metadata to CSV or PDF. Used with PlutoGrid. -version: 1.0.2 -homepage: https://bosskmk.github.io -repository: https://github.com/bosskmk/pluto_grid/tree/master/packages/pluto_grid_export -publish_to: none - -environment: - sdk: ">=2.17.0 <3.0.0" - flutter: ">=2.5.0" - -dependencies: - flutter: - sdk: flutter - pluto_grid: - path: ../.. - csv: ^5.0.1 - pdf: ^3.8.3 - printing: ^5.9.3 - -dev_dependencies: - flutter_test: - sdk: flutter - mockito: ^5.3.2 - build_runner: ^2.3.0 - flutter_lints: ^2.0.1 diff --git a/packages/pluto_grid_export/.gitignore b/packages/pluto_grid_plus_export/.gitignore similarity index 100% rename from packages/pluto_grid_export/.gitignore rename to packages/pluto_grid_plus_export/.gitignore diff --git a/packages/pluto_grid_export/.pubignore b/packages/pluto_grid_plus_export/.pubignore similarity index 100% rename from packages/pluto_grid_export/.pubignore rename to packages/pluto_grid_plus_export/.pubignore diff --git a/packages/pluto_grid_plus_export/CHANGELOG.md b/packages/pluto_grid_plus_export/CHANGELOG.md new file mode 100644 index 000000000..82f28319d --- /dev/null +++ b/packages/pluto_grid_plus_export/CHANGELOG.md @@ -0,0 +1,21 @@ +## [1.0.5] - 2024. 5. 15 +upgrade for flutter 3.22.0 & pluto_grid_plus 8.4.1 + +## [1.0.4] - 2024. 2. 18 +* Change repo path & class name in readme + +## [1.0.3] - 2024. 2. 18 +* Change repo path in readme + +## [1.0.2] - 2022. 6. 8 + +* Export of required classes. + +## [1.0.1] - 2022. 5. 29 + +* Updated for pub score. + + +## [1.0.0] - 2022. 5. 25 + +* Convert data from PlutoGrid to CSV and PDF. diff --git a/packages/pluto_grid_export/LICENSE b/packages/pluto_grid_plus_export/LICENSE similarity index 100% rename from packages/pluto_grid_export/LICENSE rename to packages/pluto_grid_plus_export/LICENSE diff --git a/packages/pluto_grid_export/README.md b/packages/pluto_grid_plus_export/README.md similarity index 94% rename from packages/pluto_grid_export/README.md rename to packages/pluto_grid_plus_export/README.md index 656747fc8..c3c7e6ee8 100644 --- a/packages/pluto_grid_export/README.md +++ b/packages/pluto_grid_plus_export/README.md @@ -1,4 +1,4 @@ -## PlutoGridExport for PlutoGrid - v1.0.2 +## PlutoGridExport for PlutoGrid - v1.0.5 [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) @@ -9,7 +9,7 @@ https://github.com/bosskmk/pluto_grid/blob/master/demo/lib/screen/feature/export
-### [Pub.Dev](https://pub.dev/packages/pluto_grid_export) +### [Pub.Dev](https://pub.dev/packages/pluto_grid_plus_export) > Check out how to install from the official distribution site.
@@ -27,8 +27,8 @@ import 'dart:convert'; import 'package:file_saver/file_saver.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid_export/pluto_grid_export.dart' as pluto_grid_export; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus_export/pluto_grid_plus_export.dart' as pluto_grid_export; void main() { runApp(const MyApp()); diff --git a/packages/pluto_grid_export/analysis_options.yaml b/packages/pluto_grid_plus_export/analysis_options.yaml similarity index 100% rename from packages/pluto_grid_export/analysis_options.yaml rename to packages/pluto_grid_plus_export/analysis_options.yaml diff --git a/packages/pluto_grid_export/example/.gitignore b/packages/pluto_grid_plus_export/example/.gitignore similarity index 100% rename from packages/pluto_grid_export/example/.gitignore rename to packages/pluto_grid_plus_export/example/.gitignore diff --git a/packages/pluto_grid_export/example/.metadata b/packages/pluto_grid_plus_export/example/.metadata similarity index 100% rename from packages/pluto_grid_export/example/.metadata rename to packages/pluto_grid_plus_export/example/.metadata diff --git a/packages/pluto_grid_export/example/README.md b/packages/pluto_grid_plus_export/example/README.md similarity index 100% rename from packages/pluto_grid_export/example/README.md rename to packages/pluto_grid_plus_export/example/README.md diff --git a/packages/pluto_grid_export/example/analysis_options.yaml b/packages/pluto_grid_plus_export/example/analysis_options.yaml similarity index 100% rename from packages/pluto_grid_export/example/analysis_options.yaml rename to packages/pluto_grid_plus_export/example/analysis_options.yaml diff --git a/packages/pluto_grid_export/example/android/.gitignore b/packages/pluto_grid_plus_export/example/android/.gitignore similarity index 100% rename from packages/pluto_grid_export/example/android/.gitignore rename to packages/pluto_grid_plus_export/example/android/.gitignore diff --git a/packages/pluto_grid_export/example/android/app/build.gradle b/packages/pluto_grid_plus_export/example/android/app/build.gradle similarity index 100% rename from packages/pluto_grid_export/example/android/app/build.gradle rename to packages/pluto_grid_plus_export/example/android/app/build.gradle diff --git a/packages/pluto_grid_export/example/android/app/src/debug/AndroidManifest.xml b/packages/pluto_grid_plus_export/example/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/debug/AndroidManifest.xml rename to packages/pluto_grid_plus_export/example/android/app/src/debug/AndroidManifest.xml diff --git a/packages/pluto_grid_export/example/android/app/src/main/AndroidManifest.xml b/packages/pluto_grid_plus_export/example/android/app/src/main/AndroidManifest.xml similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/main/AndroidManifest.xml rename to packages/pluto_grid_plus_export/example/android/app/src/main/AndroidManifest.xml diff --git a/packages/pluto_grid_export/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/packages/pluto_grid_plus_export/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt rename to packages/pluto_grid_plus_export/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt diff --git a/packages/pluto_grid_export/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/pluto_grid_plus_export/example/android/app/src/main/res/drawable-v21/launch_background.xml similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/main/res/drawable-v21/launch_background.xml rename to packages/pluto_grid_plus_export/example/android/app/src/main/res/drawable-v21/launch_background.xml diff --git a/packages/pluto_grid_export/example/android/app/src/main/res/drawable/launch_background.xml b/packages/pluto_grid_plus_export/example/android/app/src/main/res/drawable/launch_background.xml similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/main/res/drawable/launch_background.xml rename to packages/pluto_grid_plus_export/example/android/app/src/main/res/drawable/launch_background.xml diff --git a/packages/pluto_grid_export/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/pluto_grid_plus_export/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to packages/pluto_grid_plus_export/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/packages/pluto_grid_export/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/pluto_grid_plus_export/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to packages/pluto_grid_plus_export/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/packages/pluto_grid_export/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/pluto_grid_plus_export/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to packages/pluto_grid_plus_export/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/packages/pluto_grid_export/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/pluto_grid_plus_export/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to packages/pluto_grid_plus_export/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/packages/pluto_grid_export/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/pluto_grid_plus_export/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to packages/pluto_grid_plus_export/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/packages/pluto_grid_export/example/android/app/src/main/res/values-night/styles.xml b/packages/pluto_grid_plus_export/example/android/app/src/main/res/values-night/styles.xml similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/main/res/values-night/styles.xml rename to packages/pluto_grid_plus_export/example/android/app/src/main/res/values-night/styles.xml diff --git a/packages/pluto_grid_export/example/android/app/src/main/res/values/styles.xml b/packages/pluto_grid_plus_export/example/android/app/src/main/res/values/styles.xml similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/main/res/values/styles.xml rename to packages/pluto_grid_plus_export/example/android/app/src/main/res/values/styles.xml diff --git a/packages/pluto_grid_export/example/android/app/src/profile/AndroidManifest.xml b/packages/pluto_grid_plus_export/example/android/app/src/profile/AndroidManifest.xml similarity index 100% rename from packages/pluto_grid_export/example/android/app/src/profile/AndroidManifest.xml rename to packages/pluto_grid_plus_export/example/android/app/src/profile/AndroidManifest.xml diff --git a/packages/pluto_grid_export/example/android/build.gradle b/packages/pluto_grid_plus_export/example/android/build.gradle similarity index 100% rename from packages/pluto_grid_export/example/android/build.gradle rename to packages/pluto_grid_plus_export/example/android/build.gradle diff --git a/packages/pluto_grid_export/example/android/gradle.properties b/packages/pluto_grid_plus_export/example/android/gradle.properties similarity index 100% rename from packages/pluto_grid_export/example/android/gradle.properties rename to packages/pluto_grid_plus_export/example/android/gradle.properties diff --git a/packages/pluto_grid_export/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/pluto_grid_plus_export/example/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from packages/pluto_grid_export/example/android/gradle/wrapper/gradle-wrapper.properties rename to packages/pluto_grid_plus_export/example/android/gradle/wrapper/gradle-wrapper.properties diff --git a/packages/pluto_grid_export/example/android/settings.gradle b/packages/pluto_grid_plus_export/example/android/settings.gradle similarity index 100% rename from packages/pluto_grid_export/example/android/settings.gradle rename to packages/pluto_grid_plus_export/example/android/settings.gradle diff --git a/packages/pluto_grid_export/example/assets/fonts/open_sans/OpenSans-Bold.ttf b/packages/pluto_grid_plus_export/example/assets/fonts/open_sans/OpenSans-Bold.ttf similarity index 100% rename from packages/pluto_grid_export/example/assets/fonts/open_sans/OpenSans-Bold.ttf rename to packages/pluto_grid_plus_export/example/assets/fonts/open_sans/OpenSans-Bold.ttf diff --git a/packages/pluto_grid_export/example/assets/fonts/open_sans/OpenSans-Regular.ttf b/packages/pluto_grid_plus_export/example/assets/fonts/open_sans/OpenSans-Regular.ttf similarity index 100% rename from packages/pluto_grid_export/example/assets/fonts/open_sans/OpenSans-Regular.ttf rename to packages/pluto_grid_plus_export/example/assets/fonts/open_sans/OpenSans-Regular.ttf diff --git a/packages/pluto_grid_export/example/ios/.gitignore b/packages/pluto_grid_plus_export/example/ios/.gitignore similarity index 100% rename from packages/pluto_grid_export/example/ios/.gitignore rename to packages/pluto_grid_plus_export/example/ios/.gitignore diff --git a/packages/pluto_grid_export/example/ios/Flutter/AppFrameworkInfo.plist b/packages/pluto_grid_plus_export/example/ios/Flutter/AppFrameworkInfo.plist similarity index 100% rename from packages/pluto_grid_export/example/ios/Flutter/AppFrameworkInfo.plist rename to packages/pluto_grid_plus_export/example/ios/Flutter/AppFrameworkInfo.plist diff --git a/packages/pluto_grid_export/example/ios/Flutter/Debug.xcconfig b/packages/pluto_grid_plus_export/example/ios/Flutter/Debug.xcconfig similarity index 100% rename from packages/pluto_grid_export/example/ios/Flutter/Debug.xcconfig rename to packages/pluto_grid_plus_export/example/ios/Flutter/Debug.xcconfig diff --git a/packages/pluto_grid_export/example/ios/Flutter/Release.xcconfig b/packages/pluto_grid_plus_export/example/ios/Flutter/Release.xcconfig similarity index 100% rename from packages/pluto_grid_export/example/ios/Flutter/Release.xcconfig rename to packages/pluto_grid_plus_export/example/ios/Flutter/Release.xcconfig diff --git a/packages/pluto_grid_export/example/ios/Runner.xcodeproj/project.pbxproj b/packages/pluto_grid_plus_export/example/ios/Runner.xcodeproj/project.pbxproj similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner.xcodeproj/project.pbxproj rename to packages/pluto_grid_plus_export/example/ios/Runner.xcodeproj/project.pbxproj diff --git a/packages/pluto_grid_export/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/pluto_grid_plus_export/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to packages/pluto_grid_plus_export/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/packages/pluto_grid_export/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pluto_grid_plus_export/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to packages/pluto_grid_plus_export/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/packages/pluto_grid_export/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/pluto_grid_plus_export/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to packages/pluto_grid_plus_export/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/packages/pluto_grid_export/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/pluto_grid_plus_export/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to packages/pluto_grid_plus_export/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/packages/pluto_grid_export/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/pluto_grid_plus_export/example/ios/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner.xcworkspace/contents.xcworkspacedata rename to packages/pluto_grid_plus_export/example/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/packages/pluto_grid_export/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pluto_grid_plus_export/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to packages/pluto_grid_plus_export/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/packages/pluto_grid_export/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/pluto_grid_plus_export/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to packages/pluto_grid_plus_export/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/packages/pluto_grid_export/example/ios/Runner/AppDelegate.swift b/packages/pluto_grid_plus_export/example/ios/Runner/AppDelegate.swift similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/AppDelegate.swift rename to packages/pluto_grid_plus_export/example/ios/Runner/AppDelegate.swift diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to packages/pluto_grid_plus_export/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/packages/pluto_grid_export/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/pluto_grid_plus_export/example/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to packages/pluto_grid_plus_export/example/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/packages/pluto_grid_export/example/ios/Runner/Base.lproj/Main.storyboard b/packages/pluto_grid_plus_export/example/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Base.lproj/Main.storyboard rename to packages/pluto_grid_plus_export/example/ios/Runner/Base.lproj/Main.storyboard diff --git a/packages/pluto_grid_export/example/ios/Runner/Info.plist b/packages/pluto_grid_plus_export/example/ios/Runner/Info.plist similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Info.plist rename to packages/pluto_grid_plus_export/example/ios/Runner/Info.plist diff --git a/packages/pluto_grid_export/example/ios/Runner/Runner-Bridging-Header.h b/packages/pluto_grid_plus_export/example/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from packages/pluto_grid_export/example/ios/Runner/Runner-Bridging-Header.h rename to packages/pluto_grid_plus_export/example/ios/Runner/Runner-Bridging-Header.h diff --git a/packages/pluto_grid_export/example/lib/main.dart b/packages/pluto_grid_plus_export/example/lib/main.dart similarity index 92% rename from packages/pluto_grid_export/example/lib/main.dart rename to packages/pluto_grid_plus_export/example/lib/main.dart index 1f7046853..bdf2b1e81 100644 --- a/packages/pluto_grid_export/example/lib/main.dart +++ b/packages/pluto_grid_plus_export/example/lib/main.dart @@ -3,8 +3,9 @@ import 'dart:convert'; import 'package:file_saver/file_saver.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid_export/pluto_grid_export.dart' as pluto_grid_export; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus_export/pluto_grid_plus_export.dart' + as pluto_grid_export; void main() { runApp(const MyApp()); @@ -13,7 +14,7 @@ void main() { /// For more details, please refer to the link below for how to use it. /// https://github.com/bosskmk/pluto_grid/blob/master/demo/lib/screen/feature/export_screen.dart class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -28,7 +29,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - const MyHomePage({Key? key}) : super(key: key); + const MyHomePage({super.key}); @override State createState() => _MyHomePageState(); @@ -109,7 +110,8 @@ class _MyHomePageState extends State { .convert(pluto_grid_export.PlutoGridExport.exportCSV(stateManager)); // use file_saver from pub.dev - await FileSaver.instance.saveFile("$title.csv", exported, ".csv"); + await FileSaver.instance + .saveFile(name: "$title.csv", bytes: exported, ext: ".csv"); } @override diff --git a/packages/pluto_grid_export/example/linux/.gitignore b/packages/pluto_grid_plus_export/example/linux/.gitignore similarity index 100% rename from packages/pluto_grid_export/example/linux/.gitignore rename to packages/pluto_grid_plus_export/example/linux/.gitignore diff --git a/packages/pluto_grid_export/example/linux/CMakeLists.txt b/packages/pluto_grid_plus_export/example/linux/CMakeLists.txt similarity index 100% rename from packages/pluto_grid_export/example/linux/CMakeLists.txt rename to packages/pluto_grid_plus_export/example/linux/CMakeLists.txt diff --git a/packages/pluto_grid_export/example/linux/flutter/CMakeLists.txt b/packages/pluto_grid_plus_export/example/linux/flutter/CMakeLists.txt similarity index 100% rename from packages/pluto_grid_export/example/linux/flutter/CMakeLists.txt rename to packages/pluto_grid_plus_export/example/linux/flutter/CMakeLists.txt diff --git a/packages/pluto_grid_export/example/linux/flutter/generated_plugin_registrant.cc b/packages/pluto_grid_plus_export/example/linux/flutter/generated_plugin_registrant.cc similarity index 100% rename from packages/pluto_grid_export/example/linux/flutter/generated_plugin_registrant.cc rename to packages/pluto_grid_plus_export/example/linux/flutter/generated_plugin_registrant.cc diff --git a/packages/pluto_grid_export/example/linux/flutter/generated_plugin_registrant.h b/packages/pluto_grid_plus_export/example/linux/flutter/generated_plugin_registrant.h similarity index 100% rename from packages/pluto_grid_export/example/linux/flutter/generated_plugin_registrant.h rename to packages/pluto_grid_plus_export/example/linux/flutter/generated_plugin_registrant.h diff --git a/packages/pluto_grid_export/example/linux/flutter/generated_plugins.cmake b/packages/pluto_grid_plus_export/example/linux/flutter/generated_plugins.cmake similarity index 100% rename from packages/pluto_grid_export/example/linux/flutter/generated_plugins.cmake rename to packages/pluto_grid_plus_export/example/linux/flutter/generated_plugins.cmake diff --git a/packages/pluto_grid_export/example/linux/main.cc b/packages/pluto_grid_plus_export/example/linux/main.cc similarity index 100% rename from packages/pluto_grid_export/example/linux/main.cc rename to packages/pluto_grid_plus_export/example/linux/main.cc diff --git a/packages/pluto_grid_export/example/linux/my_application.cc b/packages/pluto_grid_plus_export/example/linux/my_application.cc similarity index 100% rename from packages/pluto_grid_export/example/linux/my_application.cc rename to packages/pluto_grid_plus_export/example/linux/my_application.cc diff --git a/packages/pluto_grid_export/example/linux/my_application.h b/packages/pluto_grid_plus_export/example/linux/my_application.h similarity index 100% rename from packages/pluto_grid_export/example/linux/my_application.h rename to packages/pluto_grid_plus_export/example/linux/my_application.h diff --git a/packages/pluto_grid_export/example/macos/.gitignore b/packages/pluto_grid_plus_export/example/macos/.gitignore similarity index 100% rename from packages/pluto_grid_export/example/macos/.gitignore rename to packages/pluto_grid_plus_export/example/macos/.gitignore diff --git a/packages/pluto_grid_export/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/pluto_grid_plus_export/example/macos/Flutter/Flutter-Debug.xcconfig similarity index 100% rename from packages/pluto_grid_export/example/macos/Flutter/Flutter-Debug.xcconfig rename to packages/pluto_grid_plus_export/example/macos/Flutter/Flutter-Debug.xcconfig diff --git a/packages/pluto_grid_export/example/macos/Flutter/Flutter-Release.xcconfig b/packages/pluto_grid_plus_export/example/macos/Flutter/Flutter-Release.xcconfig similarity index 100% rename from packages/pluto_grid_export/example/macos/Flutter/Flutter-Release.xcconfig rename to packages/pluto_grid_plus_export/example/macos/Flutter/Flutter-Release.xcconfig diff --git a/packages/pluto_grid_export/example/macos/Flutter/GeneratedPluginRegistrant.swift b/packages/pluto_grid_plus_export/example/macos/Flutter/GeneratedPluginRegistrant.swift similarity index 93% rename from packages/pluto_grid_export/example/macos/Flutter/GeneratedPluginRegistrant.swift rename to packages/pluto_grid_plus_export/example/macos/Flutter/GeneratedPluginRegistrant.swift index 416ef8457..9c4efdd9c 100644 --- a/packages/pluto_grid_export/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/packages/pluto_grid_plus_export/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,7 +6,7 @@ import FlutterMacOS import Foundation import file_saver -import path_provider_macos +import path_provider_foundation import printing func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { diff --git a/packages/pluto_grid_export/example/macos/Runner.xcodeproj/project.pbxproj b/packages/pluto_grid_plus_export/example/macos/Runner.xcodeproj/project.pbxproj similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner.xcodeproj/project.pbxproj rename to packages/pluto_grid_plus_export/example/macos/Runner.xcodeproj/project.pbxproj diff --git a/packages/pluto_grid_export/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pluto_grid_plus_export/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to packages/pluto_grid_plus_export/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/packages/pluto_grid_export/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/pluto_grid_plus_export/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to packages/pluto_grid_plus_export/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/packages/pluto_grid_export/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/packages/pluto_grid_plus_export/example/macos/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner.xcworkspace/contents.xcworkspacedata rename to packages/pluto_grid_plus_export/example/macos/Runner.xcworkspace/contents.xcworkspacedata diff --git a/packages/pluto_grid_export/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pluto_grid_plus_export/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to packages/pluto_grid_plus_export/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/packages/pluto_grid_export/example/macos/Runner/AppDelegate.swift b/packages/pluto_grid_plus_export/example/macos/Runner/AppDelegate.swift similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/AppDelegate.swift rename to packages/pluto_grid_plus_export/example/macos/Runner/AppDelegate.swift diff --git a/packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png rename to packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png diff --git a/packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png rename to packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png diff --git a/packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png rename to packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png diff --git a/packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png rename to packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png diff --git a/packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png rename to packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png diff --git a/packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png rename to packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png diff --git a/packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png rename to packages/pluto_grid_plus_export/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png diff --git a/packages/pluto_grid_export/example/macos/Runner/Base.lproj/MainMenu.xib b/packages/pluto_grid_plus_export/example/macos/Runner/Base.lproj/MainMenu.xib similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Base.lproj/MainMenu.xib rename to packages/pluto_grid_plus_export/example/macos/Runner/Base.lproj/MainMenu.xib diff --git a/packages/pluto_grid_export/example/macos/Runner/Configs/AppInfo.xcconfig b/packages/pluto_grid_plus_export/example/macos/Runner/Configs/AppInfo.xcconfig similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Configs/AppInfo.xcconfig rename to packages/pluto_grid_plus_export/example/macos/Runner/Configs/AppInfo.xcconfig diff --git a/packages/pluto_grid_export/example/macos/Runner/Configs/Debug.xcconfig b/packages/pluto_grid_plus_export/example/macos/Runner/Configs/Debug.xcconfig similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Configs/Debug.xcconfig rename to packages/pluto_grid_plus_export/example/macos/Runner/Configs/Debug.xcconfig diff --git a/packages/pluto_grid_export/example/macos/Runner/Configs/Release.xcconfig b/packages/pluto_grid_plus_export/example/macos/Runner/Configs/Release.xcconfig similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Configs/Release.xcconfig rename to packages/pluto_grid_plus_export/example/macos/Runner/Configs/Release.xcconfig diff --git a/packages/pluto_grid_export/example/macos/Runner/Configs/Warnings.xcconfig b/packages/pluto_grid_plus_export/example/macos/Runner/Configs/Warnings.xcconfig similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Configs/Warnings.xcconfig rename to packages/pluto_grid_plus_export/example/macos/Runner/Configs/Warnings.xcconfig diff --git a/packages/pluto_grid_export/example/macos/Runner/DebugProfile.entitlements b/packages/pluto_grid_plus_export/example/macos/Runner/DebugProfile.entitlements similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/DebugProfile.entitlements rename to packages/pluto_grid_plus_export/example/macos/Runner/DebugProfile.entitlements diff --git a/packages/pluto_grid_export/example/macos/Runner/Info.plist b/packages/pluto_grid_plus_export/example/macos/Runner/Info.plist similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Info.plist rename to packages/pluto_grid_plus_export/example/macos/Runner/Info.plist diff --git a/packages/pluto_grid_export/example/macos/Runner/MainFlutterWindow.swift b/packages/pluto_grid_plus_export/example/macos/Runner/MainFlutterWindow.swift similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/MainFlutterWindow.swift rename to packages/pluto_grid_plus_export/example/macos/Runner/MainFlutterWindow.swift diff --git a/packages/pluto_grid_export/example/macos/Runner/Release.entitlements b/packages/pluto_grid_plus_export/example/macos/Runner/Release.entitlements similarity index 100% rename from packages/pluto_grid_export/example/macos/Runner/Release.entitlements rename to packages/pluto_grid_plus_export/example/macos/Runner/Release.entitlements diff --git a/packages/pluto_grid_export/example/pubspec.yaml b/packages/pluto_grid_plus_export/example/pubspec.yaml similarity index 96% rename from packages/pluto_grid_export/example/pubspec.yaml rename to packages/pluto_grid_plus_export/example/pubspec.yaml index d35a19103..7fc504961 100644 --- a/packages/pluto_grid_export/example/pubspec.yaml +++ b/packages/pluto_grid_plus_export/example/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ">=2.17.0 <4.0.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -29,11 +29,10 @@ environment: dependencies: flutter: sdk: flutter - pluto_grid: - path: ../../../ - pluto_grid_export: + pluto_grid_plus: ^8.4.3 + pluto_grid_plus_export: path: ../ - file_saver: ^0.1.0 + file_saver: ^0.2.12 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. @@ -48,7 +47,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^2.0.0 + flutter_lints: ^4.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/packages/pluto_grid_export/example/web/favicon.png b/packages/pluto_grid_plus_export/example/web/favicon.png similarity index 100% rename from packages/pluto_grid_export/example/web/favicon.png rename to packages/pluto_grid_plus_export/example/web/favicon.png diff --git a/packages/pluto_grid_export/example/web/icons/Icon-192.png b/packages/pluto_grid_plus_export/example/web/icons/Icon-192.png similarity index 100% rename from packages/pluto_grid_export/example/web/icons/Icon-192.png rename to packages/pluto_grid_plus_export/example/web/icons/Icon-192.png diff --git a/packages/pluto_grid_export/example/web/icons/Icon-512.png b/packages/pluto_grid_plus_export/example/web/icons/Icon-512.png similarity index 100% rename from packages/pluto_grid_export/example/web/icons/Icon-512.png rename to packages/pluto_grid_plus_export/example/web/icons/Icon-512.png diff --git a/packages/pluto_grid_export/example/web/icons/Icon-maskable-192.png b/packages/pluto_grid_plus_export/example/web/icons/Icon-maskable-192.png similarity index 100% rename from packages/pluto_grid_export/example/web/icons/Icon-maskable-192.png rename to packages/pluto_grid_plus_export/example/web/icons/Icon-maskable-192.png diff --git a/packages/pluto_grid_export/example/web/icons/Icon-maskable-512.png b/packages/pluto_grid_plus_export/example/web/icons/Icon-maskable-512.png similarity index 100% rename from packages/pluto_grid_export/example/web/icons/Icon-maskable-512.png rename to packages/pluto_grid_plus_export/example/web/icons/Icon-maskable-512.png diff --git a/packages/pluto_grid_export/example/web/index.html b/packages/pluto_grid_plus_export/example/web/index.html similarity index 100% rename from packages/pluto_grid_export/example/web/index.html rename to packages/pluto_grid_plus_export/example/web/index.html diff --git a/packages/pluto_grid_export/example/web/manifest.json b/packages/pluto_grid_plus_export/example/web/manifest.json similarity index 100% rename from packages/pluto_grid_export/example/web/manifest.json rename to packages/pluto_grid_plus_export/example/web/manifest.json diff --git a/packages/pluto_grid_export/example/windows/.gitignore b/packages/pluto_grid_plus_export/example/windows/.gitignore similarity index 100% rename from packages/pluto_grid_export/example/windows/.gitignore rename to packages/pluto_grid_plus_export/example/windows/.gitignore diff --git a/packages/pluto_grid_export/example/windows/CMakeLists.txt b/packages/pluto_grid_plus_export/example/windows/CMakeLists.txt similarity index 100% rename from packages/pluto_grid_export/example/windows/CMakeLists.txt rename to packages/pluto_grid_plus_export/example/windows/CMakeLists.txt diff --git a/packages/pluto_grid_export/example/windows/flutter/CMakeLists.txt b/packages/pluto_grid_plus_export/example/windows/flutter/CMakeLists.txt similarity index 100% rename from packages/pluto_grid_export/example/windows/flutter/CMakeLists.txt rename to packages/pluto_grid_plus_export/example/windows/flutter/CMakeLists.txt diff --git a/packages/pluto_grid_export/example/windows/flutter/generated_plugin_registrant.cc b/packages/pluto_grid_plus_export/example/windows/flutter/generated_plugin_registrant.cc similarity index 100% rename from packages/pluto_grid_export/example/windows/flutter/generated_plugin_registrant.cc rename to packages/pluto_grid_plus_export/example/windows/flutter/generated_plugin_registrant.cc diff --git a/example/windows/flutter/generated_plugin_registrant.h b/packages/pluto_grid_plus_export/example/windows/flutter/generated_plugin_registrant.h similarity index 100% rename from example/windows/flutter/generated_plugin_registrant.h rename to packages/pluto_grid_plus_export/example/windows/flutter/generated_plugin_registrant.h diff --git a/packages/pluto_grid_export/example/windows/flutter/generated_plugins.cmake b/packages/pluto_grid_plus_export/example/windows/flutter/generated_plugins.cmake similarity index 100% rename from packages/pluto_grid_export/example/windows/flutter/generated_plugins.cmake rename to packages/pluto_grid_plus_export/example/windows/flutter/generated_plugins.cmake diff --git a/packages/pluto_grid_export/example/windows/runner/CMakeLists.txt b/packages/pluto_grid_plus_export/example/windows/runner/CMakeLists.txt similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/CMakeLists.txt rename to packages/pluto_grid_plus_export/example/windows/runner/CMakeLists.txt diff --git a/packages/pluto_grid_export/example/windows/runner/Runner.rc b/packages/pluto_grid_plus_export/example/windows/runner/Runner.rc similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/Runner.rc rename to packages/pluto_grid_plus_export/example/windows/runner/Runner.rc diff --git a/packages/pluto_grid_export/example/windows/runner/flutter_window.cpp b/packages/pluto_grid_plus_export/example/windows/runner/flutter_window.cpp similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/flutter_window.cpp rename to packages/pluto_grid_plus_export/example/windows/runner/flutter_window.cpp diff --git a/packages/pluto_grid_export/example/windows/runner/flutter_window.h b/packages/pluto_grid_plus_export/example/windows/runner/flutter_window.h similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/flutter_window.h rename to packages/pluto_grid_plus_export/example/windows/runner/flutter_window.h diff --git a/packages/pluto_grid_export/example/windows/runner/main.cpp b/packages/pluto_grid_plus_export/example/windows/runner/main.cpp similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/main.cpp rename to packages/pluto_grid_plus_export/example/windows/runner/main.cpp diff --git a/packages/pluto_grid_export/example/windows/runner/resource.h b/packages/pluto_grid_plus_export/example/windows/runner/resource.h similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/resource.h rename to packages/pluto_grid_plus_export/example/windows/runner/resource.h diff --git a/packages/pluto_grid_export/example/windows/runner/resources/app_icon.ico b/packages/pluto_grid_plus_export/example/windows/runner/resources/app_icon.ico similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/resources/app_icon.ico rename to packages/pluto_grid_plus_export/example/windows/runner/resources/app_icon.ico diff --git a/packages/pluto_grid_export/example/windows/runner/runner.exe.manifest b/packages/pluto_grid_plus_export/example/windows/runner/runner.exe.manifest similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/runner.exe.manifest rename to packages/pluto_grid_plus_export/example/windows/runner/runner.exe.manifest diff --git a/packages/pluto_grid_export/example/windows/runner/utils.cpp b/packages/pluto_grid_plus_export/example/windows/runner/utils.cpp similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/utils.cpp rename to packages/pluto_grid_plus_export/example/windows/runner/utils.cpp diff --git a/packages/pluto_grid_export/example/windows/runner/utils.h b/packages/pluto_grid_plus_export/example/windows/runner/utils.h similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/utils.h rename to packages/pluto_grid_plus_export/example/windows/runner/utils.h diff --git a/packages/pluto_grid_export/example/windows/runner/win32_window.cpp b/packages/pluto_grid_plus_export/example/windows/runner/win32_window.cpp similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/win32_window.cpp rename to packages/pluto_grid_plus_export/example/windows/runner/win32_window.cpp diff --git a/packages/pluto_grid_export/example/windows/runner/win32_window.h b/packages/pluto_grid_plus_export/example/windows/runner/win32_window.h similarity index 100% rename from packages/pluto_grid_export/example/windows/runner/win32_window.h rename to packages/pluto_grid_plus_export/example/windows/runner/win32_window.h diff --git a/packages/pluto_grid_export/lib/pluto_grid_export.dart b/packages/pluto_grid_plus_export/lib/pluto_grid_plus_export.dart similarity index 83% rename from packages/pluto_grid_export/lib/pluto_grid_export.dart rename to packages/pluto_grid_plus_export/lib/pluto_grid_plus_export.dart index 00cfe258b..5e2066815 100644 --- a/packages/pluto_grid_export/lib/pluto_grid_export.dart +++ b/packages/pluto_grid_plus_export/lib/pluto_grid_plus_export.dart @@ -1,4 +1,4 @@ -library pluto_grid_export; +library; export 'package:pdf/pdf.dart'; export 'package:pdf/widgets.dart'; @@ -9,4 +9,4 @@ export './src/csv/pluto_grid_csv_export.dart'; export './src/pdf/generic_pdf_controller.dart'; export './src/pdf/pdf_controller.dart'; export './src/pdf/pluto_grid_pdf_export.dart'; -export './src/pluto_grid_export.dart'; +export './src/pluto_grid_plus_export.dart'; diff --git a/packages/pluto_grid_export/lib/src/abstract_text_export.dart b/packages/pluto_grid_plus_export/lib/src/abstract_text_export.dart similarity index 96% rename from packages/pluto_grid_export/lib/src/abstract_text_export.dart rename to packages/pluto_grid_plus_export/lib/src/abstract_text_export.dart index da07cd77a..967223cd7 100644 --- a/packages/pluto_grid_export/lib/src/abstract_text_export.dart +++ b/packages/pluto_grid_plus_export/lib/src/abstract_text_export.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /// Abstract class for converting PlutoGrid's metadata. abstract class AbstractTextExport { diff --git a/packages/pluto_grid_export/lib/src/csv/pluto_grid_csv_export.dart b/packages/pluto_grid_plus_export/lib/src/csv/pluto_grid_csv_export.dart similarity index 94% rename from packages/pluto_grid_export/lib/src/csv/pluto_grid_csv_export.dart rename to packages/pluto_grid_plus_export/lib/src/csv/pluto_grid_csv_export.dart index 86e174532..f7fdb22ba 100644 --- a/packages/pluto_grid_export/lib/src/csv/pluto_grid_csv_export.dart +++ b/packages/pluto_grid_plus_export/lib/src/csv/pluto_grid_csv_export.dart @@ -1,5 +1,5 @@ import 'package:csv/csv.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../abstract_text_export.dart'; diff --git a/packages/pluto_grid_export/lib/src/pdf/generic_pdf_controller.dart b/packages/pluto_grid_plus_export/lib/src/pdf/generic_pdf_controller.dart similarity index 98% rename from packages/pluto_grid_export/lib/src/pdf/generic_pdf_controller.dart rename to packages/pluto_grid_plus_export/lib/src/pdf/generic_pdf_controller.dart index 82ea42a9c..4af78ab21 100644 --- a/packages/pluto_grid_export/lib/src/pdf/generic_pdf_controller.dart +++ b/packages/pluto_grid_plus_export/lib/src/pdf/generic_pdf_controller.dart @@ -79,7 +79,7 @@ class GenericPdfController extends PdfController { } Widget _table(List columns, List> rows) { - return Table.fromTextArray( + return TableHelper.fromTextArray( border: null, cellAlignment: Alignment.center, // [Resolved 3.8.1] https://github.com/DavBfr/dart_pdf/pull/1033 to replace "headerDecoration" with "headerCellDecoration" diff --git a/packages/pluto_grid_export/lib/src/pdf/pdf_controller.dart b/packages/pluto_grid_plus_export/lib/src/pdf/pdf_controller.dart similarity index 100% rename from packages/pluto_grid_export/lib/src/pdf/pdf_controller.dart rename to packages/pluto_grid_plus_export/lib/src/pdf/pdf_controller.dart diff --git a/packages/pluto_grid_export/lib/src/pdf/pluto_grid_pdf_export.dart b/packages/pluto_grid_plus_export/lib/src/pdf/pluto_grid_pdf_export.dart similarity index 90% rename from packages/pluto_grid_export/lib/src/pdf/pluto_grid_pdf_export.dart rename to packages/pluto_grid_plus_export/lib/src/pdf/pluto_grid_pdf_export.dart index 2eb444fbd..5acc0901e 100644 --- a/packages/pluto_grid_export/lib/src/pdf/pluto_grid_pdf_export.dart +++ b/packages/pluto_grid_plus_export/lib/src/pdf/pluto_grid_pdf_export.dart @@ -2,7 +2,7 @@ import 'dart:typed_data'; import 'package:pdf/pdf.dart'; import 'package:pdf/widgets.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../abstract_text_export.dart'; import 'generic_pdf_controller.dart'; @@ -11,7 +11,7 @@ import 'generic_pdf_controller.dart'; /// /// [themeData] Attributes for custom fonts. /// -/// import 'package:pluto_grid_export/pluto_grid_export.dart' as pluto_grid_export; +/// import 'package:pluto_grid_plus_export/pluto_grid_export.dart' as pluto_grid_export; /// /// final themeData = pluto_grid_export.ThemeData.withFont( /// base: pluto_grid_export.Font.ttf( diff --git a/packages/pluto_grid_export/lib/src/pluto_grid_export.dart b/packages/pluto_grid_plus_export/lib/src/pluto_grid_plus_export.dart similarity index 91% rename from packages/pluto_grid_export/lib/src/pluto_grid_export.dart rename to packages/pluto_grid_plus_export/lib/src/pluto_grid_plus_export.dart index 781ac49c6..20990d9bd 100644 --- a/packages/pluto_grid_export/lib/src/pluto_grid_export.dart +++ b/packages/pluto_grid_plus_export/lib/src/pluto_grid_plus_export.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import './csv/pluto_grid_csv_export.dart'; diff --git a/packages/pluto_grid_plus_export/pubspec.yaml b/packages/pluto_grid_plus_export/pubspec.yaml new file mode 100644 index 000000000..33ce7e43b --- /dev/null +++ b/packages/pluto_grid_plus_export/pubspec.yaml @@ -0,0 +1,23 @@ +name: pluto_grid_plus_export +description: PlutoGridExport converts PlutoGrid's metadata to CSV or PDF. Used with PlutoGrid. +version: 1.0.5 +homepage: https://bosskmk.github.io +repository: https://github.com/doonfrs/pluto_grid_plus/tree/master/packages/pluto_grid_plus_export + +environment: + sdk: ^3.0.0 + +dependencies: + flutter: + sdk: flutter + pluto_grid_plus: ^8.4.3 + csv: ^6.0.0 + pdf: ^3.10.7 + printing: ^5.11.1 + +dev_dependencies: + flutter_test: + sdk: flutter + mockito: ^5.4.3 + build_runner: ^2.4.7 + flutter_lints: ^5.0.0 diff --git a/pubspec.yaml b/pubspec.yaml index 9ff0f667c..009593f5a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,25 +1,24 @@ -name: pluto_grid -description: PlutoGrid is a dataGrid that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS. (DataGrid, DataTable, Data Grid, Data Table, Sticky) -version: 7.0.2 +name: pluto_grid_plus +description: PlutoGrid plus is a maintained version of PlutoGrid, PlutoGrid is a dataGrid that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS. (DataGrid, DataTable, Data Grid, Data Table, Sticky) +version: 8.4.3 homepage: https://pluto.weblaze.dev -repository: https://github.com/bosskmk/pluto_grid +repository: https://github.com/doonfrs/pluto_grid_plus environment: - sdk: ">=2.17.0 <3.0.0" - flutter: ">=2.5.0" + sdk: ^3.0.0 dependencies: flutter: sdk: flutter # Follows the intl version included in Flutter. # https://github.com/flutter/flutter/blob/84a1e904f44f9b0e9c4510138010edcc653163f8/packages/flutter_localizations/pubspec.yaml#L11 - intl: ^0.18.0 - rxdart: ^0.27.7 - collection: ^1.17.1 + intl: ^0.20.0 + rxdart: ^0.28.0 + collection: ^1.18.0 dev_dependencies: flutter_test: sdk: flutter - mockito: ^5.4.0 - build_runner: ^2.4.2 - flutter_lints: ^2.0.1 + mockito: ^5.4.3 + build_runner: ^2.4.7 + flutter_lints: ^5.0.0 diff --git a/test/helper/build_grid_helper.dart b/test/helper/build_grid_helper.dart index 60dc9c808..21b3ca1ec 100644 --- a/test/helper/build_grid_helper.dart +++ b/test/helper/build_grid_helper.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'column_helper.dart'; import 'pluto_widget_test_helper.dart'; diff --git a/test/helper/column_helper.dart b/test/helper/column_helper.dart index ae9e5ae50..db3c52712 100644 --- a/test/helper/column_helper.dart +++ b/test/helper/column_helper.dart @@ -1,4 +1,4 @@ -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; class ColumnHelper { static List textColumn( diff --git a/test/helper/row_helper.dart b/test/helper/row_helper.dart index 1f128ae14..6602753e9 100644 --- a/test/helper/row_helper.dart +++ b/test/helper/row_helper.dart @@ -1,6 +1,6 @@ import 'dart:math'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; class RowHelper { /// cell value format : '$columnFieldName value $rowIdx' diff --git a/test/mock/shared_mocks.dart b/test/mock/shared_mocks.dart index 1791e3418..cc170ed08 100644 --- a/test/mock/shared_mocks.dart +++ b/test/mock/shared_mocks.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:flutter/widgets.dart'; import 'package:mockito/annotations.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; @GenerateNiceMocks([ MockSpec(), diff --git a/test/mock/shared_mocks.mocks.dart b/test/mock/shared_mocks.mocks.dart index e52394865..887d237cd 100644 --- a/test/mock/shared_mocks.mocks.dart +++ b/test/mock/shared_mocks.mocks.dart @@ -1,5 +1,5 @@ -// Mocks generated by Mockito 5.4.0 from annotations -// in pluto_grid/test/mock/shared_mocks.dart. +// Mocks generated by Mockito 5.4.4 from annotations +// in pluto_grid_plus/test/mock/shared_mocks.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -8,18 +8,21 @@ import 'dart:ui' as _i5; import 'package:flutter/gestures.dart' as _i7; import 'package:flutter/material.dart' as _i3; -import 'package:flutter/rendering.dart' as _i9; -import 'package:flutter/services.dart' as _i10; -import 'package:flutter/src/foundation/assertions.dart' as _i11; +import 'package:flutter/rendering.dart' as _i10; +import 'package:flutter/services.dart' as _i11; +import 'package:flutter/src/foundation/assertions.dart' as _i12; import 'package:flutter/src/foundation/diagnostics.dart' as _i8; import 'package:mockito/mockito.dart' as _i1; -import 'package:pluto_grid/pluto_grid.dart' as _i2; +import 'package:mockito/src/dummies.dart' as _i9; +import 'package:pluto_grid_plus/pluto_grid_plus.dart' as _i2; import 'package:rxdart/rxdart.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -183,8 +186,8 @@ class _FakeOffset_13 extends _i1.SmartFake implements _i5.Offset { ); } -class _FakePlutoChangeNotifierFilter_14 extends _i1.SmartFake - implements _i2.PlutoChangeNotifierFilter { +class _FakePlutoChangeNotifierFilter_14 extends _i1.SmartFake + implements _i2.PlutoChangeNotifierFilter { _FakePlutoChangeNotifierFilter_14( Object parent, Invocation parentInvocation, @@ -343,7 +346,7 @@ class _FakeScrollMetrics_28 extends _i1.SmartFake implements _i3.ScrollMetrics { ); } -class _FakeFuture_29 extends _i1.SmartFake implements _i6.Future { +class _FakeFuture_29 extends _i1.SmartFake implements _i6.Future { _FakeFuture_29( Object parent, Invocation parentInvocation, @@ -419,6 +422,7 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#refColumns), ), ) as _i2.FilteredList<_i2.PlutoColumn>); + @override _i2.FilteredList<_i2.PlutoColumnGroup> get refColumnGroups => (super.noSuchMethod( @@ -432,6 +436,7 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#refColumnGroups), ), ) as _i2.FilteredList<_i2.PlutoColumnGroup>); + @override _i2.FilteredList<_i2.PlutoRow> get refRows => (super.noSuchMethod( Invocation.getter(#refRows), @@ -444,6 +449,7 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#refRows), ), ) as _i2.FilteredList<_i2.PlutoRow>); + @override _i3.FocusNode get gridFocusNode => (super.noSuchMethod( Invocation.getter(#gridFocusNode), @@ -456,6 +462,7 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#gridFocusNode), ), ) as _i3.FocusNode); + @override _i2.PlutoGridScrollController get scroll => (super.noSuchMethod( Invocation.getter(#scroll), @@ -468,6 +475,7 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#scroll), ), ) as _i2.PlutoGridScrollController); + @override _i2.PlutoColumnMenuDelegate get columnMenuDelegate => (super.noSuchMethod( @@ -481,6 +489,7 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#columnMenuDelegate), ), ) as _i2.PlutoColumnMenuDelegate); + @override _i2.PlutoChangeNotifierFilterResolver get notifierFilterResolver => (super.noSuchMethod( @@ -494,6 +503,7 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#notifierFilterResolver), ), ) as _i2.PlutoChangeNotifierFilterResolver); + @override _i3.GlobalKey<_i3.State<_i3.StatefulWidget>> get gridKey => (super.noSuchMethod( @@ -508,6 +518,7 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#gridKey), ), ) as _i3.GlobalKey<_i3.State<_i3.StatefulWidget>>); + @override _i4.PublishSubject<_i2.PlutoNotifierEvent> get streamNotifier => (super.noSuchMethod( @@ -522,30 +533,35 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#streamNotifier), ), ) as _i4.PublishSubject<_i2.PlutoNotifierEvent>); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override List<_i2.PlutoColumnGroup> get columnGroups => (super.noSuchMethod( Invocation.getter(#columnGroups), returnValue: <_i2.PlutoColumnGroup>[], returnValueForMissingStub: <_i2.PlutoColumnGroup>[], ) as List<_i2.PlutoColumnGroup>); + @override bool get hasColumnGroups => (super.noSuchMethod( Invocation.getter(#hasColumnGroups), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get showColumnGroups => (super.noSuchMethod( Invocation.getter(#showColumnGroups), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i2.PlutoGridColumnSizeConfig get columnSizeConfig => (super.noSuchMethod( Invocation.getter(#columnSizeConfig), @@ -558,174 +574,203 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#columnSizeConfig), ), ) as _i2.PlutoGridColumnSizeConfig); + @override _i2.PlutoAutoSizeMode get columnsAutoSizeMode => (super.noSuchMethod( Invocation.getter(#columnsAutoSizeMode), returnValue: _i2.PlutoAutoSizeMode.none, returnValueForMissingStub: _i2.PlutoAutoSizeMode.none, ) as _i2.PlutoAutoSizeMode); + @override _i2.PlutoResizeMode get columnsResizeMode => (super.noSuchMethod( Invocation.getter(#columnsResizeMode), returnValue: _i2.PlutoResizeMode.none, returnValueForMissingStub: _i2.PlutoResizeMode.none, ) as _i2.PlutoResizeMode); + @override bool get enableColumnsAutoSize => (super.noSuchMethod( Invocation.getter(#enableColumnsAutoSize), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get activatedColumnsAutoSize => (super.noSuchMethod( Invocation.getter(#activatedColumnsAutoSize), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override List<_i2.PlutoColumn> get columns => (super.noSuchMethod( Invocation.getter(#columns), returnValue: <_i2.PlutoColumn>[], returnValueForMissingStub: <_i2.PlutoColumn>[], ) as List<_i2.PlutoColumn>); + @override List get columnIndexes => (super.noSuchMethod( Invocation.getter(#columnIndexes), returnValue: [], returnValueForMissingStub: [], ) as List); + @override List get columnIndexesForShowFrozen => (super.noSuchMethod( Invocation.getter(#columnIndexesForShowFrozen), returnValue: [], returnValueForMissingStub: [], ) as List); + @override double get columnsWidth => (super.noSuchMethod( Invocation.getter(#columnsWidth), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override List<_i2.PlutoColumn> get leftFrozenColumns => (super.noSuchMethod( Invocation.getter(#leftFrozenColumns), returnValue: <_i2.PlutoColumn>[], returnValueForMissingStub: <_i2.PlutoColumn>[], ) as List<_i2.PlutoColumn>); + @override List get leftFrozenColumnIndexes => (super.noSuchMethod( Invocation.getter(#leftFrozenColumnIndexes), returnValue: [], returnValueForMissingStub: [], ) as List); + @override double get leftFrozenColumnsWidth => (super.noSuchMethod( Invocation.getter(#leftFrozenColumnsWidth), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override List<_i2.PlutoColumn> get rightFrozenColumns => (super.noSuchMethod( Invocation.getter(#rightFrozenColumns), returnValue: <_i2.PlutoColumn>[], returnValueForMissingStub: <_i2.PlutoColumn>[], ) as List<_i2.PlutoColumn>); + @override List get rightFrozenColumnIndexes => (super.noSuchMethod( Invocation.getter(#rightFrozenColumnIndexes), returnValue: [], returnValueForMissingStub: [], ) as List); + @override double get rightFrozenColumnsWidth => (super.noSuchMethod( Invocation.getter(#rightFrozenColumnsWidth), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override List<_i2.PlutoColumn> get bodyColumns => (super.noSuchMethod( Invocation.getter(#bodyColumns), returnValue: <_i2.PlutoColumn>[], returnValueForMissingStub: <_i2.PlutoColumn>[], ) as List<_i2.PlutoColumn>); + @override List get bodyColumnIndexes => (super.noSuchMethod( Invocation.getter(#bodyColumnIndexes), returnValue: [], returnValueForMissingStub: [], ) as List); + @override double get bodyColumnsWidth => (super.noSuchMethod( Invocation.getter(#bodyColumnsWidth), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override bool get hasSortedColumn => (super.noSuchMethod( Invocation.getter(#hasSortedColumn), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override List get columnIndexesByShowFrozen => (super.noSuchMethod( Invocation.getter(#columnIndexesByShowFrozen), returnValue: [], returnValueForMissingStub: [], ) as List); + @override bool get isDraggingRow => (super.noSuchMethod( Invocation.getter(#isDraggingRow), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override List<_i2.PlutoRow> get dragRows => (super.noSuchMethod( Invocation.getter(#dragRows), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as List<_i2.PlutoRow>); + @override bool get canRowDrag => (super.noSuchMethod( Invocation.getter(#canRowDrag), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get isEditing => (super.noSuchMethod( Invocation.getter(#isEditing), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get autoEditing => (super.noSuchMethod( Invocation.getter(#autoEditing), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override List<_i2.PlutoRow> get filterRows => (super.noSuchMethod( Invocation.getter(#filterRows), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as List<_i2.PlutoRow>); + @override bool get hasFilter => (super.noSuchMethod( Invocation.getter(#hasFilter), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get keepFocus => (super.noSuchMethod( Invocation.getter(#keepFocus), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get hasFocus => (super.noSuchMethod( Invocation.getter(#hasFocus), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i2.PlutoGridConfiguration get configuration => (super.noSuchMethod( Invocation.getter(#configuration), @@ -738,12 +783,14 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#configuration), ), ) as _i2.PlutoGridConfiguration); + @override _i2.PlutoGridMode get mode => (super.noSuchMethod( Invocation.getter(#mode), returnValue: _i2.PlutoGridMode.normal, returnValueForMissingStub: _i2.PlutoGridMode.normal, ) as _i2.PlutoGridMode); + @override _i2.PlutoGridLocaleText get localeText => (super.noSuchMethod( Invocation.getter(#localeText), @@ -756,6 +803,7 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#localeText), ), ) as _i2.PlutoGridLocaleText); + @override _i2.PlutoGridStyleConfig get style => (super.noSuchMethod( Invocation.getter(#style), @@ -768,18 +816,21 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#style), ), ) as _i2.PlutoGridStyleConfig); + @override bool get sortOnlyEvent => (super.noSuchMethod( Invocation.getter(#sortOnlyEvent), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get filterOnlyEvent => (super.noSuchMethod( Invocation.getter(#filterOnlyEvent), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i2.PlutoGridKeyPressed get keyPressed => (super.noSuchMethod( Invocation.getter(#keyPressed), @@ -792,6 +843,7 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#keyPressed), ), ) as _i2.PlutoGridKeyPressed); + @override _i3.ChangeNotifier get resizingChangeNotifier => (super.noSuchMethod( Invocation.getter(#resizingChangeNotifier), @@ -804,378 +856,455 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#resizingChangeNotifier), ), ) as _i3.ChangeNotifier); + @override double get headerHeight => (super.noSuchMethod( Invocation.getter(#headerHeight), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get footerHeight => (super.noSuchMethod( Invocation.getter(#footerHeight), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get columnRowContainerHeight => (super.noSuchMethod( Invocation.getter(#columnRowContainerHeight), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get rowContainerHeight => (super.noSuchMethod( Invocation.getter(#rowContainerHeight), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override bool get showFrozenColumn => (super.noSuchMethod( Invocation.getter(#showFrozenColumn), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get showColumnTitle => (super.noSuchMethod( Invocation.getter(#showColumnTitle), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get showColumnFooter => (super.noSuchMethod( Invocation.getter(#showColumnFooter), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get showColumnFilter => (super.noSuchMethod( Invocation.getter(#showColumnFilter), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get showHeader => (super.noSuchMethod( Invocation.getter(#showHeader), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get showFooter => (super.noSuchMethod( Invocation.getter(#showFooter), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get showLoading => (super.noSuchMethod( Invocation.getter(#showLoading), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i2.PlutoGridLoadingLevel get loadingLevel => (super.noSuchMethod( Invocation.getter(#loadingLevel), returnValue: _i2.PlutoGridLoadingLevel.grid, returnValueForMissingStub: _i2.PlutoGridLoadingLevel.grid, ) as _i2.PlutoGridLoadingLevel); + @override bool get hasLeftFrozenColumns => (super.noSuchMethod( Invocation.getter(#hasLeftFrozenColumns), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get hasRightFrozenColumns => (super.noSuchMethod( Invocation.getter(#hasRightFrozenColumns), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override double get headerBottomOffset => (super.noSuchMethod( Invocation.getter(#headerBottomOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get footerTopOffset => (super.noSuchMethod( Invocation.getter(#footerTopOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get columnHeight => (super.noSuchMethod( Invocation.getter(#columnHeight), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get columnFooterHeight => (super.noSuchMethod( Invocation.getter(#columnFooterHeight), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get columnGroupHeight => (super.noSuchMethod( Invocation.getter(#columnGroupHeight), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get columnFilterHeight => (super.noSuchMethod( Invocation.getter(#columnFilterHeight), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get columnBottomOffset => (super.noSuchMethod( Invocation.getter(#columnBottomOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get rowsTopOffset => (super.noSuchMethod( Invocation.getter(#rowsTopOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get rowHeight => (super.noSuchMethod( Invocation.getter(#rowHeight), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get rowTotalHeight => (super.noSuchMethod( Invocation.getter(#rowTotalHeight), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get bodyTopOffset => (super.noSuchMethod( Invocation.getter(#bodyTopOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get bodyLeftOffset => (super.noSuchMethod( Invocation.getter(#bodyLeftOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get bodyRightOffset => (super.noSuchMethod( Invocation.getter(#bodyRightOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get bodyLeftScrollOffset => (super.noSuchMethod( Invocation.getter(#bodyLeftScrollOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get bodyRightScrollOffset => (super.noSuchMethod( Invocation.getter(#bodyRightScrollOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get bodyUpScrollOffset => (super.noSuchMethod( Invocation.getter(#bodyUpScrollOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get bodyDownScrollOffset => (super.noSuchMethod( Invocation.getter(#bodyDownScrollOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get leftFrozenRightOffset => (super.noSuchMethod( Invocation.getter(#leftFrozenRightOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get rightFrozenLeftOffset => (super.noSuchMethod( Invocation.getter(#rightFrozenLeftOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get rightBlankOffset => (super.noSuchMethod( Invocation.getter(#rightBlankOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get scrollOffsetByFrozenColumn => (super.noSuchMethod( Invocation.getter(#scrollOffsetByFrozenColumn), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override _i5.TextDirection get textDirection => (super.noSuchMethod( Invocation.getter(#textDirection), returnValue: _i5.TextDirection.rtl, returnValueForMissingStub: _i5.TextDirection.rtl, ) as _i5.TextDirection); + @override bool get isLTR => (super.noSuchMethod( Invocation.getter(#isLTR), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get isRTL => (super.noSuchMethod( Invocation.getter(#isRTL), returnValue: false, returnValueForMissingStub: false, ) as bool); + + @override + double get gridPadding => (super.noSuchMethod( + Invocation.getter(#gridPadding), + returnValue: 0.0, + returnValueForMissingStub: 0.0, + ) as double); + + @override + double get gridBorderWidth => (super.noSuchMethod( + Invocation.getter(#gridBorderWidth), + returnValue: 0.0, + returnValueForMissingStub: 0.0, + ) as double); + @override int get page => (super.noSuchMethod( Invocation.getter(#page), returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override int get pageSize => (super.noSuchMethod( Invocation.getter(#pageSize), returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override int get pageRangeFrom => (super.noSuchMethod( Invocation.getter(#pageRangeFrom), returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override int get pageRangeTo => (super.noSuchMethod( Invocation.getter(#pageRangeTo), returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override int get totalPage => (super.noSuchMethod( Invocation.getter(#totalPage), returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override bool get isPaginated => (super.noSuchMethod( Invocation.getter(#isPaginated), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get hasRowGroups => (super.noSuchMethod( Invocation.getter(#hasRowGroups), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get enabledRowGroups => (super.noSuchMethod( Invocation.getter(#enabledRowGroups), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override Iterable<_i2.PlutoRow> get iterateAllMainRowGroup => (super.noSuchMethod( Invocation.getter(#iterateAllMainRowGroup), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as Iterable<_i2.PlutoRow>); + @override Iterable<_i2.PlutoRow> get iterateAllRowGroup => (super.noSuchMethod( Invocation.getter(#iterateAllRowGroup), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as Iterable<_i2.PlutoRow>); + @override Iterable<_i2.PlutoRow> get iterateAllRowAndGroup => (super.noSuchMethod( Invocation.getter(#iterateAllRowAndGroup), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as Iterable<_i2.PlutoRow>); + @override Iterable<_i2.PlutoRow> get iterateAllRow => (super.noSuchMethod( Invocation.getter(#iterateAllRow), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as Iterable<_i2.PlutoRow>); + @override Iterable<_i2.PlutoRow> get iterateFilteredMainRowGroup => (super.noSuchMethod( Invocation.getter(#iterateFilteredMainRowGroup), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as Iterable<_i2.PlutoRow>); + @override Iterable<_i2.PlutoRow> get iterateMainRowGroup => (super.noSuchMethod( Invocation.getter(#iterateMainRowGroup), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as Iterable<_i2.PlutoRow>); + @override Iterable<_i2.PlutoRow> get iterateRowGroup => (super.noSuchMethod( Invocation.getter(#iterateRowGroup), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as Iterable<_i2.PlutoRow>); + @override Iterable<_i2.PlutoRow> get iterateRowAndGroup => (super.noSuchMethod( Invocation.getter(#iterateRowAndGroup), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as Iterable<_i2.PlutoRow>); + @override Iterable<_i2.PlutoRow> get iterateRow => (super.noSuchMethod( Invocation.getter(#iterateRow), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as Iterable<_i2.PlutoRow>); + @override List<_i2.PlutoRow> get rows => (super.noSuchMethod( Invocation.getter(#rows), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as List<_i2.PlutoRow>); + @override List<_i2.PlutoRow> get checkedRows => (super.noSuchMethod( Invocation.getter(#checkedRows), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as List<_i2.PlutoRow>); + @override List<_i2.PlutoRow> get unCheckedRows => (super.noSuchMethod( Invocation.getter(#unCheckedRows), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as List<_i2.PlutoRow>); + @override bool get hasCheckedRow => (super.noSuchMethod( Invocation.getter(#hasCheckedRow), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get hasUnCheckedRow => (super.noSuchMethod( Invocation.getter(#hasUnCheckedRow), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get isHorizontalOverScrolled => (super.noSuchMethod( Invocation.getter(#isHorizontalOverScrolled), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override double get correctHorizontalOffset => (super.noSuchMethod( Invocation.getter(#correctHorizontalOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override _i5.Offset get directionalScrollEdgeOffset => (super.noSuchMethod( Invocation.getter(#directionalScrollEdgeOffset), @@ -1188,18 +1317,21 @@ class MockPlutoGridStateManager extends _i1.Mock Invocation.getter(#directionalScrollEdgeOffset), ), ) as _i5.Offset); + @override bool get isSelecting => (super.noSuchMethod( Invocation.getter(#isSelecting), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i2.PlutoGridSelectingMode get selectingMode => (super.noSuchMethod( Invocation.getter(#selectingMode), returnValue: _i2.PlutoGridSelectingMode.cell, returnValueForMissingStub: _i2.PlutoGridSelectingMode.cell, ) as _i2.PlutoGridSelectingMode); + @override List<_i2.PlutoGridSelectingCellPosition> get currentSelectingPositionList => (super.noSuchMethod( @@ -1207,24 +1339,41 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: <_i2.PlutoGridSelectingCellPosition>[], returnValueForMissingStub: <_i2.PlutoGridSelectingCellPosition>[], ) as List<_i2.PlutoGridSelectingCellPosition>); + @override bool get hasCurrentSelectingPosition => (super.noSuchMethod( Invocation.getter(#hasCurrentSelectingPosition), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override List<_i2.PlutoRow> get currentSelectingRows => (super.noSuchMethod( Invocation.getter(#currentSelectingRows), returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as List<_i2.PlutoRow>); + @override String get currentSelectingText => (super.noSuchMethod( Invocation.getter(#currentSelectingText), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i9.dummyValue( + this, + Invocation.getter(#currentSelectingText), + ), + returnValueForMissingStub: _i9.dummyValue( + this, + Invocation.getter(#currentSelectingText), + ), ) as String); + + @override + bool get isHoveringRow => (super.noSuchMethod( + Invocation.getter(#isHoveringRow), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + @override set headerHeight(double? value) => super.noSuchMethod( Invocation.setter( @@ -1233,6 +1382,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override set footerHeight(double? value) => super.noSuchMethod( Invocation.setter( @@ -1241,6 +1391,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override set columnFooterHeight(double? value) => super.noSuchMethod( Invocation.setter( @@ -1249,6 +1400,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override _i2.PlutoChangeNotifierFilter resolveNotifierFilter() => (super.noSuchMethod( @@ -1271,6 +1423,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), ), ) as _i2.PlutoChangeNotifierFilter); + @override void dispose() => super.noSuchMethod( Invocation.method( @@ -1279,6 +1432,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void notifyListeners([ bool? notify = true, @@ -1294,6 +1448,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void notifyListenersOnPostFrame([ bool? notify = true, @@ -1309,6 +1464,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void addNotifier(int? hash) => super.noSuchMethod( Invocation.method( @@ -1317,6 +1473,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( @@ -1325,6 +1482,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( @@ -1333,6 +1491,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setCurrentCellPosition( _i2.PlutoGridCellPosition? cellPosition, { @@ -1346,6 +1505,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void updateCurrentCellPosition({bool? notify = true}) => super.noSuchMethod( Invocation.method( @@ -1355,6 +1515,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override int? columnIdxByCellKeyAndRowIdx( _i3.Key? cellKey, @@ -1370,6 +1531,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ) as int?); + @override void clearCurrentCell({bool? notify = true}) => super.noSuchMethod( Invocation.method( @@ -1379,6 +1541,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setCurrentCell( _i2.PlutoCell? cell, @@ -1396,6 +1559,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override bool canMoveCell( _i2.PlutoGridCellPosition? cellPosition, @@ -1412,6 +1576,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool canNotMoveCell( _i2.PlutoGridCellPosition? cellPosition, @@ -1428,6 +1593,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool canChangeCellValue({ required _i2.PlutoCell? cell, @@ -1447,6 +1613,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool canNotChangeCellValue({ required _i2.PlutoCell? cell, @@ -1466,6 +1633,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override dynamic filteredCellValue({ required _i2.PlutoColumn? column, @@ -1484,6 +1652,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override bool isCurrentCell(_i2.PlutoCell? cell) => (super.noSuchMethod( Invocation.method( @@ -1493,6 +1662,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool isInvalidCellPosition(_i2.PlutoGridCellPosition? cellPosition) => (super.noSuchMethod( @@ -1503,6 +1673,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void setShowColumnGroups( bool? flag, { @@ -1516,6 +1687,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override List<_i2.PlutoColumnGroupPair> separateLinkedGroup({ required List<_i2.PlutoColumnGroup>? columnGroupList, @@ -1533,6 +1705,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: <_i2.PlutoColumnGroupPair>[], returnValueForMissingStub: <_i2.PlutoColumnGroupPair>[], ) as List<_i2.PlutoColumnGroupPair>); + @override int columnGroupDepth(List<_i2.PlutoColumnGroup>? columnGroupList) => (super.noSuchMethod( @@ -1543,6 +1716,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override void removeColumnsInColumnGroup( List<_i2.PlutoColumn>? columns, { @@ -1556,6 +1730,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setGroupToColumn() => super.noSuchMethod( Invocation.method( @@ -1564,6 +1739,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void activateColumnsAutoSize() => super.noSuchMethod( Invocation.method( @@ -1572,6 +1748,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void deactivateColumnsAutoSize() => super.noSuchMethod( Invocation.method( @@ -1580,6 +1757,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override _i2.PlutoAutoSize getColumnsAutoSizeHelper({ required Iterable<_i2.PlutoColumn>? columns, @@ -1617,6 +1795,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), ), ) as _i2.PlutoAutoSize); + @override _i2.PlutoResize getColumnsResizeHelper({ required List<_i2.PlutoColumn>? columns, @@ -1658,6 +1837,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), ), ) as _i2.PlutoResize); + @override void setColumnSizeConfig(_i2.PlutoGridColumnSizeConfig? config) => super.noSuchMethod( @@ -1667,6 +1847,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void toggleFrozenColumn( _i2.PlutoColumn? column, @@ -1682,6 +1863,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void toggleSortColumn(_i2.PlutoColumn? column) => super.noSuchMethod( Invocation.method( @@ -1690,6 +1872,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override int? columnIndex(_i2.PlutoColumn? column) => (super.noSuchMethod( Invocation.method( @@ -1698,6 +1881,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ) as int?); + @override void insertColumns( int? columnIdx, @@ -1713,6 +1897,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void removeColumns(List<_i2.PlutoColumn>? columns) => super.noSuchMethod( Invocation.method( @@ -1721,6 +1906,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void moveColumn({ required _i2.PlutoColumn? column, @@ -1737,6 +1923,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void resizeColumn( _i2.PlutoColumn? column, @@ -1752,6 +1939,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void autoFitColumn( _i3.BuildContext? context, @@ -1767,6 +1955,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void hideColumn( _i2.PlutoColumn? column, @@ -1784,6 +1973,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void hideColumns( List<_i2.PlutoColumn>? columns, @@ -1801,6 +1991,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void sortAscending( _i2.PlutoColumn? column, { @@ -1814,6 +2005,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void sortDescending( _i2.PlutoColumn? column, { @@ -1827,6 +2019,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void sortBySortIdx( _i2.PlutoColumn? column, { @@ -1840,6 +2033,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void showSetColumnsPopup(_i3.BuildContext? context) => super.noSuchMethod( Invocation.method( @@ -1848,6 +2042,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override bool limitResizeColumn( _i2.PlutoColumn? column, @@ -1864,6 +2059,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool limitMoveColumn({ required _i2.PlutoColumn? column, @@ -1881,6 +2077,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool limitToggleFrozenColumn( _i2.PlutoColumn? column, @@ -1897,6 +2094,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool limitHideColumn( _i2.PlutoColumn? column, @@ -1915,6 +2113,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void setIsDraggingRow( bool? flag, { @@ -1928,6 +2127,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setDragRows( List<_i2.PlutoRow>? rows, { @@ -1941,6 +2141,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setDragTargetRowIdx( int? rowIdx, { @@ -1954,6 +2155,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override bool isRowIdxDragTarget(int? rowIdx) => (super.noSuchMethod( Invocation.method( @@ -1963,6 +2165,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool isRowIdxTopDragTarget(int? rowIdx) => (super.noSuchMethod( Invocation.method( @@ -1972,6 +2175,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool isRowIdxBottomDragTarget(int? rowIdx) => (super.noSuchMethod( Invocation.method( @@ -1981,6 +2185,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool isRowBeingDragged(_i3.Key? rowKey) => (super.noSuchMethod( Invocation.method( @@ -1990,6 +2195,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool isEditableCell(_i2.PlutoCell? cell) => (super.noSuchMethod( Invocation.method( @@ -1999,6 +2205,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void setEditing( bool? flag, { @@ -2012,6 +2219,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setAutoEditing( bool? flag, { @@ -2025,6 +2233,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setTextEditingController( _i3.TextEditingController? textEditingController) => @@ -2035,6 +2244,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void toggleEditing({bool? notify = true}) => super.noSuchMethod( Invocation.method( @@ -2044,6 +2254,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void pasteCellValue(List>? textList) => super.noSuchMethod( Invocation.method( @@ -2052,6 +2263,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override dynamic castValueByColumnType( dynamic value, @@ -2067,6 +2279,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void changeCellValue( _i2.PlutoCell? cell, @@ -2090,6 +2303,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setFilter( _i2.FilteredListFilter<_i2.PlutoRow>? filter, { @@ -2103,6 +2317,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setFilterWithFilterRows( List<_i2.PlutoRow>? rows, { @@ -2116,6 +2331,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setFilterRows(List<_i2.PlutoRow>? rows) => super.noSuchMethod( Invocation.method( @@ -2124,6 +2340,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override List<_i2.PlutoRow> filterRowsByField(String? columnField) => (super.noSuchMethod( @@ -2134,6 +2351,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as List<_i2.PlutoRow>); + @override bool isFilteredColumn(_i2.PlutoColumn? column) => (super.noSuchMethod( Invocation.method( @@ -2143,6 +2361,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void removeColumnsInFilterRows( List<_i2.PlutoColumn>? columns, { @@ -2156,6 +2375,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void showFilterPopup( _i3.BuildContext? context, { @@ -2173,6 +2393,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setKeepFocus( bool? flag, { @@ -2186,6 +2407,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void nextFocusOfColumnFilter( _i2.PlutoColumn? column, { @@ -2199,6 +2421,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setKeyManager(_i2.PlutoGridKeyManager? keyManager) => super.noSuchMethod( Invocation.method( @@ -2207,6 +2430,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setEventManager(_i2.PlutoGridEventManager? eventManager) => super.noSuchMethod( @@ -2216,6 +2440,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setConfiguration( _i2.PlutoGridConfiguration? configuration, { @@ -2233,6 +2458,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setGridMode(_i2.PlutoGridMode? mode) => super.noSuchMethod( Invocation.method( @@ -2241,6 +2467,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void resetCurrentState({bool? notify = true}) => super.noSuchMethod( Invocation.method( @@ -2250,6 +2477,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void handleOnSelected() => super.noSuchMethod( Invocation.method( @@ -2258,6 +2486,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setSortOnlyEvent(bool? flag) => super.noSuchMethod( Invocation.method( @@ -2266,6 +2495,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setFilterOnlyEvent(bool? flag) => super.noSuchMethod( Invocation.method( @@ -2274,6 +2504,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override _i2.PlutoGridCellPosition cellPositionToMove( _i2.PlutoGridCellPosition? cellPosition, @@ -2308,6 +2539,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), ), ) as _i2.PlutoGridCellPosition); + @override void moveCurrentCell( _i2.PlutoMoveDirection? direction, { @@ -2325,6 +2557,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void moveCurrentCellToEdgeOfColumns( _i2.PlutoMoveDirection? direction, { @@ -2342,6 +2575,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void moveCurrentCellToEdgeOfRows( _i2.PlutoMoveDirection? direction, { @@ -2359,6 +2593,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void moveCurrentCellByRowIdx( int? rowIdx, @@ -2376,6 +2611,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void moveSelectingCell(_i2.PlutoMoveDirection? direction) => super.noSuchMethod( @@ -2385,6 +2621,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void moveSelectingCellToEdgeOfColumns( _i2.PlutoMoveDirection? direction, { @@ -2402,6 +2639,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void moveSelectingCellToEdgeOfRows( _i2.PlutoMoveDirection? direction, { @@ -2419,6 +2657,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void moveSelectingCellByRowIdx( int? rowIdx, @@ -2436,6 +2675,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setLayout(_i3.BoxConstraints? size) => super.noSuchMethod( Invocation.method( @@ -2444,6 +2684,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setShowColumnTitle( bool? flag, { @@ -2457,6 +2698,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setShowColumnFooter( bool? flag, { @@ -2470,6 +2712,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setShowColumnFilter( bool? flag, { @@ -2483,6 +2726,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setShowLoading( bool? flag, { @@ -2500,6 +2744,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void resetShowFrozenColumn() => super.noSuchMethod( Invocation.method( @@ -2508,6 +2753,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override bool shouldShowFrozenColumns(double? width) => (super.noSuchMethod( Invocation.method( @@ -2517,6 +2763,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool enoughFrozenColumnsWidth(double? width) => (super.noSuchMethod( Invocation.method( @@ -2526,6 +2773,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void notifyResizingListeners() => super.noSuchMethod( Invocation.method( @@ -2534,6 +2782,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void notifyChangedShowFrozenColumn() => super.noSuchMethod( Invocation.method( @@ -2542,6 +2791,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setTextDirection(_i5.TextDirection? textDirection) => super.noSuchMethod( Invocation.method( @@ -2550,6 +2800,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setGridGlobalOffset(_i5.Offset? offset) => super.noSuchMethod( Invocation.method( @@ -2558,6 +2809,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setPageSize( int? pageSize, { @@ -2571,6 +2823,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setPage( int? page, { @@ -2588,6 +2841,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void resetPage({ bool? resetCurrentState = true, @@ -2604,6 +2858,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override bool isMainRow(_i2.PlutoRow? row) => (super.noSuchMethod( Invocation.method( @@ -2613,6 +2868,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool isNotMainGroupedRow(_i2.PlutoRow? row) => (super.noSuchMethod( Invocation.method( @@ -2622,6 +2878,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool isExpandedGroupedRow(_i2.PlutoRow? row) => (super.noSuchMethod( Invocation.method( @@ -2631,6 +2888,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void setRowGroup( _i2.PlutoRowGroupDelegate? delegate, { @@ -2644,6 +2902,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void toggleExpandedRowGroup({ required _i2.PlutoRow? rowGroup, @@ -2660,6 +2919,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setRowGroupFilter(_i2.FilteredListFilter<_i2.PlutoRow>? filter) => super.noSuchMethod( @@ -2669,6 +2929,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void sortRowGroup({ required _i2.PlutoColumn? column, @@ -2688,6 +2949,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void insertRowGroup( int? index, @@ -2703,6 +2965,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void removeRowAndGroupByKey(Iterable<_i3.Key>? keys) => super.noSuchMethod( Invocation.method( @@ -2711,6 +2974,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void removeColumnsInRowGroupByColumn( List<_i2.PlutoColumn>? columns, { @@ -2724,6 +2988,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void updateRowGroupByHideColumn(List<_i2.PlutoColumn>? columns) => super.noSuchMethod( @@ -2733,6 +2998,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override int? getRowIdxByOffset(double? offset) => (super.noSuchMethod( Invocation.method( @@ -2741,6 +3007,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ) as int?); + @override _i2.PlutoRow getNewRow() => (super.noSuchMethod( Invocation.method( @@ -2762,6 +3029,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), ), ) as _i2.PlutoRow); + @override List<_i2.PlutoRow> getNewRows({int? count = 1}) => (super.noSuchMethod( Invocation.method( @@ -2772,6 +3040,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: <_i2.PlutoRow>[], returnValueForMissingStub: <_i2.PlutoRow>[], ) as List<_i2.PlutoRow>); + @override void setRowChecked( _i2.PlutoRow? row, @@ -2789,6 +3058,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void insertRows( int? rowIdx, @@ -2806,6 +3076,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void prependNewRows({int? count = 1}) => super.noSuchMethod( Invocation.method( @@ -2815,6 +3086,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void prependRows(List<_i2.PlutoRow>? rows) => super.noSuchMethod( Invocation.method( @@ -2823,6 +3095,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void appendNewRows({int? count = 1}) => super.noSuchMethod( Invocation.method( @@ -2832,6 +3105,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void appendRows(List<_i2.PlutoRow>? rows) => super.noSuchMethod( Invocation.method( @@ -2840,6 +3114,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void removeCurrentRow() => super.noSuchMethod( Invocation.method( @@ -2848,6 +3123,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void removeRows( List<_i2.PlutoRow>? rows, { @@ -2861,6 +3137,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void removeAllRows({bool? notify = true}) => super.noSuchMethod( Invocation.method( @@ -2870,6 +3147,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void moveRowsByOffset( List<_i2.PlutoRow>? rows, @@ -2887,6 +3165,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void moveRowsByIndex( List<_i2.PlutoRow>? rows, @@ -2904,6 +3183,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void toggleAllRowChecked( bool? flag, { @@ -2917,6 +3197,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override _i5.Offset toDirectionalOffset(_i5.Offset? offset) => (super.noSuchMethod( Invocation.method( @@ -2938,6 +3219,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), ), ) as _i5.Offset); + @override void scrollByDirection( _i2.PlutoMoveDirection? direction, @@ -2953,6 +3235,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override bool canHorizontalCellScrollByDirection( _i2.PlutoMoveDirection? direction, @@ -2969,6 +3252,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void moveScrollByRow( _i2.PlutoMoveDirection? direction, @@ -2984,6 +3268,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void moveScrollByColumn( _i2.PlutoMoveDirection? direction, @@ -2999,6 +3284,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override bool needMovingScroll( _i5.Offset? offset, @@ -3015,6 +3301,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void updateCorrectScrollOffset() => super.noSuchMethod( Invocation.method( @@ -3023,6 +3310,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void updateScrollViewport() => super.noSuchMethod( Invocation.method( @@ -3031,6 +3319,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void resetScrollToZero() => super.noSuchMethod( Invocation.method( @@ -3039,6 +3328,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setSelecting( bool? flag, { @@ -3052,6 +3342,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setSelectingMode( _i2.PlutoGridSelectingMode? selectingMode, { @@ -3065,6 +3356,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setAllCurrentSelecting() => super.noSuchMethod( Invocation.method( @@ -3073,6 +3365,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setCurrentSelectingPosition({ _i2.PlutoGridCellPosition? cellPosition, @@ -3089,6 +3382,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setCurrentSelectingPositionByCellKey( _i3.Key? cellKey, { @@ -3102,6 +3396,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setCurrentSelectingPositionWithOffset(_i5.Offset? offset) => super.noSuchMethod( @@ -3111,6 +3406,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setCurrentSelectingRowsByRange( int? from, @@ -3128,6 +3424,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void clearCurrentSelecting({bool? notify = true}) => super.noSuchMethod( Invocation.method( @@ -3137,6 +3434,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void toggleSelectingRow( int? rowIdx, { @@ -3150,6 +3448,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override bool isSelectingInteraction() => (super.noSuchMethod( Invocation.method( @@ -3159,6 +3458,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool isSelectedRow(_i3.Key? rowKey) => (super.noSuchMethod( Invocation.method( @@ -3168,6 +3468,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool isSelectedCell( _i2.PlutoCell? cell, @@ -3186,6 +3487,7 @@ class MockPlutoGridStateManager extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void handleAfterSelectingRow( _i2.PlutoCell? cell, @@ -3201,6 +3503,7 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void updateVisibilityLayout({bool? notify = false}) => super.noSuchMethod( Invocation.method( @@ -3210,6 +3513,44 @@ class MockPlutoGridStateManager extends _i1.Mock ), returnValueForMissingStub: null, ); + + @override + void setIsHoveringRow( + bool? flag, { + bool? notify = true, + }) => + super.noSuchMethod( + Invocation.method( + #setIsHoveringRow, + [flag], + {#notify: notify}, + ), + returnValueForMissingStub: null, + ); + + @override + void setHoveredRowIdx( + int? rowIdx, { + bool? notify = true, + }) => + super.noSuchMethod( + Invocation.method( + #setHoveredRowIdx, + [rowIdx], + {#notify: notify}, + ), + returnValueForMissingStub: null, + ); + + @override + bool isRowIdxHovered(int? rowIdx) => (super.noSuchMethod( + Invocation.method( + #isRowIdxHovered, + [rowIdx], + ), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); } /// A class which mocks [PlutoGridEventManager]. @@ -3229,6 +3570,7 @@ class MockPlutoGridEventManager extends _i1.Mock Invocation.getter(#stateManager), ), ) as _i2.PlutoGridStateManager); + @override _i4.PublishSubject<_i2.PlutoGridEvent> get subject => (super.noSuchMethod( Invocation.getter(#subject), @@ -3241,6 +3583,7 @@ class MockPlutoGridEventManager extends _i1.Mock Invocation.getter(#subject), ), ) as _i4.PublishSubject<_i2.PlutoGridEvent>); + @override _i6.StreamSubscription get subscription => (super.noSuchMethod( Invocation.getter(#subscription), @@ -3253,6 +3596,7 @@ class MockPlutoGridEventManager extends _i1.Mock Invocation.getter(#subscription), ), ) as _i6.StreamSubscription); + @override void dispose() => super.noSuchMethod( Invocation.method( @@ -3261,6 +3605,7 @@ class MockPlutoGridEventManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void init() => super.noSuchMethod( Invocation.method( @@ -3269,6 +3614,7 @@ class MockPlutoGridEventManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void addEvent(_i2.PlutoGridEvent? event) => super.noSuchMethod( Invocation.method( @@ -3277,6 +3623,7 @@ class MockPlutoGridEventManager extends _i1.Mock ), returnValueForMissingStub: null, ); + @override _i6.StreamSubscription<_i2.PlutoGridEvent> listener( void Function(_i2.PlutoGridEvent)? onData) => @@ -3317,6 +3664,7 @@ class MockPlutoGridScrollController extends _i1.Mock ), returnValueForMissingStub: null, ); + @override set horizontal(_i2.LinkedScrollControllerGroup? _horizontal) => super.noSuchMethod( @@ -3326,30 +3674,35 @@ class MockPlutoGridScrollController extends _i1.Mock ), returnValueForMissingStub: null, ); + @override double get maxScrollHorizontal => (super.noSuchMethod( Invocation.getter(#maxScrollHorizontal), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get maxScrollVertical => (super.noSuchMethod( Invocation.getter(#maxScrollVertical), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get verticalOffset => (super.noSuchMethod( Invocation.getter(#verticalOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get horizontalOffset => (super.noSuchMethod( Invocation.getter(#horizontalOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override void setBodyRowsHorizontal(_i3.ScrollController? scrollController) => super.noSuchMethod( @@ -3359,6 +3712,7 @@ class MockPlutoGridScrollController extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void setBodyRowsVertical(_i3.ScrollController? scrollController) => super.noSuchMethod( @@ -3381,6 +3735,7 @@ class MockPlutoGridKeyPressed extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get ctrl => (super.noSuchMethod( Invocation.getter(#ctrl), @@ -3400,6 +3755,7 @@ class MockLinkedScrollControllerGroup extends _i1.Mock returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override _i3.ScrollController addAndGet() => (super.noSuchMethod( Invocation.method( @@ -3421,6 +3777,7 @@ class MockLinkedScrollControllerGroup extends _i1.Mock ), ), ) as _i3.ScrollController); + @override void addOffsetChangedListener(_i5.VoidCallback? onChanged) => super.noSuchMethod( @@ -3430,6 +3787,7 @@ class MockLinkedScrollControllerGroup extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void removeOffsetChangedListener(_i5.VoidCallback? listener) => super.noSuchMethod( @@ -3439,6 +3797,7 @@ class MockLinkedScrollControllerGroup extends _i1.Mock ), returnValueForMissingStub: null, ); + @override _i6.Future animateTo( double? offset, { @@ -3457,6 +3816,7 @@ class MockLinkedScrollControllerGroup extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override void jumpTo(double? value) => super.noSuchMethod( Invocation.method( @@ -3465,6 +3825,7 @@ class MockLinkedScrollControllerGroup extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void resetScroll() => super.noSuchMethod( Invocation.method( @@ -3473,6 +3834,7 @@ class MockLinkedScrollControllerGroup extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void applyViewportDimension(double? value) => super.noSuchMethod( Invocation.method( @@ -3481,6 +3843,7 @@ class MockLinkedScrollControllerGroup extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void notifyListeners() => super.noSuchMethod( Invocation.method( @@ -3501,24 +3864,28 @@ class MockScrollController extends _i1.Mock implements _i3.ScrollController { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override double get initialScrollOffset => (super.noSuchMethod( Invocation.getter(#initialScrollOffset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override Iterable<_i3.ScrollPosition> get positions => (super.noSuchMethod( Invocation.getter(#positions), returnValue: <_i3.ScrollPosition>[], returnValueForMissingStub: <_i3.ScrollPosition>[], ) as Iterable<_i3.ScrollPosition>); + @override bool get hasClients => (super.noSuchMethod( Invocation.getter(#hasClients), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i3.ScrollPosition get position => (super.noSuchMethod( Invocation.getter(#position), @@ -3531,18 +3898,21 @@ class MockScrollController extends _i1.Mock implements _i3.ScrollController { Invocation.getter(#position), ), ) as _i3.ScrollPosition); + @override double get offset => (super.noSuchMethod( Invocation.getter(#offset), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i6.Future animateTo( double? offset, { @@ -3561,6 +3931,7 @@ class MockScrollController extends _i1.Mock implements _i3.ScrollController { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override void jumpTo(double? value) => super.noSuchMethod( Invocation.method( @@ -3569,6 +3940,7 @@ class MockScrollController extends _i1.Mock implements _i3.ScrollController { ), returnValueForMissingStub: null, ); + @override void attach(_i3.ScrollPosition? position) => super.noSuchMethod( Invocation.method( @@ -3577,6 +3949,7 @@ class MockScrollController extends _i1.Mock implements _i3.ScrollController { ), returnValueForMissingStub: null, ); + @override void detach(_i3.ScrollPosition? position) => super.noSuchMethod( Invocation.method( @@ -3585,6 +3958,7 @@ class MockScrollController extends _i1.Mock implements _i3.ScrollController { ), returnValueForMissingStub: null, ); + @override void dispose() => super.noSuchMethod( Invocation.method( @@ -3593,6 +3967,7 @@ class MockScrollController extends _i1.Mock implements _i3.ScrollController { ), returnValueForMissingStub: null, ); + @override _i3.ScrollPosition createScrollPosition( _i3.ScrollPhysics? physics, @@ -3631,6 +4006,7 @@ class MockScrollController extends _i1.Mock implements _i3.ScrollController { ), ), ) as _i3.ScrollPosition); + @override void debugFillDescription(List? description) => super.noSuchMethod( Invocation.method( @@ -3639,6 +4015,7 @@ class MockScrollController extends _i1.Mock implements _i3.ScrollController { ), returnValueForMissingStub: null, ); + @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( @@ -3647,6 +4024,7 @@ class MockScrollController extends _i1.Mock implements _i3.ScrollController { ), returnValueForMissingStub: null, ); + @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( @@ -3655,6 +4033,7 @@ class MockScrollController extends _i1.Mock implements _i3.ScrollController { ), returnValueForMissingStub: null, ); + @override void notifyListeners() => super.noSuchMethod( Invocation.method( @@ -3681,6 +4060,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { Invocation.getter(#physics), ), ) as _i3.ScrollPhysics); + @override _i3.ScrollContext get context => (super.noSuchMethod( Invocation.getter(#context), @@ -3693,12 +4073,14 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { Invocation.getter(#context), ), ) as _i3.ScrollContext); + @override bool get keepScrollOffset => (super.noSuchMethod( Invocation.getter(#keepScrollOffset), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i3.ValueNotifier get isScrollingNotifier => (super.noSuchMethod( Invocation.getter(#isScrollingNotifier), @@ -3711,120 +4093,147 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { Invocation.getter(#isScrollingNotifier), ), ) as _i3.ValueNotifier); + @override double get minScrollExtent => (super.noSuchMethod( Invocation.getter(#minScrollExtent), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get maxScrollExtent => (super.noSuchMethod( Invocation.getter(#maxScrollExtent), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override bool get hasContentDimensions => (super.noSuchMethod( Invocation.getter(#hasContentDimensions), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override double get pixels => (super.noSuchMethod( Invocation.getter(#pixels), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override bool get hasPixels => (super.noSuchMethod( Invocation.getter(#hasPixels), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override double get viewportDimension => (super.noSuchMethod( Invocation.getter(#viewportDimension), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override bool get hasViewportDimension => (super.noSuchMethod( Invocation.getter(#hasViewportDimension), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get haveDimensions => (super.noSuchMethod( Invocation.getter(#haveDimensions), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override double get devicePixelRatio => (super.noSuchMethod( Invocation.getter(#devicePixelRatio), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override bool get allowImplicitScrolling => (super.noSuchMethod( Invocation.getter(#allowImplicitScrolling), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override - _i9.ScrollDirection get userScrollDirection => (super.noSuchMethod( + _i10.ScrollDirection get userScrollDirection => (super.noSuchMethod( Invocation.getter(#userScrollDirection), - returnValue: _i9.ScrollDirection.idle, - returnValueForMissingStub: _i9.ScrollDirection.idle, - ) as _i9.ScrollDirection); + returnValue: _i10.ScrollDirection.idle, + returnValueForMissingStub: _i10.ScrollDirection.idle, + ) as _i10.ScrollDirection); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i3.AxisDirection get axisDirection => (super.noSuchMethod( Invocation.getter(#axisDirection), returnValue: _i3.AxisDirection.up, returnValueForMissingStub: _i3.AxisDirection.up, ) as _i3.AxisDirection); + @override _i3.Axis get axis => (super.noSuchMethod( Invocation.getter(#axis), returnValue: _i3.Axis.horizontal, returnValueForMissingStub: _i3.Axis.horizontal, ) as _i3.Axis); + @override bool get outOfRange => (super.noSuchMethod( Invocation.getter(#outOfRange), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get atEdge => (super.noSuchMethod( Invocation.getter(#atEdge), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override double get extentBefore => (super.noSuchMethod( Invocation.getter(#extentBefore), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get extentInside => (super.noSuchMethod( Invocation.getter(#extentInside), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override double get extentAfter => (super.noSuchMethod( Invocation.getter(#extentAfter), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + + @override + double get extentTotal => (super.noSuchMethod( + Invocation.getter(#extentTotal), + returnValue: 0.0, + returnValueForMissingStub: 0.0, + ) as double); + @override void absorb(_i3.ScrollPosition? other) => super.noSuchMethod( Invocation.method( @@ -3833,6 +4242,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override double setPixels(double? newPixels) => (super.noSuchMethod( Invocation.method( @@ -3842,6 +4252,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override void correctPixels(double? value) => super.noSuchMethod( Invocation.method( @@ -3850,6 +4261,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void correctBy(double? correction) => super.noSuchMethod( Invocation.method( @@ -3858,6 +4270,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void forcePixels(double? value) => super.noSuchMethod( Invocation.method( @@ -3866,6 +4279,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void saveScrollOffset() => super.noSuchMethod( Invocation.method( @@ -3874,6 +4288,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void restoreScrollOffset() => super.noSuchMethod( Invocation.method( @@ -3882,6 +4297,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void restoreOffset( double? offset, { @@ -3895,6 +4311,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void saveOffset() => super.noSuchMethod( Invocation.method( @@ -3903,6 +4320,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override double applyBoundaryConditions(double? value) => (super.noSuchMethod( Invocation.method( @@ -3912,6 +4330,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); + @override bool applyViewportDimension(double? viewportDimension) => (super.noSuchMethod( Invocation.method( @@ -3921,6 +4340,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool applyContentDimensions( double? minScrollExtent, @@ -3937,6 +4357,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool correctForNewDimensions( _i3.ScrollMetrics? oldPosition, @@ -3953,6 +4374,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void applyNewDimensions() => super.noSuchMethod( Invocation.method( @@ -3961,6 +4383,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override _i6.Future ensureVisible( _i3.RenderObject? object, { @@ -3986,6 +4409,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override _i6.Future animateTo( double? to, { @@ -4004,6 +4428,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override void jumpTo(double? value) => super.noSuchMethod( Invocation.method( @@ -4012,6 +4437,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void pointerScroll(double? delta) => super.noSuchMethod( Invocation.method( @@ -4020,6 +4446,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override _i6.Future moveTo( double? to, { @@ -4040,6 +4467,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override void jumpToWithoutSettling(double? value) => super.noSuchMethod( Invocation.method( @@ -4048,6 +4476,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override _i3.ScrollHoldController hold(_i5.VoidCallback? holdCancelCallback) => (super.noSuchMethod( @@ -4070,6 +4499,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), ), ) as _i3.ScrollHoldController); + @override _i7.Drag drag( _i3.DragStartDetails? details, @@ -4104,6 +4534,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), ), ) as _i7.Drag); + @override void beginActivity(_i3.ScrollActivity? newActivity) => super.noSuchMethod( Invocation.method( @@ -4112,6 +4543,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void didStartScroll() => super.noSuchMethod( Invocation.method( @@ -4120,6 +4552,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void didUpdateScrollPositionBy(double? delta) => super.noSuchMethod( Invocation.method( @@ -4128,6 +4561,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void didEndScroll() => super.noSuchMethod( Invocation.method( @@ -4136,6 +4570,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void didOverscrollBy(double? value) => super.noSuchMethod( Invocation.method( @@ -4144,8 +4579,9 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override - void didUpdateScrollDirection(_i9.ScrollDirection? direction) => + void didUpdateScrollDirection(_i10.ScrollDirection? direction) => super.noSuchMethod( Invocation.method( #didUpdateScrollDirection, @@ -4153,6 +4589,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void didUpdateScrollMetrics() => super.noSuchMethod( Invocation.method( @@ -4161,6 +4598,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override bool recommendDeferredLoading(_i3.BuildContext? context) => (super.noSuchMethod( @@ -4171,6 +4609,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void dispose() => super.noSuchMethod( Invocation.method( @@ -4179,6 +4618,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void notifyListeners() => super.noSuchMethod( Invocation.method( @@ -4187,6 +4627,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void debugFillDescription(List? description) => super.noSuchMethod( Invocation.method( @@ -4195,6 +4636,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( @@ -4203,6 +4645,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( @@ -4211,6 +4654,7 @@ class MockScrollPosition extends _i1.Mock implements _i3.ScrollPosition { ), returnValueForMissingStub: null, ); + @override _i3.ScrollMetrics copyWith({ double? minScrollExtent, @@ -4277,6 +4721,7 @@ class MockStreamSubscription extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i6.Future cancel() => (super.noSuchMethod( Invocation.method( @@ -4286,6 +4731,7 @@ class MockStreamSubscription extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); + @override void onData(void Function(T)? handleData) => super.noSuchMethod( Invocation.method( @@ -4294,6 +4740,7 @@ class MockStreamSubscription extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void onError(Function? handleError) => super.noSuchMethod( Invocation.method( @@ -4302,6 +4749,7 @@ class MockStreamSubscription extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void onDone(void Function()? handleDone) => super.noSuchMethod( Invocation.method( @@ -4310,6 +4758,7 @@ class MockStreamSubscription extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void pause([_i6.Future? resumeSignal]) => super.noSuchMethod( Invocation.method( @@ -4318,6 +4767,7 @@ class MockStreamSubscription extends _i1.Mock ), returnValueForMissingStub: null, ); + @override void resume() => super.noSuchMethod( Invocation.method( @@ -4326,26 +4776,47 @@ class MockStreamSubscription extends _i1.Mock ), returnValueForMissingStub: null, ); + @override _i6.Future asFuture([E? futureValue]) => (super.noSuchMethod( Invocation.method( #asFuture, [futureValue], ), - returnValue: _FakeFuture_29( - this, - Invocation.method( - #asFuture, - [futureValue], - ), - ), - returnValueForMissingStub: _FakeFuture_29( - this, - Invocation.method( - #asFuture, - [futureValue], - ), - ), + returnValue: _i9.ifNotNull( + _i9.dummyValueOrNull( + this, + Invocation.method( + #asFuture, + [futureValue], + ), + ), + (E v) => _i6.Future.value(v), + ) ?? + _FakeFuture_29( + this, + Invocation.method( + #asFuture, + [futureValue], + ), + ), + returnValueForMissingStub: _i9.ifNotNull( + _i9.dummyValueOrNull( + this, + Invocation.method( + #asFuture, + [futureValue], + ), + ), + (E v) => _i6.Future.value(v), + ) ?? + _FakeFuture_29( + this, + Invocation.method( + #asFuture, + [futureValue], + ), + ), ) as _i6.Future); } @@ -4361,6 +4832,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override set onKeyEvent(_i3.FocusOnKeyEventCallback? _onKeyEvent) => super.noSuchMethod( @@ -4370,12 +4842,14 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override bool get skipTraversal => (super.noSuchMethod( Invocation.getter(#skipTraversal), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override set skipTraversal(bool? value) => super.noSuchMethod( Invocation.setter( @@ -4384,12 +4858,14 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override bool get canRequestFocus => (super.noSuchMethod( Invocation.getter(#canRequestFocus), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override set canRequestFocus(bool? value) => super.noSuchMethod( Invocation.setter( @@ -4398,12 +4874,14 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override bool get descendantsAreFocusable => (super.noSuchMethod( Invocation.getter(#descendantsAreFocusable), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override set descendantsAreFocusable(bool? value) => super.noSuchMethod( Invocation.setter( @@ -4412,12 +4890,14 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override bool get descendantsAreTraversable => (super.noSuchMethod( Invocation.getter(#descendantsAreTraversable), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override set descendantsAreTraversable(bool? value) => super.noSuchMethod( Invocation.setter( @@ -4426,18 +4906,21 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override Iterable<_i3.FocusNode> get children => (super.noSuchMethod( Invocation.getter(#children), returnValue: <_i3.FocusNode>[], returnValueForMissingStub: <_i3.FocusNode>[], ) as Iterable<_i3.FocusNode>); + @override Iterable<_i3.FocusNode> get traversalChildren => (super.noSuchMethod( Invocation.getter(#traversalChildren), returnValue: <_i3.FocusNode>[], returnValueForMissingStub: <_i3.FocusNode>[], ) as Iterable<_i3.FocusNode>); + @override set debugLabel(String? value) => super.noSuchMethod( Invocation.setter( @@ -4446,42 +4929,49 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override Iterable<_i3.FocusNode> get descendants => (super.noSuchMethod( Invocation.getter(#descendants), returnValue: <_i3.FocusNode>[], returnValueForMissingStub: <_i3.FocusNode>[], ) as Iterable<_i3.FocusNode>); + @override Iterable<_i3.FocusNode> get traversalDescendants => (super.noSuchMethod( Invocation.getter(#traversalDescendants), returnValue: <_i3.FocusNode>[], returnValueForMissingStub: <_i3.FocusNode>[], ) as Iterable<_i3.FocusNode>); + @override Iterable<_i3.FocusNode> get ancestors => (super.noSuchMethod( Invocation.getter(#ancestors), returnValue: <_i3.FocusNode>[], returnValueForMissingStub: <_i3.FocusNode>[], ) as Iterable<_i3.FocusNode>); + @override bool get hasFocus => (super.noSuchMethod( Invocation.getter(#hasFocus), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get hasPrimaryFocus => (super.noSuchMethod( Invocation.getter(#hasPrimaryFocus), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i3.FocusHighlightMode get highlightMode => (super.noSuchMethod( Invocation.getter(#highlightMode), returnValue: _i3.FocusHighlightMode.touch, returnValueForMissingStub: _i3.FocusHighlightMode.touch, ) as _i3.FocusHighlightMode); + @override _i5.Size get size => (super.noSuchMethod( Invocation.getter(#size), @@ -4494,6 +4984,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { Invocation.getter(#size), ), ) as _i5.Size); + @override _i5.Offset get offset => (super.noSuchMethod( Invocation.getter(#offset), @@ -4506,6 +4997,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { Invocation.getter(#offset), ), ) as _i5.Offset); + @override _i5.Rect get rect => (super.noSuchMethod( Invocation.getter(#rect), @@ -4518,12 +5010,14 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { Invocation.getter(#rect), ), ) as _i5.Rect); + @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override void unfocus( {_i3.UnfocusDisposition? disposition = @@ -4536,6 +5030,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override bool consumeKeyboardToken() => (super.noSuchMethod( Invocation.method( @@ -4545,6 +5040,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i3.FocusAttachment attach( _i3.BuildContext? context, { @@ -4583,6 +5079,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), ), ) as _i3.FocusAttachment); + @override void dispose() => super.noSuchMethod( Invocation.method( @@ -4591,6 +5088,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override void requestFocus([_i3.FocusNode? node]) => super.noSuchMethod( Invocation.method( @@ -4599,6 +5097,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override bool nextFocus() => (super.noSuchMethod( Invocation.method( @@ -4608,6 +5107,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool previousFocus() => (super.noSuchMethod( Invocation.method( @@ -4617,6 +5117,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool focusInDirection(_i3.TraversalDirection? direction) => (super.noSuchMethod( @@ -4627,8 +5128,9 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override - void debugFillProperties(_i10.DiagnosticPropertiesBuilder? properties) => + void debugFillProperties(_i11.DiagnosticPropertiesBuilder? properties) => super.noSuchMethod( Invocation.method( #debugFillProperties, @@ -4636,6 +5138,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override List<_i3.DiagnosticsNode> debugDescribeChildren() => (super.noSuchMethod( Invocation.method( @@ -4645,18 +5148,33 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { returnValue: <_i3.DiagnosticsNode>[], returnValueForMissingStub: <_i3.DiagnosticsNode>[], ) as List<_i3.DiagnosticsNode>); + @override String toStringShort() => (super.noSuchMethod( Invocation.method( #toStringShort, [], ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i9.dummyValue( + this, + Invocation.method( + #toStringShort, + [], + ), + ), + returnValueForMissingStub: _i9.dummyValue( + this, + Invocation.method( + #toStringShort, + [], + ), + ), ) as String); + @override String toString({_i3.DiagnosticLevel? minLevel = _i3.DiagnosticLevel.info}) => super.toString(); + @override String toStringShallow({ String? joiner = r', ', @@ -4671,9 +5189,30 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { #minLevel: minLevel, }, ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i9.dummyValue( + this, + Invocation.method( + #toStringShallow, + [], + { + #joiner: joiner, + #minLevel: minLevel, + }, + ), + ), + returnValueForMissingStub: _i9.dummyValue( + this, + Invocation.method( + #toStringShallow, + [], + { + #joiner: joiner, + #minLevel: minLevel, + }, + ), + ), ) as String); + @override String toStringDeep({ String? prefixLineOne = r'', @@ -4690,13 +5229,36 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { #minLevel: minLevel, }, ), - returnValue: '', - returnValueForMissingStub: '', + returnValue: _i9.dummyValue( + this, + Invocation.method( + #toStringDeep, + [], + { + #prefixLineOne: prefixLineOne, + #prefixOtherLines: prefixOtherLines, + #minLevel: minLevel, + }, + ), + ), + returnValueForMissingStub: _i9.dummyValue( + this, + Invocation.method( + #toStringDeep, + [], + { + #prefixLineOne: prefixLineOne, + #prefixOtherLines: prefixOtherLines, + #minLevel: minLevel, + }, + ), + ), ) as String); + @override _i3.DiagnosticsNode toDiagnosticsNode({ String? name, - _i11.DiagnosticsTreeStyle? style, + _i12.DiagnosticsTreeStyle? style, }) => (super.noSuchMethod( Invocation.method( @@ -4730,6 +5292,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), ), ) as _i3.DiagnosticsNode); + @override void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( @@ -4738,6 +5301,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( @@ -4746,6 +5310,7 @@ class MockFocusNode extends _i1.Mock implements _i3.FocusNode { ), returnValueForMissingStub: null, ); + @override void notifyListeners() => super.noSuchMethod( Invocation.method( diff --git a/test/scenario/columns_footer/rendering_test.dart b/test/scenario/columns_footer/rendering_test.dart index fa943cafb..e095b73e9 100644 --- a/test/scenario/columns_footer/rendering_test.dart +++ b/test/scenario/columns_footer/rendering_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/scenario/configuration/behavior_setting_enter_key_action_test.dart b/test/scenario/configuration/behavior_setting_enter_key_action_test.dart index 43d2186b5..b40f6f27b 100644 --- a/test/scenario/configuration/behavior_setting_enter_key_action_test.dart +++ b/test/scenario/configuration/behavior_setting_enter_key_action_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/configuration/behavior_setting_row_height_test.dart b/test/scenario/configuration/behavior_setting_row_height_test.dart index 8fe8380a1..191c13d18 100644 --- a/test/scenario/configuration/behavior_setting_row_height_test.dart +++ b/test/scenario/configuration/behavior_setting_row_height_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/editing_cell_state/auto_editing_of_column_test.dart b/test/scenario/editing_cell_state/auto_editing_of_column_test.dart index d3c80b504..c9040f526 100644 --- a/test/scenario/editing_cell_state/auto_editing_of_column_test.dart +++ b/test/scenario/editing_cell_state/auto_editing_of_column_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/pluto_widget_test_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/scenario/editing_cell_state/auto_editing_test.dart b/test/scenario/editing_cell_state/auto_editing_test.dart index b48bdff6f..55a20922f 100644 --- a/test/scenario/editing_cell_state/auto_editing_test.dart +++ b/test/scenario/editing_cell_state/auto_editing_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/editing_cell_state/number_cell_editing_test.dart b/test/scenario/editing_cell_state/number_cell_editing_test.dart index ad0395b93..4e2fd01ea 100644 --- a/test/scenario/editing_cell_state/number_cell_editing_test.dart +++ b/test/scenario/editing_cell_state/number_cell_editing_test.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../mock/mock_methods.dart'; diff --git a/test/scenario/filtering/currency_filtering_test.dart b/test/scenario/filtering/currency_filtering_test.dart index 3647b7e7f..e63e5073b 100644 --- a/test/scenario/filtering/currency_filtering_test.dart +++ b/test/scenario/filtering/currency_filtering_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; void main() { late PlutoGridStateManager stateManager; diff --git a/test/scenario/filtering/number_filtering_test.dart b/test/scenario/filtering/number_filtering_test.dart index 5384821a8..cf4620195 100644 --- a/test/scenario/filtering/number_filtering_test.dart +++ b/test/scenario/filtering/number_filtering_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; void main() { late PlutoGridStateManager stateManager; diff --git a/test/scenario/filtering/text_filtering_test.dart b/test/scenario/filtering/text_filtering_test.dart index a27360748..34a04cb1d 100644 --- a/test/scenario/filtering/text_filtering_test.dart +++ b/test/scenario/filtering/text_filtering_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/scenario/freeze_columns/behavior_absence_freeze_column_test.dart b/test/scenario/freeze_columns/behavior_absence_freeze_column_test.dart index 1d33fa425..1eec21998 100644 --- a/test/scenario/freeze_columns/behavior_absence_freeze_column_test.dart +++ b/test/scenario/freeze_columns/behavior_absence_freeze_column_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/freeze_columns/behavior_presence_freeze_column_test.dart b/test/scenario/freeze_columns/behavior_presence_freeze_column_test.dart index 0f46105f3..a44c606c1 100644 --- a/test/scenario/freeze_columns/behavior_presence_freeze_column_test.dart +++ b/test/scenario/freeze_columns/behavior_presence_freeze_column_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/scenario/grid_mode/multi_select_mode_test.dart b/test/scenario/grid_mode/multi_select_mode_test.dart index f03f920b1..65c5ac3b2 100644 --- a/test/scenario/grid_mode/multi_select_mode_test.dart +++ b/test/scenario/grid_mode/multi_select_mode_test.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/build_grid_helper.dart'; import '../../helper/column_helper.dart'; diff --git a/test/scenario/grid_mode/select_mode_test.dart b/test/scenario/grid_mode/select_mode_test.dart index fdf8d6ef6..f86cd9175 100644 --- a/test/scenario/grid_mode/select_mode_test.dart +++ b/test/scenario/grid_mode/select_mode_test.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/grid_mode/select_with_one_tap_test.dart b/test/scenario/grid_mode/select_with_one_tap_test.dart index d09fd80cd..0891ff8a7 100644 --- a/test/scenario/grid_mode/select_with_one_tap_test.dart +++ b/test/scenario/grid_mode/select_with_one_tap_test.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/grouping_columns/rendering_test.dart b/test/scenario/grouping_columns/rendering_test.dart index cc3656535..187a48fc9 100644 --- a/test/scenario/grouping_columns/rendering_test.dart +++ b/test/scenario/grouping_columns/rendering_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/scenario/grouping_rows/checkbox_test.dart b/test/scenario/grouping_rows/checkbox_test.dart index 054002d8e..dd638413f 100644 --- a/test/scenario/grouping_rows/checkbox_test.dart +++ b/test/scenario/grouping_rows/checkbox_test.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/test_helper_util.dart'; diff --git a/test/scenario/grouping_rows/on_toggled_test.dart b/test/scenario/grouping_rows/on_toggled_test.dart index 23845e519..4d8889fa2 100644 --- a/test/scenario/grouping_rows/on_toggled_test.dart +++ b/test/scenario/grouping_rows/on_toggled_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/test_helper_util.dart'; diff --git a/test/scenario/grouping_rows/rendering_test.dart b/test/scenario/grouping_rows/rendering_test.dart index 809d45b6c..d7fdf3e67 100644 --- a/test/scenario/grouping_rows/rendering_test.dart +++ b/test/scenario/grouping_rows/rendering_test.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/column_helper.dart'; import '../../helper/test_helper_util.dart'; diff --git a/test/scenario/grouping_rows/sorting_tree_group_test.dart b/test/scenario/grouping_rows/sorting_tree_group_test.dart index 0d2ffa282..25dabb879 100644 --- a/test/scenario/grouping_rows/sorting_tree_group_test.dart +++ b/test/scenario/grouping_rows/sorting_tree_group_test.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/test_helper_util.dart'; diff --git a/test/scenario/hide_columns/hide_column_test.dart b/test/scenario/hide_columns/hide_column_test.dart index cf57da810..b957742e7 100644 --- a/test/scenario/hide_columns/hide_column_test.dart +++ b/test/scenario/hide_columns/hide_column_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/insert_columns/rendering_test.dart b/test/scenario/insert_columns/rendering_test.dart index d35c5078f..33454262a 100644 --- a/test/scenario/insert_columns/rendering_test.dart +++ b/test/scenario/insert_columns/rendering_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/scenario/keyboard/behavior_ctrl_a_key_test.dart b/test/scenario/keyboard/behavior_ctrl_a_key_test.dart index 9251a83b2..677b171ef 100644 --- a/test/scenario/keyboard/behavior_ctrl_a_key_test.dart +++ b/test/scenario/keyboard/behavior_ctrl_a_key_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/keyboard/behavior_enter_key_test.dart b/test/scenario/keyboard/behavior_enter_key_test.dart index baa511356..bb79d74ac 100644 --- a/test/scenario/keyboard/behavior_enter_key_test.dart +++ b/test/scenario/keyboard/behavior_enter_key_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/keyboard/behavior_esc_key_test.dart b/test/scenario/keyboard/behavior_esc_key_test.dart index 5ac75cf47..0b48bb788 100644 --- a/test/scenario/keyboard/behavior_esc_key_test.dart +++ b/test/scenario/keyboard/behavior_esc_key_test.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/keyboard/behavior_f2_key_test.dart b/test/scenario/keyboard/behavior_f2_key_test.dart index ee4a8e182..82696ed91 100644 --- a/test/scenario/keyboard/behavior_f2_key_test.dart +++ b/test/scenario/keyboard/behavior_f2_key_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/keyboard/behavior_f3_key_test.dart b/test/scenario/keyboard/behavior_f3_key_test.dart index fb520ca1d..2f0f61b82 100644 --- a/test/scenario/keyboard/behavior_f3_key_test.dart +++ b/test/scenario/keyboard/behavior_f3_key_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/keyboard/behavior_moving_column_filter_test.dart b/test/scenario/keyboard/behavior_moving_column_filter_test.dart index dc4e8cf9a..ca725f323 100644 --- a/test/scenario/keyboard/behavior_moving_column_filter_test.dart +++ b/test/scenario/keyboard/behavior_moving_column_filter_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/keyboard/behavior_tab_key_test.dart b/test/scenario/keyboard/behavior_tab_key_test.dart index e19119d8a..dbad53ea2 100644 --- a/test/scenario/keyboard/behavior_tab_key_test.dart +++ b/test/scenario/keyboard/behavior_tab_key_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/keyboard/behavior_to_call_popup_with_keyboard_test.dart b/test/scenario/keyboard/behavior_to_call_popup_with_keyboard_test.dart index dbd2cd45c..d6bf09324 100644 --- a/test/scenario/keyboard/behavior_to_call_popup_with_keyboard_test.dart +++ b/test/scenario/keyboard/behavior_to_call_popup_with_keyboard_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/keyboard/custom_shortcut_test.dart b/test/scenario/keyboard/custom_shortcut_test.dart index d53b9632a..becb8870a 100644 --- a/test/scenario/keyboard/custom_shortcut_test.dart +++ b/test/scenario/keyboard/custom_shortcut_test.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/scenario/layout/layout_test.dart b/test/scenario/layout/layout_test.dart index a58db8753..2f17f78ee 100644 --- a/test/scenario/layout/layout_test.dart +++ b/test/scenario/layout/layout_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/scenario/paginate_rows/button_navigation_test.dart b/test/scenario/paginate_rows/button_navigation_test.dart index 07bcd1eb9..877229d2c 100644 --- a/test/scenario/paginate_rows/button_navigation_test.dart +++ b/test/scenario/paginate_rows/button_navigation_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/paginate_rows/infinity_scroll_rows_test.dart b/test/scenario/paginate_rows/infinity_scroll_rows_test.dart index 0214cc49f..16f189ee7 100644 --- a/test/scenario/paginate_rows/infinity_scroll_rows_test.dart +++ b/test/scenario/paginate_rows/infinity_scroll_rows_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/scenario/paginate_rows/lazy_pagination_test.dart b/test/scenario/paginate_rows/lazy_pagination_test.dart index 877c8bd8c..dce14b045 100644 --- a/test/scenario/paginate_rows/lazy_pagination_test.dart +++ b/test/scenario/paginate_rows/lazy_pagination_test.dart @@ -3,8 +3,8 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/scenario/paginate_rows/sorting_test.dart b/test/scenario/paginate_rows/sorting_test.dart index 89abfa06f..c7eb61427 100644 --- a/test/scenario/paginate_rows/sorting_test.dart +++ b/test/scenario/paginate_rows/sorting_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/pluto_base_cell.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/pluto_base_cell.dart'; void main() { late PlutoGridStateManager stateManager; diff --git a/test/scenario/resizing_window/layout_test.dart b/test/scenario/resizing_window/layout_test.dart index e2be5ae02..b7759df35 100644 --- a/test/scenario/resizing_window/layout_test.dart +++ b/test/scenario/resizing_window/layout_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/scenario/selecting/behavior_after_selecting_cells_test.dart b/test/scenario/selecting/behavior_after_selecting_cells_test.dart index 0290e353a..bc31206fc 100644 --- a/test/scenario/selecting/behavior_after_selecting_cells_test.dart +++ b/test/scenario/selecting/behavior_after_selecting_cells_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/selecting/behavior_after_selecting_rows_test.dart b/test/scenario/selecting/behavior_after_selecting_rows_test.dart index 036be94f6..b5f01e9a3 100644 --- a/test/scenario/selecting/behavior_after_selecting_rows_test.dart +++ b/test/scenario/selecting/behavior_after_selecting_rows_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/scenario/selecting/selecting_cells_by_long_tap_test.dart b/test/scenario/selecting/selecting_cells_by_long_tap_test.dart index d65b7da71..4ade51f87 100644 --- a/test/scenario/selecting/selecting_cells_by_long_tap_test.dart +++ b/test/scenario/selecting/selecting_cells_by_long_tap_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/build_grid_helper.dart'; diff --git a/test/src/helper/filter_helper_test.dart b/test/src/helper/filter_helper_test.dart index 074bbe2bd..b807acc6e 100644 --- a/test/src/helper/filter_helper_test.dart +++ b/test/src/helper/filter_helper_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/src/helper/filtered_list_test.dart b/test/src/helper/filtered_list_test.dart index b1c0148a3..f2cfc31ed 100644 --- a/test/src/helper/filtered_list_test.dart +++ b/test/src/helper/filtered_list_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; void main() { group('Int List 를 짝수로 필터링.', () { diff --git a/test/src/helper/pluto_aggregate_helper_test.dart b/test/src/helper/pluto_aggregate_helper_test.dart index 96f630a94..080be252c 100644 --- a/test/src/helper/pluto_aggregate_helper_test.dart +++ b/test/src/helper/pluto_aggregate_helper_test.dart @@ -1,412 +1,412 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; - -void main() { - group('sum', () { - test('숫자 컬럼이 아닌경우 0이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.text(), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: '10.001')}), - PlutoRow(cells: {'column': PlutoCell(value: '10.001')}), - PlutoRow(cells: {'column': PlutoCell(value: '10.001')}), - PlutoRow(cells: {'column': PlutoCell(value: '10.001')}), - PlutoRow(cells: {'column': PlutoCell(value: '10.001')}), - ]; - - expect(PlutoAggregateHelper.sum(rows: rows, column: column), 0); - }); - - test('[양수] condition 이 없이 sum 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10)}), - PlutoRow(cells: {'column': PlutoCell(value: 20)}), - PlutoRow(cells: {'column': PlutoCell(value: 30)}), - PlutoRow(cells: {'column': PlutoCell(value: 40)}), - PlutoRow(cells: {'column': PlutoCell(value: 50)}), - ]; - - expect(PlutoAggregateHelper.sum(rows: rows, column: column), 150); - }); - - test('[음수] condition 이 없이 sum 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: -10)}), - PlutoRow(cells: {'column': PlutoCell(value: -20)}), - PlutoRow(cells: {'column': PlutoCell(value: -30)}), - PlutoRow(cells: {'column': PlutoCell(value: -40)}), - PlutoRow(cells: {'column': PlutoCell(value: -50)}), - ]; - - expect(PlutoAggregateHelper.sum(rows: rows, column: column), -150); - }); - - test('[소수] condition 이 없이 sum 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - ]; - - expect(PlutoAggregateHelper.sum(rows: rows, column: column), 50.005); - }); - - test('condition 이 있는 경우 조건에 맞는 아이템의 합계 값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - ]; - - expect( - PlutoAggregateHelper.sum( - rows: rows, - column: column, - filter: (PlutoCell cell) => cell.value == 10.001, - ), - 30.003, - ); - }); - - test('condition 이 있는 경우 조건에 맞는 아이템이 없다면 0이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - ]; - - expect( - PlutoAggregateHelper.sum( - rows: rows, - column: column, - filter: (PlutoCell cell) => cell.value == 10.003, - ), - 0, - ); - }); - }); - - group('average', () { - test('[양수] condition 이 없이 average 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10)}), - PlutoRow(cells: {'column': PlutoCell(value: 20)}), - PlutoRow(cells: {'column': PlutoCell(value: 30)}), - PlutoRow(cells: {'column': PlutoCell(value: 40)}), - PlutoRow(cells: {'column': PlutoCell(value: 50)}), - ]; - - expect(PlutoAggregateHelper.average(rows: rows, column: column), 30); - }); - - test('[음수] condition 이 없이 average 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: -10)}), - PlutoRow(cells: {'column': PlutoCell(value: -20)}), - PlutoRow(cells: {'column': PlutoCell(value: -30)}), - PlutoRow(cells: {'column': PlutoCell(value: -40)}), - PlutoRow(cells: {'column': PlutoCell(value: -50)}), - ]; - - expect(PlutoAggregateHelper.average(rows: rows, column: column), -30); - }); - - test('[소수] condition 이 없이 average 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), - ]; - - expect(PlutoAggregateHelper.average(rows: rows, column: column), 10.003); - }); - }); - - group('min', () { - test('[양수] condition 이 없이 min 을 호출 한 경우 최소 값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 101)}), - PlutoRow(cells: {'column': PlutoCell(value: 102)}), - PlutoRow(cells: {'column': PlutoCell(value: 103)}), - PlutoRow(cells: {'column': PlutoCell(value: 104)}), - PlutoRow(cells: {'column': PlutoCell(value: 105)}), - ]; - - expect(PlutoAggregateHelper.min(rows: rows, column: column), 101); - }); - - test('[음수] condition 이 없이 min 을 호출 한 경우 최소 값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: -101)}), - PlutoRow(cells: {'column': PlutoCell(value: -102)}), - PlutoRow(cells: {'column': PlutoCell(value: -103)}), - PlutoRow(cells: {'column': PlutoCell(value: -104)}), - PlutoRow(cells: {'column': PlutoCell(value: -105)}), - ]; - - expect(PlutoAggregateHelper.min(rows: rows, column: column), -105); - }); - - test('[소수] condition 이 없이 min 을 호출 한 경우 최소 값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), - ]; - - expect(PlutoAggregateHelper.min(rows: rows, column: column), 10.001); - }); - - test('condition 이 있는 경우 조건에 맞는 아이템이 있다면 조건내에서 최소값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), - ]; - - expect( - PlutoAggregateHelper.min( - rows: rows, - column: column, - filter: (PlutoCell cell) => cell.value >= 10.003, - ), - 10.003, - ); - }); - - test('condition 이 있는 경우 조건에 맞는 아이템이 없다면 null 이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - ]; - - expect( - PlutoAggregateHelper.min( - rows: rows, - column: column, - filter: (PlutoCell cell) => cell.value == 10.003, - ), - null, - ); - }); - }); - - group('max', () { - test('condition 이 있는 경우 조건에 맞는 아이템이 있다면 조건내에서 최대값이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), - ]; - - expect( - PlutoAggregateHelper.max( - rows: rows, - column: column, - filter: (PlutoCell cell) => cell.value >= 10.003, - ), - 10.005, - ); - }); - - test('condition 이 있는 경우 조건에 맞는 아이템이 없다면 null 이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), - ]; - - expect( - PlutoAggregateHelper.max( - rows: rows, - column: column, - filter: (PlutoCell cell) => cell.value >= 10.006, - ), - null, - ); - }); - }); - - group('count', () { - test('condition 이 없는 경우 전체 리스트 개수가 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), - ]; - - expect(PlutoAggregateHelper.count(rows: rows, column: column), 5); - }); - - test('condition 이 있는 경우 조건에 맞는 아이템이 있다면 조건에 맞는 아이템 개수가 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), - ]; - - expect( - PlutoAggregateHelper.count( - rows: rows, - column: column, - filter: (PlutoCell cell) => cell.value >= 10.003, - ), - 3, - ); - }); - - test('condition 이 있는 경우 조건에 맞는 아이템이 없다면 0 이 리턴 되어야 한다.', () { - final column = PlutoColumn( - title: 'column', - field: 'column', - type: PlutoColumnType.number(format: '#,###.###'), - ); - - final rows = [ - PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), - PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), - ]; - - expect( - PlutoAggregateHelper.count( - rows: rows, - column: column, - filter: (PlutoCell cell) => cell.value >= 10.006, - ), - 0, - ); - }); - }); -} +import 'package:flutter_test/flutter_test.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; + +void main() { + group('sum', () { + test('숫자 컬럼이 아닌경우 0이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.text(), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: '10.001')}), + PlutoRow(cells: {'column': PlutoCell(value: '10.001')}), + PlutoRow(cells: {'column': PlutoCell(value: '10.001')}), + PlutoRow(cells: {'column': PlutoCell(value: '10.001')}), + PlutoRow(cells: {'column': PlutoCell(value: '10.001')}), + ]; + + expect(PlutoAggregateHelper.sum(rows: rows, column: column), 0); + }); + + test('[양수] condition 이 없이 sum 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10)}), + PlutoRow(cells: {'column': PlutoCell(value: 20)}), + PlutoRow(cells: {'column': PlutoCell(value: 30)}), + PlutoRow(cells: {'column': PlutoCell(value: 40)}), + PlutoRow(cells: {'column': PlutoCell(value: 50)}), + ]; + + expect(PlutoAggregateHelper.sum(rows: rows, column: column), 150); + }); + + test('[음수] condition 이 없이 sum 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: -10)}), + PlutoRow(cells: {'column': PlutoCell(value: -20)}), + PlutoRow(cells: {'column': PlutoCell(value: -30)}), + PlutoRow(cells: {'column': PlutoCell(value: -40)}), + PlutoRow(cells: {'column': PlutoCell(value: -50)}), + ]; + + expect(PlutoAggregateHelper.sum(rows: rows, column: column), -150); + }); + + test('[소수] condition 이 없이 sum 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + ]; + + expect(PlutoAggregateHelper.sum(rows: rows, column: column), 50.005); + }); + + test('condition 이 있는 경우 조건에 맞는 아이템의 합계 값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + ]; + + expect( + PlutoAggregateHelper.sum( + rows: rows, + column: column, + filter: (PlutoCell cell) => cell.value == 10.001, + ), + 30.003, + ); + }); + + test('condition 이 있는 경우 조건에 맞는 아이템이 없다면 0이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + ]; + + expect( + PlutoAggregateHelper.sum( + rows: rows, + column: column, + filter: (PlutoCell cell) => cell.value == 10.003, + ), + null, + ); + }); + }); + + group('average', () { + test('[양수] condition 이 없이 average 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10)}), + PlutoRow(cells: {'column': PlutoCell(value: 20)}), + PlutoRow(cells: {'column': PlutoCell(value: 30)}), + PlutoRow(cells: {'column': PlutoCell(value: 40)}), + PlutoRow(cells: {'column': PlutoCell(value: 50)}), + ]; + + expect(PlutoAggregateHelper.average(rows: rows, column: column), 30); + }); + + test('[음수] condition 이 없이 average 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: -10)}), + PlutoRow(cells: {'column': PlutoCell(value: -20)}), + PlutoRow(cells: {'column': PlutoCell(value: -30)}), + PlutoRow(cells: {'column': PlutoCell(value: -40)}), + PlutoRow(cells: {'column': PlutoCell(value: -50)}), + ]; + + expect(PlutoAggregateHelper.average(rows: rows, column: column), -30); + }); + + test('[소수] condition 이 없이 average 을 호출 한 경우 전체 합계 값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), + ]; + + expect(PlutoAggregateHelper.average(rows: rows, column: column), 10.003); + }); + }); + + group('min', () { + test('[양수] condition 이 없이 min 을 호출 한 경우 최소 값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 101)}), + PlutoRow(cells: {'column': PlutoCell(value: 102)}), + PlutoRow(cells: {'column': PlutoCell(value: 103)}), + PlutoRow(cells: {'column': PlutoCell(value: 104)}), + PlutoRow(cells: {'column': PlutoCell(value: 105)}), + ]; + + expect(PlutoAggregateHelper.min(rows: rows, column: column), 101); + }); + + test('[음수] condition 이 없이 min 을 호출 한 경우 최소 값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: -101)}), + PlutoRow(cells: {'column': PlutoCell(value: -102)}), + PlutoRow(cells: {'column': PlutoCell(value: -103)}), + PlutoRow(cells: {'column': PlutoCell(value: -104)}), + PlutoRow(cells: {'column': PlutoCell(value: -105)}), + ]; + + expect(PlutoAggregateHelper.min(rows: rows, column: column), -105); + }); + + test('[소수] condition 이 없이 min 을 호출 한 경우 최소 값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), + ]; + + expect(PlutoAggregateHelper.min(rows: rows, column: column), 10.001); + }); + + test('condition 이 있는 경우 조건에 맞는 아이템이 있다면 조건내에서 최소값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), + ]; + + expect( + PlutoAggregateHelper.min( + rows: rows, + column: column, + filter: (PlutoCell cell) => cell.value >= 10.003, + ), + 10.003, + ); + }); + + test('condition 이 있는 경우 조건에 맞는 아이템이 없다면 null 이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + ]; + + expect( + PlutoAggregateHelper.min( + rows: rows, + column: column, + filter: (PlutoCell cell) => cell.value == 10.003, + ), + null, + ); + }); + }); + + group('max', () { + test('condition 이 있는 경우 조건에 맞는 아이템이 있다면 조건내에서 최대값이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), + ]; + + expect( + PlutoAggregateHelper.max( + rows: rows, + column: column, + filter: (PlutoCell cell) => cell.value >= 10.003, + ), + 10.005, + ); + }); + + test('condition 이 있는 경우 조건에 맞는 아이템이 없다면 null 이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), + ]; + + expect( + PlutoAggregateHelper.max( + rows: rows, + column: column, + filter: (PlutoCell cell) => cell.value >= 10.006, + ), + null, + ); + }); + }); + + group('count', () { + test('condition 이 없는 경우 전체 리스트 개수가 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), + ]; + + expect(PlutoAggregateHelper.count(rows: rows, column: column), 5); + }); + + test('condition 이 있는 경우 조건에 맞는 아이템이 있다면 조건에 맞는 아이템 개수가 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), + ]; + + expect( + PlutoAggregateHelper.count( + rows: rows, + column: column, + filter: (PlutoCell cell) => cell.value >= 10.003, + ), + 3, + ); + }); + + test('condition 이 있는 경우 조건에 맞는 아이템이 없다면 0 이 리턴 되어야 한다.', () { + final column = PlutoColumn( + title: 'column', + field: 'column', + type: PlutoColumnType.number(format: '#,###.###'), + ); + + final rows = [ + PlutoRow(cells: {'column': PlutoCell(value: 10.001)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.002)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.003)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.004)}), + PlutoRow(cells: {'column': PlutoCell(value: 10.005)}), + ]; + + expect( + PlutoAggregateHelper.count( + rows: rows, + column: column, + filter: (PlutoCell cell) => cell.value >= 10.006, + ), + 0, + ); + }); + }); +} diff --git a/test/src/helper/pluto_column_group_helper_test.dart b/test/src/helper/pluto_column_group_helper_test.dart index 778237f5c..a600636fe 100644 --- a/test/src/helper/pluto_column_group_helper_test.dart +++ b/test/src/helper/pluto_column_group_helper_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; diff --git a/test/src/helper/pluto_date_time_helper_test.dart b/test/src/helper/pluto_date_time_helper_test.dart index 2be1bc0f4..e625ab442 100644 --- a/test/src/helper/pluto_date_time_helper_test.dart +++ b/test/src/helper/pluto_date_time_helper_test.dart @@ -1,7 +1,7 @@ // ignore_for_file: slash_for_doc_comments import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; /** 2022. 11 월 달력 diff --git a/test/src/helper/pluto_debounce_test.dart b/test/src/helper/pluto_debounce_test.dart index 5fc14b6df..184b25f21 100644 --- a/test/src/helper/pluto_debounce_test.dart +++ b/test/src/helper/pluto_debounce_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; void main() { group('PlutoDebounce', () { diff --git a/test/src/helper/pluto_key_manager_event_test.dart b/test/src/helper/pluto_key_manager_event_test.dart index f0907a12d..f91afa98f 100644 --- a/test/src/helper/pluto_key_manager_event_test.dart +++ b/test/src/helper/pluto_key_manager_event_test.dart @@ -1,181 +1,243 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; - -void main() { - late FocusNode focusNode; - - late PlutoKeyManagerEvent? keyManagerEvent; - - KeyEventResult callback(FocusNode node, RawKeyEvent event) { - keyManagerEvent = PlutoKeyManagerEvent( - focusNode: node, - event: event, - ); - - return KeyEventResult.handled; - } - - setUp(() { - focusNode = FocusNode(); - }); - - tearDown(() { - keyManagerEvent = null; - focusNode.dispose(); - }); - - Future buildWidget({ - required WidgetTester tester, - required KeyEventResult Function(FocusNode, RawKeyEvent) callback, - }) async { - await tester.pumpWidget(MaterialApp( - home: FocusScope( - autofocus: true, - onKey: callback, - child: Focus( - focusNode: focusNode, - child: const SizedBox(width: 100, height: 100), - ), - ), - )); - - focusNode.requestFocus(); - } - - testWidgets( - '아무 키나 입력하면 isKeyDownEvent 가 true 여야 한다.', - (tester) async { - await buildWidget(tester: tester, callback: callback); - - const key = LogicalKeyboardKey.keyE; - await tester.sendKeyDownEvent(key); - expect(keyManagerEvent!.isKeyDownEvent, true); - await tester.sendKeyUpEvent(key); - expect(keyManagerEvent!.isKeyDownEvent, false); - }, - ); - - testWidgets( - 'Home 키를 입력하면 isHome 이 true 여야 한다.', - (tester) async { - late PlutoKeyManagerEvent keyManagerEvent; - - KeyEventResult callback(FocusNode node, RawKeyEvent event) { - keyManagerEvent = PlutoKeyManagerEvent( - focusNode: node, - event: event, - ); - - return KeyEventResult.handled; - } - - await buildWidget(tester: tester, callback: callback); - - const key = LogicalKeyboardKey.home; - await tester.sendKeyDownEvent(key); - expect(keyManagerEvent.isHome, true); - await tester.sendKeyUpEvent(key); - }, - ); - - testWidgets( - 'End 키를 입력하면 isEnd 가 true 여야 한다.', - (tester) async { - await buildWidget(tester: tester, callback: callback); - - const key = LogicalKeyboardKey.end; - await tester.sendKeyDownEvent(key); - expect(keyManagerEvent!.isEnd, true); - await tester.sendKeyUpEvent(key); - }, - ); - - testWidgets( - 'F4 키를 입력하면 isF4 가 true 여야 한다.', - (tester) async { - await buildWidget(tester: tester, callback: callback); - - const key = LogicalKeyboardKey.f4; - await tester.sendKeyDownEvent(key); - expect(keyManagerEvent!.isF4, true); - await tester.sendKeyUpEvent(key); - }, - ); - - testWidgets( - 'Backspace 키를 입력하면 isBackspace 가 true 여야 한다.', - (tester) async { - await buildWidget(tester: tester, callback: callback); - - const key = LogicalKeyboardKey.backspace; - await tester.sendKeyDownEvent(key); - expect(keyManagerEvent!.isBackspace, true); - await tester.sendKeyUpEvent(key); - }, - ); - - testWidgets( - 'Shift 키를 입력하면 isShift 가 true 여야 한다.', - (tester) async { - await buildWidget(tester: tester, callback: callback); - - const key = LogicalKeyboardKey.shift; - await tester.sendKeyDownEvent(key); - expect(keyManagerEvent!.isShift, true); - await tester.sendKeyUpEvent(key); - }, - ); - - testWidgets( - 'Control 키를 입력하면 isControl 가 true 여야 한다.', - (tester) async { - await buildWidget(tester: tester, callback: callback); - - const key = LogicalKeyboardKey.control; - await tester.sendKeyDownEvent(key); - expect(keyManagerEvent!.isControl, true); - await tester.sendKeyUpEvent(key); - }, - ); - - testWidgets( - 'Control + C 키를 입력하면 isCtrlC 가 true 여야 한다.', - (tester) async { - await buildWidget(tester: tester, callback: callback); - - const key = LogicalKeyboardKey.control; - await tester.sendKeyDownEvent(key); - await tester.sendKeyUpEvent(LogicalKeyboardKey.keyC); - expect(keyManagerEvent!.isCtrlC, true); - await tester.sendKeyUpEvent(key); - }, - ); - - testWidgets( - 'Control + V 키를 입력하면 isCtrlV 가 true 여야 한다.', - (tester) async { - await buildWidget(tester: tester, callback: callback); - - const key = LogicalKeyboardKey.control; - await tester.sendKeyDownEvent(key); - await tester.sendKeyUpEvent(LogicalKeyboardKey.keyV); - expect(keyManagerEvent!.isCtrlV, true); - await tester.sendKeyUpEvent(key); - }, - ); - - testWidgets( - 'Control + A 키를 입력하면 isCtrlA 가 true 여야 한다.', - (tester) async { - await buildWidget(tester: tester, callback: callback); - - const key = LogicalKeyboardKey.control; - await tester.sendKeyDownEvent(key); - await tester.sendKeyUpEvent(LogicalKeyboardKey.keyA); - expect(keyManagerEvent!.isCtrlA, true); - await tester.sendKeyUpEvent(key); - }, - ); -} +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; + +void main() { + late FocusNode focusNode; + + late PlutoKeyManagerEvent? keyManagerEvent; + + KeyEventResult callback(FocusNode node, KeyEvent event) { + keyManagerEvent = PlutoKeyManagerEvent( + focusNode: node, + event: event, + isLogicalKeyPressed: HardwareKeyboard.instance.isLogicalKeyPressed, + ); + + return KeyEventResult.handled; + } + + setUp(() { + focusNode = FocusNode(); + }); + + tearDown(() { + keyManagerEvent = null; + }); + + Future buildWidget({ + required WidgetTester tester, + required FocusOnKeyEventCallback callback, + }) async { + await tester.pumpWidget(MaterialApp( + home: FocusScope( + autofocus: true, + onKeyEvent: callback, + child: Focus( + focusNode: focusNode, + child: const SizedBox(width: 100, height: 100), + ), + ), + )); + + focusNode.requestFocus(); + } + + testWidgets( + 'When any key is pressed, isKeyDownEvent must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.keyE; + await tester.sendKeyDownEvent(key); + expect(keyManagerEvent!.isKeyDownEvent, true); + await tester.sendKeyUpEvent(key); + expect(keyManagerEvent!.isKeyDownEvent, false); + }, + ); + + testWidgets( + 'When the Home key is pressed, isHome must be `true`.', + (tester) async { + late PlutoKeyManagerEvent keyManagerEvent; + + KeyEventResult callback(FocusNode node, KeyEvent event) { + keyManagerEvent = PlutoKeyManagerEvent( + focusNode: node, + event: event, + ); + + return KeyEventResult.handled; + } + + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.home; + await tester.sendKeyDownEvent(key); + expect(keyManagerEvent.isHome, true); + await tester.sendKeyUpEvent(key); + }, + ); + + testWidgets( + 'When the End key is pressed, isEnd must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.end; + await tester.sendKeyDownEvent(key); + expect(keyManagerEvent!.isEnd, true); + await tester.sendKeyUpEvent(key); + }, + ); + + testWidgets( + 'When the F4 key is pressed, isF4 must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.f4; + await tester.sendKeyDownEvent(key); + expect(keyManagerEvent!.isF4, true); + await tester.sendKeyUpEvent(key); + }, + ); + + testWidgets( + 'When the Backspace key is pressed, isBackspace must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.backspace; + await tester.sendKeyDownEvent(key); + expect(keyManagerEvent!.isBackspace, true); + await tester.sendKeyUpEvent(key); + }, + ); + + testWidgets( + 'When the Shift key is pressed, isShift must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.shift; + await tester.sendKeyDownEvent(key); + expect(keyManagerEvent!.isShift, true); + await tester.sendKeyUpEvent(key); + }, + ); + + testWidgets( + 'When the LeftShift key is pressed, isLeftShift must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.shiftLeft; + await tester.sendKeyDownEvent(key); + expect(keyManagerEvent!.isLeftShift, true); + await tester.sendKeyUpEvent(key); + }, + ); + + testWidgets( + 'When the RightShift key is pressed, isRightShift must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.shiftRight; + await tester.sendKeyDownEvent(key); + expect(keyManagerEvent!.isRightShift, true); + await tester.sendKeyUpEvent(key); + }, + ); + + testWidgets( + 'When the Control key is pressed, isControl must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.control; + await tester.sendKeyDownEvent(key); + expect(keyManagerEvent!.isControl, true); + await tester.sendKeyUpEvent(key); + }, + ); + + testWidgets( + 'When the LeftControl key is pressed, isLeftControl must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.controlLeft; + await tester.sendKeyDownEvent(key); + expect(keyManagerEvent!.isLeftControl, true); + await tester.sendKeyUpEvent(key); + }, + ); + + testWidgets( + 'When the RightControl key is pressed, isRightControl must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.controlRight; + await tester.sendKeyDownEvent(key); + expect(keyManagerEvent!.isRightControl, true); + await tester.sendKeyUpEvent(key); + }, + ); + + testWidgets( + 'When Control + C keys are pressed, isCtrlC must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.control; + const key2 = LogicalKeyboardKey.keyC; + + await tester.sendKeyDownEvent(key); + await tester.sendKeyDownEvent(key2); + + expect(keyManagerEvent?.isCtrlC, true); + + await tester.sendKeyUpEvent(key); + await tester.sendKeyUpEvent(key2); + }, + ); + + testWidgets( + 'When Control + V keys are pressed, isCtrlV must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.control; + const key2 = LogicalKeyboardKey.keyV; + + await tester.sendKeyDownEvent(key); + await tester.sendKeyDownEvent(key2); + + expect(keyManagerEvent!.isCtrlV, true); + await tester.sendKeyUpEvent(key); + await tester.sendKeyUpEvent(key2); + }, + ); + + testWidgets( + 'When Control + A keys are pressed, isCtrlA must be `true`.', + (tester) async { + await buildWidget(tester: tester, callback: callback); + + const key = LogicalKeyboardKey.control; + const key2 = LogicalKeyboardKey.keyA; + + await tester.sendKeyDownEvent(key); + await tester.sendKeyDownEvent(key2); + + expect(keyManagerEvent!.isCtrlA, true); + + await tester.sendKeyUpEvent(key); + await tester.sendKeyUpEvent(key2); + }, + ); +} diff --git a/test/src/helper/pluto_row_group_delegate_test.dart b/test/src/helper/pluto_row_group_delegate_test.dart index 05196b9ba..a2aa7ce29 100644 --- a/test/src/helper/pluto_row_group_delegate_test.dart +++ b/test/src/helper/pluto_row_group_delegate_test.dart @@ -1,7 +1,7 @@ // ignore_for_file: non_constant_identifier_names import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; void main() { PlutoRow createRow( diff --git a/test/src/helper/pluto_row_group_helper_test.dart b/test/src/helper/pluto_row_group_helper_test.dart index 02b90a9cc..e9b49ba47 100644 --- a/test/src/helper/pluto_row_group_helper_test.dart +++ b/test/src/helper/pluto_row_group_helper_test.dart @@ -1,6 +1,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../mock/mock_methods.dart'; diff --git a/test/src/helper/pluto_size_helper_test.dart b/test/src/helper/pluto_size_helper_test.dart index b082f4da1..f20406266 100644 --- a/test/src/helper/pluto_size_helper_test.dart +++ b/test/src/helper/pluto_size_helper_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; class _ResizeItem { _ResizeItem({ diff --git a/test/src/manager/event/pluto_grid_cell_gesture_event_test.dart b/test/src/manager/event/pluto_grid_cell_gesture_event_test.dart index 2d78cb017..df908cb0d 100644 --- a/test/src/manager/event/pluto_grid_cell_gesture_event_test.dart +++ b/test/src/manager/event/pluto_grid_cell_gesture_event_test.dart @@ -1,6 +1,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../matcher/pluto_object_matcher.dart'; diff --git a/test/src/manager/event/pluto_grid_scroll_update_event_test.dart b/test/src/manager/event/pluto_grid_scroll_update_event_test.dart index 39612e186..fa0f692f8 100644 --- a/test/src/manager/event/pluto_grid_scroll_update_event_test.dart +++ b/test/src/manager/event/pluto_grid_scroll_update_event_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../mock/shared_mocks.mocks.dart'; diff --git a/test/src/manager/pluto_grid_key_manager_test.dart b/test/src/manager/pluto_grid_key_manager_test.dart index 57634f5e1..cfba6eea0 100644 --- a/test/src/manager/pluto_grid_key_manager_test.dart +++ b/test/src/manager/pluto_grid_key_manager_test.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/pluto_widget_test_helper.dart'; import '../../helper/row_helper.dart'; @@ -46,8 +46,8 @@ void main() { await tester.pumpWidget( MaterialApp( home: Material( - child: RawKeyboardListener( - onKey: (event) { + child: KeyboardListener( + onKeyEvent: (event) { keyManager.subject.add(PlutoKeyManagerEvent( focusNode: FocusNode(), event: event, @@ -98,8 +98,8 @@ void main() { await tester.pumpWidget( MaterialApp( home: Material( - child: RawKeyboardListener( - onKey: (event) { + child: KeyboardListener( + onKeyEvent: (event) { keyManager.subject.add(PlutoKeyManagerEvent( focusNode: FocusNode(), event: event, @@ -150,8 +150,8 @@ void main() { await tester.pumpWidget( MaterialApp( home: Material( - child: RawKeyboardListener( - onKey: (event) { + child: KeyboardListener( + onKeyEvent: (event) { keyManager.subject.add(PlutoKeyManagerEvent( focusNode: FocusNode(), event: event, @@ -204,8 +204,8 @@ void main() { await tester.pumpWidget( MaterialApp( home: Material( - child: RawKeyboardListener( - onKey: (event) { + child: KeyboardListener( + onKeyEvent: (event) { keyManager.subject.add(PlutoKeyManagerEvent( focusNode: FocusNode(), event: event, @@ -258,8 +258,8 @@ void main() { await tester.pumpWidget( MaterialApp( home: Material( - child: RawKeyboardListener( - onKey: (event) { + child: KeyboardListener( + onKeyEvent: (event) { keyManager.subject.add(PlutoKeyManagerEvent( focusNode: FocusNode(), event: event, @@ -311,8 +311,8 @@ void main() { await tester.pumpWidget( MaterialApp( home: Material( - child: RawKeyboardListener( - onKey: (event) { + child: KeyboardListener( + onKeyEvent: (event) { keyManager.subject.add(PlutoKeyManagerEvent( focusNode: FocusNode(), event: event, @@ -440,8 +440,8 @@ void main() { await tester.pumpWidget( MaterialApp( home: Material( - child: RawKeyboardListener( - onKey: (event) { + child: KeyboardListener( + onKeyEvent: (event) { keyManager.subject.add(PlutoKeyManagerEvent( focusNode: FocusNode(), event: event, diff --git a/test/src/manager/pluto_grid_state_manager_test.dart b/test/src/manager/pluto_grid_state_manager_test.dart index e5a882c19..c00153848 100644 --- a/test/src/manager/pluto_grid_state_manager_test.dart +++ b/test/src/manager/pluto_grid_state_manager_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/column_helper.dart'; import '../../helper/row_helper.dart'; diff --git a/test/src/manager/state/cell_state_test.dart b/test/src/manager/state/cell_state_test.dart index 686ecfca7..a07595339 100644 --- a/test/src/manager/state/cell_state_test.dart +++ b/test/src/manager/state/cell_state_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../helper/row_helper.dart'; diff --git a/test/src/manager/state/column_sizing_state_test.dart b/test/src/manager/state/column_sizing_state_test.dart index 01ba26e94..2902ac41b 100644 --- a/test/src/manager/state/column_sizing_state_test.dart +++ b/test/src/manager/state/column_sizing_state_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../mock/shared_mocks.mocks.dart'; diff --git a/test/src/manager/state/column_state_test.dart b/test/src/manager/state/column_state_test.dart index 3f077e2f1..f50dafca3 100644 --- a/test/src/manager/state/column_state_test.dart +++ b/test/src/manager/state/column_state_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../../helper/column_helper.dart'; import '../../../helper/row_helper.dart'; @@ -1714,9 +1714,10 @@ void main() { ), ); + double oldWidth = columns.first.width; stateManager.autoFitColumn(context, columns.first); - expect(columns.first.width, columns.first.minWidth); + expect(columns.first.width, lessThan(oldWidth)); }); testWidgets('가장 넓은 셀이 컬럼 최소 넓이보다 큰 경우 최소 넓이 이상으로 변경 되어야 한다.', diff --git a/test/src/manager/state/dragging_row_state_test.dart b/test/src/manager/state/dragging_row_state_test.dart index 3ef2317b1..be21a2508 100644 --- a/test/src/manager/state/dragging_row_state_test.dart +++ b/test/src/manager/state/dragging_row_state_test.dart @@ -1,7 +1,7 @@ import 'package:collection/collection.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../helper/row_helper.dart'; diff --git a/test/src/manager/state/editing_state_test.dart b/test/src/manager/state/editing_state_test.dart index 57f13cf60..c74f01c5d 100644 --- a/test/src/manager/state/editing_state_test.dart +++ b/test/src/manager/state/editing_state_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../helper/row_helper.dart'; diff --git a/test/src/manager/state/filtering_row_state_test.dart b/test/src/manager/state/filtering_row_state_test.dart index 8523cd231..657995620 100644 --- a/test/src/manager/state/filtering_row_state_test.dart +++ b/test/src/manager/state/filtering_row_state_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../helper/row_helper.dart'; diff --git a/test/src/manager/state/hovering_row_state_test.dart b/test/src/manager/state/hovering_row_state_test.dart new file mode 100644 index 000000000..da52c2540 --- /dev/null +++ b/test/src/manager/state/hovering_row_state_test.dart @@ -0,0 +1,117 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/mockito.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; + +import '../../../helper/column_helper.dart'; +import '../../../helper/row_helper.dart'; +import '../../../mock/mock_methods.dart'; +import '../../../mock/shared_mocks.mocks.dart'; + +void main() { + late List columns; + + late List rows; + + late PlutoGridStateManager stateManager; + + MockMethods? listener; + + setUp(() { + columns = [ + ...ColumnHelper.textColumn('column', count: 1, width: 150), + ]; + + rows = RowHelper.count(10, columns); + + stateManager = PlutoGridStateManager( + columns: columns, + rows: rows, + gridFocusNode: MockFocusNode(), + scroll: MockPlutoGridScrollController(), + ); + + listener = MockMethods(); + + stateManager.addListener(listener!.noParamReturnVoid); + }); + + group('setHoveredRowIdx', () { + test( + 'If the rowIdx passed as an argument is the same as' + 'hoveredRowIdx, then notifyListeners should not be called.', + () { + // given + stateManager.setHoveredRowIdx(1); + expect(stateManager.hoveredRowIdx, 1); + + // when + clearInteractions(listener); + stateManager.setHoveredRowIdx(1); + + // then + verifyNever(listener!.noParamReturnVoid()); + }, + ); + + test( + 'If the rowIdx passed as an argument is different from ' + 'hoveredRowIdx, notifyListeners should be called.', + () { + // given + stateManager.setHoveredRowIdx(1); + expect(stateManager.hoveredRowIdx, 1); + + // when + clearInteractions(listener); + stateManager.setHoveredRowIdx(2); + + // then + expect(stateManager.hoveredRowIdx, 2); + verify(listener!.noParamReturnVoid()).called(1); + }, + ); + + test( + 'If the rowIdx passed as an argument is different from ' + 'hoveredRowIdx, but notify is false,' + 'notifyListeners should not be called.', + () { + // given + stateManager.setHoveredRowIdx(1); + expect(stateManager.hoveredRowIdx, 1); + + // when + clearInteractions(listener); + stateManager.setHoveredRowIdx(2, notify: false); + + // then + expect(stateManager.hoveredRowIdx, 2); + verifyNever(listener!.noParamReturnVoid()); + }, + ); + }); + + group('isRowIdxHovered', () { + const int givenHoveredRowIdx = 3; + + setUp(() { + stateManager.setHoveredRowIdx(givenHoveredRowIdx); + }); + + test('should return true if rowIdx is equal to the given rowIdx.', () { + expect( + stateManager.isRowIdxHovered(givenHoveredRowIdx), + isTrue, + ); + }); + + test('should return false if hoveredRowIdx is null.', () { + stateManager.setHoveredRowIdx(null); + + expect( + stateManager.isRowIdxHovered(givenHoveredRowIdx), + isFalse, + ); + }); + }); +} diff --git a/test/src/manager/state/keyboard_state_test.dart b/test/src/manager/state/keyboard_state_test.dart index 71c9839f2..d6bc44ca4 100644 --- a/test/src/manager/state/keyboard_state_test.dart +++ b/test/src/manager/state/keyboard_state_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../helper/pluto_widget_test_helper.dart'; diff --git a/test/src/manager/state/layout_state_test.dart b/test/src/manager/state/layout_state_test.dart index fa883999f..8f27b3e26 100644 --- a/test/src/manager/state/layout_state_test.dart +++ b/test/src/manager/state/layout_state_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../helper/pluto_widget_test_helper.dart'; @@ -91,8 +91,8 @@ void main() { expect( stateManager.bodyLeftScrollOffset, stateManager.gridGlobalOffset!.dx + - PlutoGridSettings.gridPadding + - PlutoGridSettings.gridBorderWidth + + stateManager.configuration.style.gridPadding + + stateManager.configuration.style.gridBorderWidth + PlutoGridSettings.offsetScrollingFromEdge, ); }, @@ -140,8 +140,8 @@ void main() { expect( stateManager.bodyLeftScrollOffset, stateManager.gridGlobalOffset!.dx + - PlutoGridSettings.gridPadding + - PlutoGridSettings.gridBorderWidth + + stateManager.configuration.style.gridPadding + + stateManager.configuration.style.gridBorderWidth + PlutoGridSettings.offsetScrollingFromEdge, ); }, diff --git a/test/src/manager/state/row_group_state_test.dart b/test/src/manager/state/row_group_state_test.dart index 4d1fd54eb..ac78a0b26 100644 --- a/test/src/manager/state/row_group_state_test.dart +++ b/test/src/manager/state/row_group_state_test.dart @@ -2,7 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../mock/shared_mocks.mocks.dart'; diff --git a/test/src/manager/state/row_state_test.dart b/test/src/manager/state/row_state_test.dart index 2f2d7b11a..202564133 100644 --- a/test/src/manager/state/row_state_test.dart +++ b/test/src/manager/state/row_state_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../helper/pluto_widget_test_helper.dart'; diff --git a/test/src/manager/state/scroll_state_test.dart b/test/src/manager/state/scroll_state_test.dart index 585e601b8..3203edf77 100644 --- a/test/src/manager/state/scroll_state_test.dart +++ b/test/src/manager/state/scroll_state_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../helper/row_helper.dart'; diff --git a/test/src/manager/state/selecting_state_test.dart b/test/src/manager/state/selecting_state_test.dart index 814dc0a84..e378545f4 100644 --- a/test/src/manager/state/selecting_state_test.dart +++ b/test/src/manager/state/selecting_state_test.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../helper/row_helper.dart'; diff --git a/test/src/manager/state/visibility_state_test.dart b/test/src/manager/state/visibility_state_test.dart index 3bd8daed4..d1e3b4f7b 100644 --- a/test/src/manager/state/visibility_state_test.dart +++ b/test/src/manager/state/visibility_state_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../../helper/column_helper.dart'; import '../../../mock/shared_mocks.mocks.dart'; diff --git a/test/src/model/pluto_column_group_test.dart b/test/src/model/pluto_column_group_test.dart index d445501ec..fc1cb3fc5 100644 --- a/test/src/model/pluto_column_group_test.dart +++ b/test/src/model/pluto_column_group_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; void main() { test('fields 가 null 이면 children 이 null 인 경우 assert 에러가 발생 되어야 한다.', () { diff --git a/test/src/model/pluto_column_test.dart b/test/src/model/pluto_column_test.dart index bcb1ab773..2915044c1 100644 --- a/test/src/model/pluto_column_test.dart +++ b/test/src/model/pluto_column_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/row_helper.dart'; diff --git a/test/src/model/pluto_column_type_test.dart b/test/src/model/pluto_column_type_test.dart index ab2d2257a..21d2f81a9 100644 --- a/test/src/model/pluto_column_type_test.dart +++ b/test/src/model/pluto_column_type_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; void main() { group('text', () { diff --git a/test/src/model/pluto_row_test.dart b/test/src/model/pluto_row_test.dart index f193959ab..d5eb4424b 100644 --- a/test/src/model/pluto_row_test.dart +++ b/test/src/model/pluto_row_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../matcher/pluto_object_matcher.dart'; diff --git a/test/src/plugin/pluto_aggregate_column_footer_test.dart b/test/src/plugin/pluto_aggregate_column_footer_test.dart index ce45c7f39..88883d604 100644 --- a/test/src/plugin/pluto_aggregate_column_footer_test.dart +++ b/test/src/plugin/pluto_aggregate_column_footer_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'package:rxdart/rxdart.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/src/plugin/pluto_pagination_test.dart b/test/src/plugin/pluto_pagination_test.dart index 03af13cf8..93196c8b5 100644 --- a/test/src/plugin/pluto_pagination_test.dart +++ b/test/src/plugin/pluto_pagination_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import 'package:rxdart/rxdart.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/src/pluto_dual_grid_popup_test.dart b/test/src/pluto_dual_grid_popup_test.dart index 14cf2c9a7..078217dd4 100644 --- a/test/src/pluto_dual_grid_popup_test.dart +++ b/test/src/pluto_dual_grid_popup_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../helper/column_helper.dart'; import '../helper/row_helper.dart'; diff --git a/test/src/pluto_dual_grid_test.dart b/test/src/pluto_dual_grid_test.dart index 788239ed7..91acf775b 100644 --- a/test/src/pluto_dual_grid_test.dart +++ b/test/src/pluto_dual_grid_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../helper/column_helper.dart'; import '../helper/pluto_widget_test_helper.dart'; diff --git a/test/src/pluto_grid_configuration_test.dart b/test/src/pluto_grid_configuration_test.dart index 0f13e8d6e..9f3f2244d 100644 --- a/test/src/pluto_grid_configuration_test.dart +++ b/test/src/pluto_grid_configuration_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; void main() { testWidgets( diff --git a/test/src/pluto_grid_date_picker_test.dart b/test/src/pluto_grid_date_picker_test.dart index 540d8a704..8b7bb6d13 100644 --- a/test/src/pluto_grid_date_picker_test.dart +++ b/test/src/pluto_grid_date_picker_test.dart @@ -3,8 +3,8 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:intl/intl.dart' as intl; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../helper/pluto_widget_test_helper.dart'; import '../matcher/pluto_object_matcher.dart'; diff --git a/test/src/pluto_grid_popup_test.dart b/test/src/pluto_grid_popup_test.dart index 6ed495241..ed822cc18 100644 --- a/test/src/pluto_grid_popup_test.dart +++ b/test/src/pluto_grid_popup_test.dart @@ -3,8 +3,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../helper/column_helper.dart'; import '../helper/row_helper.dart'; @@ -31,6 +31,7 @@ void main() { PlutoOnRowDoubleTapEventCallback? onRowDoubleTap, PlutoOnRowSecondaryTapEventCallback? onRowSecondaryTap, PlutoOnRowsMovedEventCallback? onRowsMoved, + PlutoOnActiveCellChangedEventCallback? onActiveCellChanged, PlutoOnColumnsMovedEventCallback? onColumnsMoved, CreateHeaderCallBack? createHeader, CreateFooterCallBack? createFooter, @@ -69,6 +70,7 @@ void main() { onRowDoubleTap: onRowDoubleTap, onRowSecondaryTap: onRowSecondaryTap, onRowsMoved: onRowsMoved, + onActiveCellChanged: onActiveCellChanged, onColumnsMoved: onColumnsMoved, createHeader: createHeader, createFooter: createFooter, diff --git a/test/src/pluto_grid_test.dart b/test/src/pluto_grid_test.dart index 7d1e976b0..f7d1a62dc 100644 --- a/test/src/pluto_grid_test.dart +++ b/test/src/pluto_grid_test.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../helper/column_helper.dart'; import '../helper/row_helper.dart'; diff --git a/test/src/ui/cells/pluto_currency_cell_test.dart b/test/src/ui/cells/pluto_currency_cell_test.dart index 7b08494e3..950682ea8 100644 --- a/test/src/ui/cells/pluto_currency_cell_test.dart +++ b/test/src/ui/cells/pluto_currency_cell_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../../helper/row_helper.dart'; import '../../../mock/shared_mocks.mocks.dart'; diff --git a/test/src/ui/cells/pluto_date_cell_test.dart b/test/src/ui/cells/pluto_date_cell_test.dart index 79cee3ce5..ad86f57bf 100644 --- a/test/src/ui/cells/pluto_date_cell_test.dart +++ b/test/src/ui/cells/pluto_date_cell_test.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../../helper/pluto_widget_test_helper.dart'; import '../../../helper/row_helper.dart'; diff --git a/test/src/ui/cells/pluto_default_cell_test.dart b/test/src/ui/cells/pluto_default_cell_test.dart index 886a98a48..d86b21ca0 100644 --- a/test/src/ui/cells/pluto_default_cell_test.dart +++ b/test/src/ui/cells/pluto_default_cell_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import 'package:rxdart/rxdart.dart'; import '../../../helper/pluto_widget_test_helper.dart'; diff --git a/test/src/ui/cells/pluto_number_cell_test.dart b/test/src/ui/cells/pluto_number_cell_test.dart index c50aee5e2..e0ac69030 100644 --- a/test/src/ui/cells/pluto_number_cell_test.dart +++ b/test/src/ui/cells/pluto_number_cell_test.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:intl/intl.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../../helper/pluto_widget_test_helper.dart'; import '../../../mock/shared_mocks.mocks.dart'; diff --git a/test/src/ui/cells/pluto_select_cell_test.dart b/test/src/ui/cells/pluto_select_cell_test.dart index 37cef6bb9..e48e69e4b 100644 --- a/test/src/ui/cells/pluto_select_cell_test.dart +++ b/test/src/ui/cells/pluto_select_cell_test.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../../helper/pluto_widget_test_helper.dart'; import '../../../helper/row_helper.dart'; diff --git a/test/src/ui/cells/pluto_text_cell_test.dart b/test/src/ui/cells/pluto_text_cell_test.dart index 330a94e3e..cc13c8816 100644 --- a/test/src/ui/cells/pluto_text_cell_test.dart +++ b/test/src/ui/cells/pluto_text_cell_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../../mock/shared_mocks.mocks.dart'; diff --git a/test/src/ui/cells/pluto_time_cell_test.dart b/test/src/ui/cells/pluto_time_cell_test.dart index 38d625b04..e5f2058f1 100644 --- a/test/src/ui/cells/pluto_time_cell_test.dart +++ b/test/src/ui/cells/pluto_time_cell_test.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import '../../../helper/pluto_widget_test_helper.dart'; import '../../../helper/row_helper.dart'; diff --git a/test/src/ui/columns/pluto_column_filter_test.dart b/test/src/ui/columns/pluto_column_filter_test.dart index 587b45948..ab79383a9 100644 --- a/test/src/ui/columns/pluto_column_filter_test.dart +++ b/test/src/ui/columns/pluto_column_filter_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import 'package:rxdart/rxdart.dart'; import '../../../matcher/pluto_object_matcher.dart'; diff --git a/test/src/ui/columns/pluto_column_title_test.dart b/test/src/ui/columns/pluto_column_title_test.dart index 6cf9265a1..5da94af17 100644 --- a/test/src/ui/columns/pluto_column_title_test.dart +++ b/test/src/ui/columns/pluto_column_title_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import 'package:rxdart/rxdart.dart'; import '../../../helper/pluto_widget_test_helper.dart'; diff --git a/test/src/ui/miscellaneous/pluto_visibility_layout_test.dart b/test/src/ui/miscellaneous/pluto_visibility_layout_test.dart index cda05eef4..1978afbb4 100644 --- a/test/src/ui/miscellaneous/pluto_visibility_layout_test.dart +++ b/test/src/ui/miscellaneous/pluto_visibility_layout_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/src/ui/miscellaneous/pluto_visibility_layout.dart'; +import 'package:pluto_grid_plus/src/ui/miscellaneous/pluto_visibility_layout.dart'; import '../../../mock/shared_mocks.mocks.dart'; @@ -11,8 +11,7 @@ const double defaultChildWidth = 200; class _TestWidgetWrapper extends StatefulWidget { const _TestWidgetWrapper({ required this.child, - Key? key, - }) : super(key: key); + }); final Widget child; diff --git a/test/src/ui/pluto_base_cell_test.dart b/test/src/ui/pluto_base_cell_test.dart index 9a0217024..e6919ae33 100644 --- a/test/src/ui/pluto_base_cell_test.dart +++ b/test/src/ui/pluto_base_cell_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import 'package:rxdart/rxdart.dart'; import '../../helper/pluto_widget_test_helper.dart'; diff --git a/test/src/ui/pluto_base_column_footer_test.dart b/test/src/ui/pluto_base_column_footer_test.dart index 038e270d3..bd434015a 100644 --- a/test/src/ui/pluto_base_column_footer_test.dart +++ b/test/src/ui/pluto_base_column_footer_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/pluto_base_column_footer.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/pluto_base_column_footer.dart'; import '../../mock/shared_mocks.mocks.dart'; diff --git a/test/src/ui/pluto_base_column_group_test.dart b/test/src/ui/pluto_base_column_group_test.dart index fae712807..c99caefa8 100644 --- a/test/src/ui/pluto_base_column_group_test.dart +++ b/test/src/ui/pluto_base_column_group_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import 'package:rxdart/rxdart.dart'; import '../../helper/column_helper.dart'; diff --git a/test/src/ui/pluto_base_row_test.dart b/test/src/ui/pluto_base_row_test.dart index 342cb9d4e..f23b4fcd8 100644 --- a/test/src/ui/pluto_base_row_test.dart +++ b/test/src/ui/pluto_base_row_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; -import 'package:pluto_grid/pluto_grid.dart'; -import 'package:pluto_grid/src/ui/ui.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; +import 'package:pluto_grid_plus/src/ui/ui.dart'; import 'package:rxdart/rxdart.dart'; import '../../helper/column_helper.dart'; diff --git a/test/src/widgets/pluto_scaled_checkbox_test.dart b/test/src/widgets/pluto_scaled_checkbox_test.dart index 451caec27..fe23d7895 100644 --- a/test/src/widgets/pluto_scaled_checkbox_test.dart +++ b/test/src/widgets/pluto_scaled_checkbox_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; void main() { testWidgets( diff --git a/test/src/widgets/pluto_scrollbar_test.dart b/test/src/widgets/pluto_scrollbar_test.dart index 3343445f6..8b2282fb0 100644 --- a/test/src/widgets/pluto_scrollbar_test.dart +++ b/test/src/widgets/pluto_scrollbar_test.dart @@ -2,7 +2,7 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; import '../../helper/test_helper_util.dart'; diff --git a/test/src/widgets/pluto_shadow_container_test.dart b/test/src/widgets/pluto_shadow_container_test.dart index f9b7d9ba0..9474f2cd0 100644 --- a/test/src/widgets/pluto_shadow_container_test.dart +++ b/test/src/widgets/pluto_shadow_container_test.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pluto_grid/pluto_grid.dart'; +import 'package:pluto_grid_plus/pluto_grid_plus.dart'; void main() { testWidgets(