├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── example ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── ireshmw │ │ │ │ │ └── crud_table_example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── main.dart │ ├── user_task.dart │ ├── user_task.g.dart │ └── user_tasks_service.dart ├── pubspec.lock ├── pubspec.yaml ├── test │ └── widget_test.dart └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png │ ├── index.html │ └── manifest.json ├── img ├── crud_table_anim_1.gif ├── crud_table_anim_lazy_load.gif ├── crud_table_img.png ├── crud_table_img2.png ├── crud_table_ui_explain.jpg └── crud_table_uml_03.png ├── lib ├── crud_table.dart └── table │ ├── crud_action_listener.dart │ ├── crud_table.dart │ ├── crud_table_const.dart │ ├── crud_table_data_model.dart │ ├── crud_table_row_holder.dart │ ├── crud_table_util.dart │ ├── form_item.dart │ ├── form_row.dart │ └── form_section.dart ├── pubspec.lock ├── pubspec.yaml └── test └── crud_table_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/ephemeral 64 | **/ios/Flutter/app.flx 65 | **/ios/Flutter/app.zip 66 | **/ios/Flutter/flutter_assets/ 67 | **/ios/Flutter/flutter_export_environment.sh 68 | **/ios/ServiceDefinitions.json 69 | **/ios/Runner/GeneratedPluginRegistrant.* 70 | 71 | # Exceptions to above rules. 72 | !**/ios/**/default.mode1v3 73 | !**/ios/**/default.mode2v3 74 | !**/ios/**/default.pbxuser 75 | !**/ios/**/default.perspectivev3 76 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 18116933e77adc82f80866c928266a5b4f1ed645 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 - 2021/11/27 - First release 2 | 3 | ## 0.0.2 - 2021/11/27 - Update README 4 | 5 | ## 0.0.3 - 2021/11/27 - Code formatting done 6 | 7 | ## 0.0.4 - 2023/03/26 - Upgraded dependencies for Riverpod and Visibility Detector.Conducted codebase cleanup to ensure compatibility with new dependencies. 8 | 9 | ## 0.0.5 - 2023/03/26 - code formatting done 10 | 11 | ## 0.0.6 - 2023/03/26 - fixed lint errors, visibility_detector version update. 12 | 13 | ## 0.0.7 - 2023/10/08 - Dependency updates, topics and screenshots added to pubspec.yaml 14 | 15 | - fluid_kit: ^3.0.0 16 | - flutter_riverpod: ^2.4.3 17 | - split_view: ^3.2.1 18 | - flutter_lints: ^2.0.3 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2021 Iresh Madhuranga Wimaladasa 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CRUD Table Flutter 2 | 3 | CRUD Table Flutter is a powerful Flutter package that simplifies the creation of CRUD UI for your entity, object or class. This package features a highly efficient lazy loading function, resizable columns, and an integrated CRUD form to provide a seamless user experience. With CRUD Table Flutter, you can easily manage and organize your data, boosting your productivity and efficiency. 4 | 5 | ## Features 6 | - Lazy loading Table 7 | - Resizable columns 8 | - Integrated CRUD Form 9 | - Customizable UI 10 | 11 | |
CRUD UI |
Lazy loading | 12 | | :---: | :---: | 13 | 14 | ## Getting started 15 | 16 | The package uses Riverpod for state management. So Please ensure you import flutter_riverpod and wrap the app with ProviderScope. 17 | 18 | ```dart 19 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 20 | 21 | runApp( 22 | ProviderScope( 23 | child: MyApp(), 24 | ), 25 | ); 26 | ``` 27 | See the [example](https://github.com/ireshmw/crud_table/tree/main/example) project. 28 | 29 | ## Installing: 30 | In your pubspec.yaml 31 | ```yaml 32 | dependencies: 33 | crud_table: 34 | ``` 35 | ```dart 36 | import 'package:crud_table/crud_table.dart'; 37 | ``` 38 | 39 | ## Usage 40 | 41 | 42 | 43 | 44 | When using CrudTable, a CrudViewSource field must be passed and cannot be null. In the CrudViewSource, you will find a function field called emptyEntityFactory. This function requires an empty object that will be used with the CRUD UI.
45 | **Ex** :
46 |  Let's say you use` User.class` with this CrudTable, then the `emptyEntityFactory` will be
47 | ``` 48 | emptyEntityFactory: () => User(); 49 | ``` 50 | **Note :**
51 | _Give unique on every `FormItem` otherwise form data change will not work as we expect._ 52 | 53 | 54 | Check the [example](https://github.com/ireshmw/crud_table/tree/main/example) project. 55 | 56 | ## Additional information 57 | Inspired by [Vaadin Crud UI Add-on](https://vaadin.com/directory/component/crud-ui-add-on) 58 | 59 | ## License 60 | Licensed under the [Apache License, Version 2.0](LICENSE) 61 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 18116933e77adc82f80866c928266a5b4f1ed645 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # crud_table_example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 30 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.ireshmw.crud_table_example" 47 | minSdkVersion 16 48 | targetSdkVersion 30 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | dependencies { 67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 68 | } 69 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/ireshmw/crud_table_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.ireshmw.crud_table_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | INFOPLIST_FILE = Runner/Info.plist; 293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 294 | PRODUCT_BUNDLE_IDENTIFIER = com.ireshmw.crudTableExample; 295 | PRODUCT_NAME = "$(TARGET_NAME)"; 296 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 297 | SWIFT_VERSION = 5.0; 298 | VERSIONING_SYSTEM = "apple-generic"; 299 | }; 300 | name = Profile; 301 | }; 302 | 97C147031CF9000F007C117D /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_NONNULL = YES; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_MODULES = YES; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_COMMA = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INFINITE_RECURSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 326 | CLANG_WARN_STRICT_PROTOTYPES = YES; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = dwarf; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | ENABLE_TESTABILITY = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_DYNAMIC_NO_PIC = NO; 337 | GCC_NO_COMMON_BLOCKS = YES; 338 | GCC_OPTIMIZATION_LEVEL = 0; 339 | GCC_PREPROCESSOR_DEFINITIONS = ( 340 | "DEBUG=1", 341 | "$(inherited)", 342 | ); 343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 345 | GCC_WARN_UNDECLARED_SELECTOR = YES; 346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 347 | GCC_WARN_UNUSED_FUNCTION = YES; 348 | GCC_WARN_UNUSED_VARIABLE = YES; 349 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 350 | MTL_ENABLE_DEBUG_INFO = YES; 351 | ONLY_ACTIVE_ARCH = YES; 352 | SDKROOT = iphoneos; 353 | TARGETED_DEVICE_FAMILY = "1,2"; 354 | }; 355 | name = Debug; 356 | }; 357 | 97C147041CF9000F007C117D /* Release */ = { 358 | isa = XCBuildConfiguration; 359 | buildSettings = { 360 | ALWAYS_SEARCH_USER_PATHS = NO; 361 | CLANG_ANALYZER_NONNULL = YES; 362 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 363 | CLANG_CXX_LIBRARY = "libc++"; 364 | CLANG_ENABLE_MODULES = YES; 365 | CLANG_ENABLE_OBJC_ARC = YES; 366 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 367 | CLANG_WARN_BOOL_CONVERSION = YES; 368 | CLANG_WARN_COMMA = YES; 369 | CLANG_WARN_CONSTANT_CONVERSION = YES; 370 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INFINITE_RECURSION = YES; 375 | CLANG_WARN_INT_CONVERSION = YES; 376 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 377 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 378 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 379 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 380 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 381 | CLANG_WARN_STRICT_PROTOTYPES = YES; 382 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 383 | CLANG_WARN_UNREACHABLE_CODE = YES; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 386 | COPY_PHASE_STRIP = NO; 387 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 388 | ENABLE_NS_ASSERTIONS = NO; 389 | ENABLE_STRICT_OBJC_MSGSEND = YES; 390 | GCC_C_LANGUAGE_STANDARD = gnu99; 391 | GCC_NO_COMMON_BLOCKS = YES; 392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 393 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 394 | GCC_WARN_UNDECLARED_SELECTOR = YES; 395 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 396 | GCC_WARN_UNUSED_FUNCTION = YES; 397 | GCC_WARN_UNUSED_VARIABLE = YES; 398 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 399 | MTL_ENABLE_DEBUG_INFO = NO; 400 | SDKROOT = iphoneos; 401 | SUPPORTED_PLATFORMS = iphoneos; 402 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 403 | TARGETED_DEVICE_FAMILY = "1,2"; 404 | VALIDATE_PRODUCT = YES; 405 | }; 406 | name = Release; 407 | }; 408 | 97C147061CF9000F007C117D /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 411 | buildSettings = { 412 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 413 | CLANG_ENABLE_MODULES = YES; 414 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 415 | ENABLE_BITCODE = NO; 416 | INFOPLIST_FILE = Runner/Info.plist; 417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 418 | PRODUCT_BUNDLE_IDENTIFIER = com.ireshmw.crudTableExample; 419 | PRODUCT_NAME = "$(TARGET_NAME)"; 420 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 421 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 422 | SWIFT_VERSION = 5.0; 423 | VERSIONING_SYSTEM = "apple-generic"; 424 | }; 425 | name = Debug; 426 | }; 427 | 97C147071CF9000F007C117D /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 430 | buildSettings = { 431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 432 | CLANG_ENABLE_MODULES = YES; 433 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 434 | ENABLE_BITCODE = NO; 435 | INFOPLIST_FILE = Runner/Info.plist; 436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 437 | PRODUCT_BUNDLE_IDENTIFIER = com.ireshmw.crudTableExample; 438 | PRODUCT_NAME = "$(TARGET_NAME)"; 439 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 440 | SWIFT_VERSION = 5.0; 441 | VERSIONING_SYSTEM = "apple-generic"; 442 | }; 443 | name = Release; 444 | }; 445 | /* End XCBuildConfiguration section */ 446 | 447 | /* Begin XCConfigurationList section */ 448 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | 97C147031CF9000F007C117D /* Debug */, 452 | 97C147041CF9000F007C117D /* Release */, 453 | 249021D3217E4FDB00AE95B9 /* Profile */, 454 | ); 455 | defaultConfigurationIsVisible = 0; 456 | defaultConfigurationName = Release; 457 | }; 458 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 97C147061CF9000F007C117D /* Debug */, 462 | 97C147071CF9000F007C117D /* Release */, 463 | 249021D4217E4FDB00AE95B9 /* Profile */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | /* End XCConfigurationList section */ 469 | }; 470 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 471 | } 472 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | crud_table_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:crud_table/crud_table.dart'; 2 | import 'package:crud_table_example/user_task.dart'; 3 | import 'package:crud_table_example/user_tasks_service.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 6 | 7 | void main() { 8 | runApp( 9 | const ProviderScope( 10 | child: MyApp(), 11 | ), 12 | ); 13 | } 14 | 15 | class MyApp extends StatelessWidget { 16 | const MyApp({Key? key}) : super(key: key); 17 | 18 | // This widget is the root of your application. 19 | @override 20 | Widget build(BuildContext context) { 21 | return MaterialApp( 22 | title: 'Flutter Demo', 23 | theme: ThemeData( 24 | primarySwatch: Colors.blue, 25 | ), 26 | home: const MyHomePage(title: 'Flutter Demo Home Page'), 27 | ); 28 | } 29 | } 30 | 31 | class MyHomePage extends StatefulWidget { 32 | const MyHomePage({Key? key, required this.title}) : super(key: key); 33 | final String title; 34 | @override 35 | State createState() => _MyHomePageState(); 36 | } 37 | 38 | class _MyHomePageState extends State { 39 | @override 40 | Widget build(BuildContext context) { 41 | return Scaffold( 42 | appBar: AppBar( 43 | title: Text(widget.title), 44 | ), 45 | body: Column( 46 | mainAxisSize: MainAxisSize.min, 47 | children: [ 48 | Expanded( 49 | child: CrudTable( 50 | crudViewSource: createCrudSource(), 51 | onTap: (t) { 52 | t as UserTask; 53 | }, 54 | ), 55 | ), 56 | ], 57 | ), 58 | ); 59 | } 60 | 61 | CrudViewSource createCrudSource() { 62 | return CrudViewSource( 63 | columns: ["id", "code", "description", "active"], 64 | pageLimit: 20, 65 | rowHeight: 30, 66 | emptyEntityFactory: () => 67 | UserTask(), // here we provide the empty object, which we get back when click on the submit button of the form 68 | createRows: (data, index) { 69 | data as UserTask; 70 | List rows = []; 71 | rows.add( 72 | Text(data.id.toString(), style: const TextStyle(fontSize: 16))); 73 | rows.add(Text(data.taskCode.toString(), 74 | style: const TextStyle(fontSize: 16))); 75 | rows.add(Text(data.description.toString(), 76 | style: const TextStyle(fontSize: 16))); 77 | rows.add( 78 | Text(data.active.toString(), style: const TextStyle(fontSize: 16))); 79 | return rows; 80 | }, 81 | createForm: (data) { 82 | data as UserTask; 83 | 84 | List fields = []; 85 | 86 | FormSection section1 = FormSection( 87 | sectionTitle: "System Tasks", 88 | formRows: () { 89 | List r = []; 90 | FormRow r1 = FormRow(formItems: () { 91 | List items = []; 92 | items.add(FormItem( 93 | ratio: 1, 94 | item: TextFormField( 95 | key: CrudTableUtil.formFieldKey(data.id), 96 | initialValue: CrudTableUtil.formFieldInitValue(data.id), 97 | decoration: const InputDecoration( 98 | labelText: 'Id', 99 | border: OutlineInputBorder(), 100 | ), 101 | enabled: false, 102 | ), 103 | )); 104 | items.add(FormItem( 105 | ratio: 1, 106 | item: TextFormField( 107 | key: CrudTableUtil.formFieldKey(data.taskCode), 108 | initialValue: 109 | CrudTableUtil.formFieldInitValue(data.taskCode), 110 | onSaved: (v) { 111 | data.taskCode = v; 112 | }, 113 | validator: (value) { 114 | if (value!.isEmpty) { 115 | return 'Enter The Task Code!'; 116 | } 117 | return null; 118 | }, 119 | decoration: const InputDecoration( 120 | labelText: 'Code', 121 | border: OutlineInputBorder(), 122 | ), 123 | ), 124 | )); 125 | return items; 126 | }); 127 | r.add(r1); 128 | return r; 129 | }); 130 | 131 | FormSection section2 = FormSection( 132 | sectionTitle: "System Tasks Section 02", 133 | formRows: () { 134 | List r = []; 135 | FormRow r1 = FormRow(formItems: () { 136 | List items = []; 137 | 138 | items.add(FormItem( 139 | ratio: 1, 140 | item: TextFormField( 141 | key: CrudTableUtil.formFieldKey(data.description), 142 | initialValue: 143 | CrudTableUtil.formFieldInitValue(data.description), 144 | validator: (value) { 145 | if (value!.isEmpty) { 146 | return 'Enter a Description!'; 147 | } 148 | return null; 149 | }, 150 | onSaved: (v) { 151 | data.description = v; 152 | }, 153 | decoration: const InputDecoration( 154 | labelText: 'Description', 155 | border: OutlineInputBorder(), 156 | ), 157 | ), 158 | )); 159 | 160 | return items; 161 | }); 162 | FormRow r2 = FormRow(formItems: () { 163 | return [ 164 | (FormItem( 165 | ratio: 1, 166 | item: CheckboxListTile( 167 | title: const Text("Active"), 168 | controlAffinity: ListTileControlAffinity.leading, 169 | value: data.active ?? false, 170 | onChanged: (bool? value) { 171 | setState(() { 172 | data.active = value!; 173 | }); 174 | }, 175 | ), 176 | )) 177 | ]; 178 | }); 179 | 180 | r.add(r1); 181 | r.add(r2); 182 | return r; 183 | }); 184 | 185 | fields.add(section1); 186 | fields.add(section2); 187 | return fields; 188 | }, 189 | crudActionListener: CrudActionListener( 190 | add: (data) async { 191 | UserTasksService userS = UserTasksService.instance!; 192 | return userS.addTask(data); 193 | }, 194 | edit: (data) async { 195 | data as UserTask; 196 | UserTasksService userS = UserTasksService.instance!; 197 | return userS.updateTask(data, data.id!.toInt()); 198 | }, 199 | delete: (data) async { 200 | data as UserTask; 201 | UserTasksService userS = UserTasksService.instance!; 202 | return userS.deleteTask(data.id!.toInt()); 203 | }, 204 | ), 205 | onPageChange: (pagination) async { 206 | UserTasksService userS = UserTasksService.instance!; 207 | return userS.getTasks(pagination.pageNumber, pagination.limit); 208 | }, 209 | ); 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /example/lib/user_task.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | part 'user_task.g.dart'; 3 | 4 | @JsonSerializable(explicitToJson: true) 5 | class UserTask { 6 | int? id; 7 | bool? active; 8 | String? description; 9 | String? taskCode; 10 | 11 | UserTask({this.id, this.active, this.description, this.taskCode}); 12 | 13 | factory UserTask.fromJson(Map json) => 14 | _$UserAbleTaskFromJson(json); 15 | Map toJson() => _$UserAbleTaskToJson(this); 16 | 17 | @override 18 | String toString() { 19 | return '$taskCode'; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /example/lib/user_task.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'user_task.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | UserTask _$UserAbleTaskFromJson(Map json) => UserTask( 10 | id: json['id'] as int?, 11 | active: json['active'] as bool?, 12 | description: json['description'] as String?, 13 | taskCode: json['taskCode'] as String?, 14 | ); 15 | 16 | Map _$UserAbleTaskToJson(UserTask instance) => 17 | { 18 | 'id': instance.id, 19 | 'active': instance.active, 20 | 'description': instance.description, 21 | 'taskCode': instance.taskCode, 22 | }; 23 | -------------------------------------------------------------------------------- /example/lib/user_tasks_service.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:crud_table_example/user_task.dart'; 3 | 4 | class UserTasksService { 5 | static UserTasksService? _userAbleTasksService; 6 | List? taskData = []; 7 | 8 | UserTasksService._() { 9 | generateTestData(); 10 | } 11 | 12 | void generateTestData() { 13 | for (int i = 1; i < 100; i++) { 14 | taskData!.add(UserTask( 15 | id: i, 16 | taskCode: "$i - Task", 17 | description: "$i - Description", 18 | active: true)); 19 | } 20 | } 21 | 22 | static UserTasksService? get instance { 23 | _userAbleTasksService ??= UserTasksService._(); 24 | return _userAbleTasksService; 25 | } 26 | 27 | Future> getTasks(int offSet, int limit) async { 28 | return Future.value(taskData); 29 | } 30 | 31 | Future addTask(UserTask ableTask) async { 32 | int? count = taskData?.length; 33 | if(taskData!.isNotEmpty){ 34 | var lastItem = taskData!.last; 35 | count = lastItem.id! ; 36 | } 37 | ableTask.id = (count! + 1); 38 | taskData!.add(ableTask); 39 | return Future.value(ableTask); 40 | } 41 | 42 | Future updateTask(UserTask ableTask, int taskId) async { 43 | //Todo add your own Update logic 44 | return Future.value(ableTask); 45 | } 46 | 47 | Future deleteTask(int taskId) async { 48 | //Todo : add your own delete logic 49 | return Future.value(true); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | sha256: "65ad6db2f0ce5b50ce27cc2b23758216a741414e82e01b60237111c530c4934a" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "30.0.0" 12 | analyzer: 13 | dependency: transitive 14 | description: 15 | name: analyzer 16 | sha256: a4cd0fa9ca834bf263582910259546ec2725b9a8675ce51a171cd37f03fc5495 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.7.0" 20 | args: 21 | dependency: transitive 22 | description: 23 | name: args 24 | sha256: "0bd9a99b6eb96f07af141f0eb53eace8983e8e5aa5de59777aca31684680ef22" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "2.3.0" 28 | async: 29 | dependency: transitive 30 | description: 31 | name: async 32 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "2.11.0" 36 | boolean_selector: 37 | dependency: transitive 38 | description: 39 | name: boolean_selector 40 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "2.1.1" 44 | build: 45 | dependency: transitive 46 | description: 47 | name: build 48 | sha256: "79752d67750874fe7eb6d509a7514237b66eabdb8f6c44295d50083a19d1008e" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "2.1.1" 52 | build_config: 53 | dependency: transitive 54 | description: 55 | name: build_config 56 | sha256: ad77deb6e9c143a3f550fbb4c5c1e0c6aadabe24274898d06b9526c61b9cf4fb 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.0.0" 60 | build_daemon: 61 | dependency: transitive 62 | description: 63 | name: build_daemon 64 | sha256: "4e2dbfa914f99bca9c447ba5aaa572edf7335a71717944e4ab2e26ca079e7f79" 65 | url: "https://pub.dev" 66 | source: hosted 67 | version: "3.0.1" 68 | build_resolvers: 69 | dependency: transitive 70 | description: 71 | name: build_resolvers 72 | sha256: "1ceabd2823cf4b7e7bbaf11c4c9c9533b28978c9edcbdae316f6e54157d7e533" 73 | url: "https://pub.dev" 74 | source: hosted 75 | version: "2.0.5" 76 | build_runner: 77 | dependency: "direct dev" 78 | description: 79 | name: build_runner 80 | sha256: "44c8946c2868cb320ee173f9fd127dd2a4c7c71eba2c71e159fa37e53d1bfce9" 81 | url: "https://pub.dev" 82 | source: hosted 83 | version: "2.1.5" 84 | build_runner_core: 85 | dependency: transitive 86 | description: 87 | name: build_runner_core 88 | sha256: "0db1b64c84fa803603fa406f8721959036e898cc9575d6ce4a3067581b9276c0" 89 | url: "https://pub.dev" 90 | source: hosted 91 | version: "7.2.2" 92 | built_collection: 93 | dependency: transitive 94 | description: 95 | name: built_collection 96 | sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" 97 | url: "https://pub.dev" 98 | source: hosted 99 | version: "5.1.1" 100 | built_value: 101 | dependency: transitive 102 | description: 103 | name: built_value 104 | sha256: "0ef2d0947df2804424d9f23e5349d210350dd3c7d39ab53845ecabb2db996f64" 105 | url: "https://pub.dev" 106 | source: hosted 107 | version: "8.1.3" 108 | characters: 109 | dependency: transitive 110 | description: 111 | name: characters 112 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 113 | url: "https://pub.dev" 114 | source: hosted 115 | version: "1.3.0" 116 | charcode: 117 | dependency: transitive 118 | description: 119 | name: charcode 120 | sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 121 | url: "https://pub.dev" 122 | source: hosted 123 | version: "1.3.1" 124 | checked_yaml: 125 | dependency: transitive 126 | description: 127 | name: checked_yaml 128 | sha256: dd007e4fb8270916820a0d66e24f619266b60773cddd082c6439341645af2659 129 | url: "https://pub.dev" 130 | source: hosted 131 | version: "2.0.1" 132 | cli_util: 133 | dependency: transitive 134 | description: 135 | name: cli_util 136 | sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" 137 | url: "https://pub.dev" 138 | source: hosted 139 | version: "0.3.5" 140 | clock: 141 | dependency: transitive 142 | description: 143 | name: clock 144 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 145 | url: "https://pub.dev" 146 | source: hosted 147 | version: "1.1.1" 148 | code_builder: 149 | dependency: transitive 150 | description: 151 | name: code_builder 152 | sha256: bdb1ab29be158c4784d7f9b7b693745a0719c5899e31c01112782bb1cb871e80 153 | url: "https://pub.dev" 154 | source: hosted 155 | version: "4.1.0" 156 | collection: 157 | dependency: transitive 158 | description: 159 | name: collection 160 | sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 161 | url: "https://pub.dev" 162 | source: hosted 163 | version: "1.17.2" 164 | convert: 165 | dependency: transitive 166 | description: 167 | name: convert 168 | sha256: f08428ad63615f96a27e34221c65e1a451439b5f26030f78d790f461c686d65d 169 | url: "https://pub.dev" 170 | source: hosted 171 | version: "3.0.1" 172 | crud_table: 173 | dependency: "direct main" 174 | description: 175 | path: ".." 176 | relative: true 177 | source: path 178 | version: "0.0.7" 179 | crypto: 180 | dependency: transitive 181 | description: 182 | name: crypto 183 | sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c 184 | url: "https://pub.dev" 185 | source: hosted 186 | version: "3.0.1" 187 | cupertino_icons: 188 | dependency: "direct main" 189 | description: 190 | name: cupertino_icons 191 | sha256: "1989d917fbe8e6b39806207df5a3fdd3d816cbd090fac2ce26fb45e9a71476e5" 192 | url: "https://pub.dev" 193 | source: hosted 194 | version: "1.0.4" 195 | dart_style: 196 | dependency: transitive 197 | description: 198 | name: dart_style 199 | sha256: "2cac5b2dfcd79df1b57c117934d2d04e03f0420c0c6ea7bbf02836fcd34e131f" 200 | url: "https://pub.dev" 201 | source: hosted 202 | version: "2.2.0" 203 | fake_async: 204 | dependency: transitive 205 | description: 206 | name: fake_async 207 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 208 | url: "https://pub.dev" 209 | source: hosted 210 | version: "1.3.1" 211 | file: 212 | dependency: transitive 213 | description: 214 | name: file 215 | sha256: b69516f2c26a5bcac4eee2e32512e1a5205ab312b3536c1c1227b2b942b5f9ad 216 | url: "https://pub.dev" 217 | source: hosted 218 | version: "6.1.2" 219 | fixnum: 220 | dependency: transitive 221 | description: 222 | name: fixnum 223 | sha256: "6a2ef17156f4dc49684f9d99aaf4a93aba8ac49f5eac861755f5730ddf6e2e4e" 224 | url: "https://pub.dev" 225 | source: hosted 226 | version: "1.0.0" 227 | fluid_kit: 228 | dependency: transitive 229 | description: 230 | name: fluid_kit 231 | sha256: bb7d443356a7d8fa48bd0fe2073c5bd3a2f571782459856fe715ae8cdaf22d91 232 | url: "https://pub.dev" 233 | source: hosted 234 | version: "3.0.0" 235 | flutter: 236 | dependency: "direct main" 237 | description: flutter 238 | source: sdk 239 | version: "0.0.0" 240 | flutter_lints: 241 | dependency: "direct dev" 242 | description: 243 | name: flutter_lints 244 | sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 245 | url: "https://pub.dev" 246 | source: hosted 247 | version: "1.0.4" 248 | flutter_riverpod: 249 | dependency: transitive 250 | description: 251 | name: flutter_riverpod 252 | sha256: e667e406a74d67715f1fa0bd941d9ded49aff72f3a9f4440a36aece4e8d457a7 253 | url: "https://pub.dev" 254 | source: hosted 255 | version: "2.4.3" 256 | flutter_test: 257 | dependency: "direct dev" 258 | description: flutter 259 | source: sdk 260 | version: "0.0.0" 261 | frontend_server_client: 262 | dependency: transitive 263 | description: 264 | name: frontend_server_client 265 | sha256: "6d2930621b9377f6a4b7d260fce525d48dd77a334f0d5d4177d07b0dcb76c032" 266 | url: "https://pub.dev" 267 | source: hosted 268 | version: "2.1.2" 269 | glob: 270 | dependency: transitive 271 | description: 272 | name: glob 273 | sha256: "8321dd2c0ab0683a91a51307fa844c6db4aa8e3981219b78961672aaab434658" 274 | url: "https://pub.dev" 275 | source: hosted 276 | version: "2.0.2" 277 | graphs: 278 | dependency: transitive 279 | description: 280 | name: graphs 281 | sha256: ae0b3d956ff324c6f8671f08dcb2dbd71c99cdbf2aa3ca63a14190c47aa6679c 282 | url: "https://pub.dev" 283 | source: hosted 284 | version: "2.1.0" 285 | http_multi_server: 286 | dependency: transitive 287 | description: 288 | name: http_multi_server 289 | sha256: bfb651625e251a88804ad6d596af01ea903544757906addcb2dcdf088b5ea185 290 | url: "https://pub.dev" 291 | source: hosted 292 | version: "3.0.1" 293 | http_parser: 294 | dependency: transitive 295 | description: 296 | name: http_parser 297 | sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185 298 | url: "https://pub.dev" 299 | source: hosted 300 | version: "4.0.0" 301 | io: 302 | dependency: transitive 303 | description: 304 | name: io 305 | sha256: "0d4c73c3653ab85bf696d51a9657604c900a370549196a91f33e4c39af760852" 306 | url: "https://pub.dev" 307 | source: hosted 308 | version: "1.0.3" 309 | js: 310 | dependency: transitive 311 | description: 312 | name: js 313 | sha256: d9bdfd70d828eeb352390f81b18d6a354ef2044aa28ef25682079797fa7cd174 314 | url: "https://pub.dev" 315 | source: hosted 316 | version: "0.6.3" 317 | json_annotation: 318 | dependency: transitive 319 | description: 320 | name: json_annotation 321 | sha256: "0aa7409f6c82acfab96853b8b0c7503de49918cbe705a57cfdeb477756b4521b" 322 | url: "https://pub.dev" 323 | source: hosted 324 | version: "4.1.0" 325 | json_serializable: 326 | dependency: "direct main" 327 | description: 328 | name: json_serializable 329 | sha256: "4af8658055786907c7cecb7fc207b00995fb81201c59542ef6378fc92304cc1c" 330 | url: "https://pub.dev" 331 | source: hosted 332 | version: "5.0.2" 333 | lints: 334 | dependency: transitive 335 | description: 336 | name: lints 337 | sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c 338 | url: "https://pub.dev" 339 | source: hosted 340 | version: "1.0.1" 341 | logging: 342 | dependency: transitive 343 | description: 344 | name: logging 345 | sha256: "293ae2d49fd79d4c04944c3a26dfd313382d5f52e821ec57119230ae16031ad4" 346 | url: "https://pub.dev" 347 | source: hosted 348 | version: "1.0.2" 349 | matcher: 350 | dependency: transitive 351 | description: 352 | name: matcher 353 | sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" 354 | url: "https://pub.dev" 355 | source: hosted 356 | version: "0.12.16" 357 | material_color_utilities: 358 | dependency: transitive 359 | description: 360 | name: material_color_utilities 361 | sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" 362 | url: "https://pub.dev" 363 | source: hosted 364 | version: "0.5.0" 365 | meta: 366 | dependency: transitive 367 | description: 368 | name: meta 369 | sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" 370 | url: "https://pub.dev" 371 | source: hosted 372 | version: "1.9.1" 373 | mime: 374 | dependency: transitive 375 | description: 376 | name: mime 377 | sha256: fd5f81041e6a9fc9b9d7fa2cb8a01123f9f5d5d49136e06cb9dc7d33689529f4 378 | url: "https://pub.dev" 379 | source: hosted 380 | version: "1.0.1" 381 | package_config: 382 | dependency: transitive 383 | description: 384 | name: package_config 385 | sha256: a4d5ede5ca9c3d88a2fef1147a078570c861714c806485c596b109819135bc12 386 | url: "https://pub.dev" 387 | source: hosted 388 | version: "2.0.2" 389 | path: 390 | dependency: transitive 391 | description: 392 | name: path 393 | sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" 394 | url: "https://pub.dev" 395 | source: hosted 396 | version: "1.8.3" 397 | pool: 398 | dependency: transitive 399 | description: 400 | name: pool 401 | sha256: "05955e3de2683e1746222efd14b775df7131139e07695dc8e24650f6b4204504" 402 | url: "https://pub.dev" 403 | source: hosted 404 | version: "1.5.0" 405 | pub_semver: 406 | dependency: transitive 407 | description: 408 | name: pub_semver 409 | sha256: b5a5fcc6425ea43704852ba4453ba94b08c2226c63418a260240c3a054579014 410 | url: "https://pub.dev" 411 | source: hosted 412 | version: "2.1.0" 413 | pubspec_parse: 414 | dependency: transitive 415 | description: 416 | name: pubspec_parse 417 | sha256: "0e01f805457ef610ccaf8d18067596afc34107a27149778b06b2083edbc140c1" 418 | url: "https://pub.dev" 419 | source: hosted 420 | version: "1.1.0" 421 | riverpod: 422 | dependency: transitive 423 | description: 424 | name: riverpod 425 | sha256: "494bf2cfb4df30000273d3052bdb1cc1de738574c6b678f0beb146ea56f5e208" 426 | url: "https://pub.dev" 427 | source: hosted 428 | version: "2.4.3" 429 | shelf: 430 | dependency: transitive 431 | description: 432 | name: shelf 433 | sha256: c240984c924796e055e831a0a36db23be8cb04f170b26df572931ab36418421d 434 | url: "https://pub.dev" 435 | source: hosted 436 | version: "1.2.0" 437 | shelf_web_socket: 438 | dependency: transitive 439 | description: 440 | name: shelf_web_socket 441 | sha256: fd84910bf7d58db109082edf7326b75322b8f186162028482f53dc892f00332d 442 | url: "https://pub.dev" 443 | source: hosted 444 | version: "1.0.1" 445 | sky_engine: 446 | dependency: transitive 447 | description: flutter 448 | source: sdk 449 | version: "0.0.99" 450 | source_gen: 451 | dependency: transitive 452 | description: 453 | name: source_gen 454 | sha256: "0789859e3153ff27166759475653f63d0e2634d687af3eb9be3af4373734452d" 455 | url: "https://pub.dev" 456 | source: hosted 457 | version: "1.1.1" 458 | source_helper: 459 | dependency: transitive 460 | description: 461 | name: source_helper 462 | sha256: efa3f47458a2da7530a8684bda168f0d5407a6d5337999e5f8284ebe680fe056 463 | url: "https://pub.dev" 464 | source: hosted 465 | version: "1.3.0" 466 | source_span: 467 | dependency: transitive 468 | description: 469 | name: source_span 470 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 471 | url: "https://pub.dev" 472 | source: hosted 473 | version: "1.10.0" 474 | split_view: 475 | dependency: transitive 476 | description: 477 | name: split_view 478 | sha256: "7ad0e1c40703901aa1175fd465dec5e965b55324f9cc8e51526479a4a96d01a4" 479 | url: "https://pub.dev" 480 | source: hosted 481 | version: "3.2.1" 482 | stack_trace: 483 | dependency: transitive 484 | description: 485 | name: stack_trace 486 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 487 | url: "https://pub.dev" 488 | source: hosted 489 | version: "1.11.0" 490 | state_notifier: 491 | dependency: transitive 492 | description: 493 | name: state_notifier 494 | sha256: "8fe42610f179b843b12371e40db58c9444f8757f8b69d181c97e50787caed289" 495 | url: "https://pub.dev" 496 | source: hosted 497 | version: "0.7.2+1" 498 | stream_channel: 499 | dependency: transitive 500 | description: 501 | name: stream_channel 502 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 503 | url: "https://pub.dev" 504 | source: hosted 505 | version: "2.1.1" 506 | stream_transform: 507 | dependency: transitive 508 | description: 509 | name: stream_transform 510 | sha256: ed464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e 511 | url: "https://pub.dev" 512 | source: hosted 513 | version: "2.0.0" 514 | string_scanner: 515 | dependency: transitive 516 | description: 517 | name: string_scanner 518 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 519 | url: "https://pub.dev" 520 | source: hosted 521 | version: "1.2.0" 522 | term_glyph: 523 | dependency: transitive 524 | description: 525 | name: term_glyph 526 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 527 | url: "https://pub.dev" 528 | source: hosted 529 | version: "1.2.1" 530 | test_api: 531 | dependency: transitive 532 | description: 533 | name: test_api 534 | sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" 535 | url: "https://pub.dev" 536 | source: hosted 537 | version: "0.6.0" 538 | timing: 539 | dependency: transitive 540 | description: 541 | name: timing 542 | sha256: c386d07d7f5efc613479a7c4d9d64b03710b03cfaa7e8ad5f2bfb295a1f0dfad 543 | url: "https://pub.dev" 544 | source: hosted 545 | version: "1.0.0" 546 | typed_data: 547 | dependency: transitive 548 | description: 549 | name: typed_data 550 | sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" 551 | url: "https://pub.dev" 552 | source: hosted 553 | version: "1.3.0" 554 | vector_math: 555 | dependency: transitive 556 | description: 557 | name: vector_math 558 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 559 | url: "https://pub.dev" 560 | source: hosted 561 | version: "2.1.4" 562 | visibility_detector: 563 | dependency: transitive 564 | description: 565 | name: visibility_detector 566 | sha256: dd5cc11e13494f432d15939c3aa8ae76844c42b723398643ce9addb88a5ed420 567 | url: "https://pub.dev" 568 | source: hosted 569 | version: "0.4.0+2" 570 | watcher: 571 | dependency: transitive 572 | description: 573 | name: watcher 574 | sha256: e42dfcc48f67618344da967b10f62de57e04bae01d9d3af4c2596f3712a88c99 575 | url: "https://pub.dev" 576 | source: hosted 577 | version: "1.0.1" 578 | web: 579 | dependency: transitive 580 | description: 581 | name: web 582 | sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 583 | url: "https://pub.dev" 584 | source: hosted 585 | version: "0.1.4-beta" 586 | web_socket_channel: 587 | dependency: transitive 588 | description: 589 | name: web_socket_channel 590 | sha256: "0c2ada1b1aeb2ad031ca81872add6be049b8cb479262c6ad3c4b0f9c24eaab2f" 591 | url: "https://pub.dev" 592 | source: hosted 593 | version: "2.1.0" 594 | yaml: 595 | dependency: transitive 596 | description: 597 | name: yaml 598 | sha256: "3cee79b1715110341012d27756d9bae38e650588acd38d3f3c610822e1337ace" 599 | url: "https://pub.dev" 600 | source: hosted 601 | version: "3.1.0" 602 | sdks: 603 | dart: ">=3.1.0-185.0.dev <4.0.0" 604 | flutter: ">=3.10.0" 605 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: crud_table_example 2 | description: A new Flutter project. 3 | 4 | publish_to: "none" # Remove this line if you wish to publish to pub.dev 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=3.0.0 <4.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | cupertino_icons: ^1.0.2 16 | json_serializable: ^5.0.2 17 | crud_table: 18 | path: ../ 19 | 20 | dev_dependencies: 21 | flutter_test: 22 | sdk: flutter 23 | flutter_lints: ^1.0.0 24 | build_runner: ^2.1.4 25 | 26 | flutter: 27 | uses-material-design: true 28 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:crud_table_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | crud_table_example 30 | 31 | 32 | 33 | 36 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "crud_table_example", 3 | "short_name": "crud_table_example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /img/crud_table_anim_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/img/crud_table_anim_1.gif -------------------------------------------------------------------------------- /img/crud_table_anim_lazy_load.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/img/crud_table_anim_lazy_load.gif -------------------------------------------------------------------------------- /img/crud_table_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/img/crud_table_img.png -------------------------------------------------------------------------------- /img/crud_table_img2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/img/crud_table_img2.png -------------------------------------------------------------------------------- /img/crud_table_ui_explain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/img/crud_table_ui_explain.jpg -------------------------------------------------------------------------------- /img/crud_table_uml_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ireshmw/crud_table/c5118193b9f1b9d5497648fb2bb43e5de0fde94f/img/crud_table_uml_03.png -------------------------------------------------------------------------------- /lib/crud_table.dart: -------------------------------------------------------------------------------- 1 | library crud_table; 2 | 3 | export 'table/crud_table_const.dart'; 4 | export 'table/crud_action_listener.dart'; 5 | export 'table/form_item.dart'; 6 | export 'table/form_row.dart'; 7 | export 'table/form_section.dart'; 8 | export 'table/crud_table.dart'; 9 | export 'table/crud_table_data_model.dart'; 10 | export 'table/crud_table_row_holder.dart'; 11 | export 'table/crud_table_util.dart'; 12 | -------------------------------------------------------------------------------- /lib/table/crud_action_listener.dart: -------------------------------------------------------------------------------- 1 | /// CRUD Table from action listener 2 | class CrudActionListener { 3 | /// notify when click add new item button 4 | Future Function(dynamic data)? add; 5 | 6 | /// notify when click edit button 7 | Future? Function(dynamic data)? edit; 8 | 9 | /// notify when click delete button 10 | Future Function(dynamic data)? delete; 11 | 12 | /// notify when click refresh button 13 | List Function()? refresh; 14 | 15 | CrudActionListener({this.add, this.edit, this.delete, this.refresh}); 16 | } 17 | -------------------------------------------------------------------------------- /lib/table/crud_table.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:crud_table/crud_table.dart'; 4 | import 'package:fluid_kit/fluid_kit.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 7 | import 'package:split_view/split_view.dart'; 8 | import 'package:visibility_detector/visibility_detector.dart'; 9 | 10 | /// CRUD Table class 11 | /// user have to provide CrudViewSource which have all the configurations and listeners 12 | 13 | class CrudTableColumnSizeChangeNotifier extends ChangeNotifier { 14 | CrudTableColumnSizeChangeNotifier(); 15 | 16 | void notify() { 17 | notifyListeners(); 18 | } 19 | } 20 | 21 | class CrudTablePageNumberChangingNotifier extends StateNotifier { 22 | CrudTablePageNumberChangingNotifier() : super(0); 23 | 24 | void setPage(int page) { 25 | state = page; 26 | } 27 | } 28 | 29 | class CrudTableTableDataNotifier 30 | extends StateNotifier> { 31 | CrudTableTableDataNotifier(CrudTableDataModel state) : super(state); 32 | 33 | void setData(CrudTableDataModel data) { 34 | state = data; 35 | } 36 | } 37 | 38 | class CrudTableCrudActionChangingNotifier extends ChangeNotifier { 39 | CrudAction crudAction; 40 | 41 | CrudTableCrudActionChangingNotifier(this.crudAction); 42 | 43 | void changeAction(CrudAction action) { 44 | crudAction = action; 45 | notifyListeners(); 46 | } 47 | } 48 | 49 | enum CrudAction { init, refresh, add, edit, delete } 50 | 51 | class Pagination { 52 | int pageNumber; 53 | int limit; 54 | 55 | Pagination({required this.pageNumber, required this.limit}); 56 | 57 | @override 58 | String toString() { 59 | return 'Pagination{pageNumber: $pageNumber, limit: $limit}'; 60 | } 61 | } 62 | 63 | class CrudTable extends ConsumerStatefulWidget { 64 | /// notify when user click on a row of the table 65 | final ValueChanged onTap; 66 | final CrudViewSource crudViewSource; 67 | 68 | final AutoDisposeChangeNotifierProvider 69 | crudActionChangeProvider = ChangeNotifierProvider.autoDispose( 70 | (ref) => CrudTableCrudActionChangingNotifier(CrudAction.init)); 71 | 72 | final AutoDisposeStateNotifierProvider pageNumberChangeProvider = 74 | StateNotifierProvider.autoDispose((ref) => CrudTablePageNumberChangingNotifier()); 76 | 77 | final AutoDisposeChangeNotifierProvider 78 | tableBodyRebuildNotifierProvider = 79 | ChangeNotifierProvider.autoDispose( 80 | (ref) => CrudTableColumnSizeChangeNotifier()); 81 | 82 | final AutoDisposeStateNotifierProvider tableDataProvider = StateNotifierProvider.autoDispose< 84 | CrudTableTableDataNotifier, CrudTableDataModel>( 85 | (ref) => CrudTableTableDataNotifier(CrudTableDataModel(isLoading: true))); 86 | 87 | CrudTable({Key? key, required this.crudViewSource, required this.onTap}) 88 | : super(key: key); 89 | 90 | @override 91 | ConsumerState createState() { 92 | return _CrudTableState(); 93 | } 94 | } 95 | 96 | class _CrudTableState extends ConsumerState { 97 | late AutoDisposeChangeNotifierProvider 98 | crudActionChangeProvider; 99 | late AutoDisposeStateNotifierProvider pageNumberChangeProvider; 101 | late AutoDisposeChangeNotifierProvider 102 | tableBodyRebuildNotifierProvider; 103 | late AutoDisposeStateNotifierProvider tableDataProvider; 105 | 106 | late int currentPageKey; 107 | late bool _hasMore; 108 | late int _pageNumber; 109 | late int pageLimit; 110 | late bool _error; 111 | late bool _loading; 112 | 113 | late List _tableBodyData; 114 | final int _nextPageThreshold = 5; 115 | 116 | late List headerKeys; 117 | late List headerColumnSizes; 118 | late double headerColumnFullSize; 119 | late List columnHeaderWidgets; 120 | 121 | final _formKey = GlobalKey(); 122 | T? workingDataObj; 123 | late int? clickPos; 124 | bool refreshDueToListItemClick = false; 125 | bool refreshFormDueToMainSplitViewChange = false; 126 | bool canShowLastPageRefreshButton = false; 127 | 128 | List sections = []; 129 | 130 | List formWidgets = []; 131 | 132 | @override 133 | Widget build(BuildContext context) { 134 | ref.listen(tableDataProvider, (previousData, data) { 135 | WidgetsBinding.instance.addPostFrameCallback((timeStamp) async { 136 | data as CrudTableDataModel; 137 | canShowLastPageRefreshButton = false; 138 | if (data.isError != null && data.isError == true) { 139 | _loading = false; 140 | _error = true; 141 | ref.read(tableBodyRebuildNotifierProvider).notify(); 142 | } else if (data.isLoading != null && data.isLoading == true) { 143 | _loading = true; 144 | _error = false; 145 | ref.read(tableBodyRebuildNotifierProvider).notify(); 146 | } else if (data.data != null) { 147 | List dataLs = data.data as List; 148 | if (dataLs.isNotEmpty) { 149 | _hasMore = dataLs.length == widget.crudViewSource.pageLimit; 150 | _loading = false; 151 | _pageNumber = _pageNumber + 1; 152 | _tableBodyData.addAll(dataLs); 153 | ref.read(tableBodyRebuildNotifierProvider).notify(); 154 | } else { 155 | //TODO show end refresh button. 156 | canShowLastPageRefreshButton = true; 157 | _hasMore = false; 158 | _loading = false; 159 | ref.read(tableBodyRebuildNotifierProvider).notify(); 160 | } 161 | } 162 | }); 163 | }); 164 | 165 | return Padding( 166 | padding: const EdgeInsets.all(16.0), 167 | child: SplitView( 168 | onWeightChanged: (value) { 169 | refreshFormDueToMainSplitViewChange = true; 170 | setState(() {}); 171 | }, 172 | indicator: const SplitIndicator(viewMode: SplitViewMode.Horizontal), 173 | gripColor: Colors.grey.shade200, 174 | gripSize: 4, 175 | gripColorActive: Colors.grey.shade500, 176 | viewMode: SplitViewMode.Horizontal, 177 | children: [ 178 | Column( 179 | mainAxisSize: MainAxisSize.min, 180 | children: [ 181 | SizedBox( 182 | height: 30, 183 | child: LayoutBuilder(builder: (context, constraints) { 184 | headerColumnFullSize = constraints.maxWidth; 185 | return SplitView( 186 | onWeightChanged: (value) { 187 | headerColumnSizes.clear(); 188 | var it = value.iterator; 189 | while (it.moveNext()) { 190 | headerColumnSizes.add(it.current ?? 0.0); 191 | } 192 | ref.read(tableBodyRebuildNotifierProvider).notify(); 193 | }, 194 | indicator: const SplitIndicator( 195 | viewMode: SplitViewMode.Horizontal), 196 | gripColor: Colors.grey.shade200, 197 | gripSize: 4, 198 | gripColorActive: Colors.grey.shade500, 199 | viewMode: SplitViewMode.Horizontal, 200 | children: columnHeaderWidgets.isNotEmpty 201 | ? columnHeaderWidgets 202 | : crateHeaders(headerColumnFullSize), 203 | ); 204 | }), 205 | ), 206 | const Divider( 207 | height: 0, 208 | ), 209 | Consumer( 210 | builder: (context, ref, child) { 211 | ref.watch(tableBodyRebuildNotifierProvider); 212 | return Expanded(child: createTableBody(ref)); 213 | }, 214 | ), 215 | ], 216 | ), // Table Section 217 | SingleChildScrollView( 218 | child: Column( 219 | mainAxisSize: MainAxisSize.min, 220 | children: [ 221 | Align( 222 | alignment: Alignment.centerLeft, 223 | child: SingleChildScrollView( 224 | scrollDirection: Axis.horizontal, 225 | child: Padding( 226 | padding: const EdgeInsets.only(left: 16), 227 | child: Row( 228 | children: [ 229 | IconButton( 230 | icon: const Icon(Icons.refresh), 231 | splashRadius: 16, 232 | tooltip: "Refresh", 233 | // color: Colors.white, 234 | onPressed: () { 235 | setTableInitSettings(); 236 | notifyPageChange(0); 237 | }, 238 | ), 239 | IconButton( 240 | icon: const Icon(Icons.add), 241 | splashRadius: 16, 242 | tooltip: "Add New", 243 | // color: Colors.white, 244 | onPressed: () { 245 | refreshDueToListItemClick = true; 246 | clickPos = null; 247 | ref 248 | .read(tableBodyRebuildNotifierProvider) 249 | .notify(); 250 | workingDataObj = 251 | widget.crudViewSource.getEmptyEntity(); 252 | ref 253 | .read(crudActionChangeProvider.notifier) 254 | .changeAction(CrudAction.add); 255 | }, 256 | ), 257 | IconButton( 258 | splashRadius: 16, 259 | icon: const Icon(Icons.delete), 260 | tooltip: "Delete", 261 | // color: Colors.white, 262 | onPressed: () { 263 | ref 264 | .read(crudActionChangeProvider.notifier) 265 | .changeAction(CrudAction.delete); 266 | }, 267 | ), 268 | ], 269 | ), 270 | ), 271 | ), 272 | ), // form action buttons container 273 | 274 | Padding( 275 | padding: const EdgeInsets.all(16.0), 276 | child: Consumer( 277 | builder: (context, ref, child) { 278 | final v = 279 | ref.watch(crudActionChangeProvider).crudAction; 280 | return Form( 281 | key: _formKey, 282 | autovalidateMode: 283 | AutovalidateMode.onUserInteraction, 284 | child: v == CrudAction.init 285 | ? Container() 286 | : Column( 287 | children: [ 288 | Column( 289 | children: 290 | widget.crudViewSource.createForm != 291 | null 292 | ? createFormItems( 293 | widget.crudViewSource, 294 | workingDataObj as T) 295 | : [], 296 | ), 297 | Align( 298 | alignment: Alignment.centerRight, 299 | child: SingleChildScrollView( 300 | scrollDirection: Axis.horizontal, 301 | child: Padding( 302 | padding: const EdgeInsets.only( 303 | right: 16.0, top: 32), 304 | child: Row( 305 | mainAxisAlignment: 306 | MainAxisAlignment.end, 307 | children: [ 308 | OutlinedButton( 309 | onPressed: () { 310 | workingDataObj = widget 311 | .crudViewSource 312 | .getEmptyEntity(); 313 | ref 314 | .read( 315 | crudActionChangeProvider 316 | .notifier) 317 | .changeAction( 318 | CrudAction.init); 319 | }, 320 | child: const Text("Cancel"), 321 | ), 322 | const SizedBox( 323 | width: 16, 324 | ), 325 | ElevatedButton.icon( 326 | icon: v == CrudAction.delete 327 | ? const Icon(Icons.delete, 328 | size: 18) 329 | : const Icon( 330 | Icons.check_outlined, 331 | size: 18), 332 | style: 333 | ElevatedButton.styleFrom( 334 | backgroundColor: v == 335 | CrudAction 336 | .delete 337 | ? Colors.red 338 | : null), 339 | onPressed: () { 340 | if (_formKey.currentState! 341 | .validate()) { 342 | _formKey.currentState! 343 | .save(); 344 | 345 | if (widget.crudViewSource 346 | .crudActionListener != 347 | null) { 348 | switch (v) { 349 | case CrudAction.add: 350 | { 351 | if (widget 352 | .crudViewSource 353 | .crudActionListener! 354 | .add != 355 | null) { 356 | Future< 357 | T> d = widget 358 | .crudViewSource 359 | .crudActionListener! 360 | .add!(workingDataObj) 361 | as Future< 362 | T>; 363 | d.then((value) { 364 | bool 365 | needToRefresh = 366 | false; 367 | if (_tableBodyData 368 | .isNotEmpty) { 369 | if (!_hasMore) { 370 | if (_tableBodyData 371 | .length > 372 | widget 373 | .crudViewSource 374 | .pageLimit) { 375 | var needToRemoveCount = 376 | _tableBodyData.length % 377 | widget.crudViewSource.pageLimit; 378 | int start = 379 | (_tableBodyData.length - needToRemoveCount) - 380 | 1; 381 | int end = 382 | _tableBodyData.length - 383 | 1; 384 | _tableBodyData.removeRange( 385 | start, 386 | end); 387 | _pageNumber = 388 | _pageNumber - 389 | 1; 390 | } else { 391 | _pageNumber = 392 | 0; 393 | _tableBodyData 394 | .clear(); 395 | } 396 | needToRefresh = 397 | true; 398 | } 399 | } else { 400 | _pageNumber = 401 | 0; 402 | needToRefresh = 403 | true; 404 | } 405 | 406 | if (needToRefresh) { 407 | notifyPageChange( 408 | _pageNumber); 409 | ref 410 | .read(crudActionChangeProvider 411 | .notifier) 412 | .changeAction( 413 | CrudAction.init); 414 | } 415 | }, onError: 416 | (e) { 417 | ScaffoldMessenger.of( 418 | context) 419 | .showSnackBar(SnackBar( 420 | content: 421 | Text('Adding fails! ${e.toString()}'))); 422 | }); 423 | } 424 | } 425 | break; 426 | case CrudAction.edit: 427 | { 428 | if (widget 429 | .crudViewSource 430 | .crudActionListener! 431 | .edit != 432 | null) { 433 | Future? d = widget 434 | .crudViewSource 435 | .crudActionListener! 436 | .edit!(workingDataObj); 437 | assert( 438 | d != null, 439 | 'Edit method not returns null'); 440 | d!.then( 441 | (value) { 442 | _tableBodyData[ 443 | clickPos!] = 444 | workingDataObj 445 | as T; 446 | ref 447 | .read( 448 | tableBodyRebuildNotifierProvider) 449 | .notify(); 450 | ScaffoldMessenger.of( 451 | context) 452 | .showSnackBar(const SnackBar( 453 | content: 454 | Text('Edit success!'))); 455 | }, 456 | onError: (e) { 457 | ScaffoldMessenger.of( 458 | context) 459 | .showSnackBar(SnackBar( 460 | content: 461 | Text('Edit fails! ${e.toString()}'))); 462 | }, 463 | ); 464 | } 465 | } 466 | break; 467 | case CrudAction 468 | .delete: 469 | { 470 | if (widget 471 | .crudViewSource 472 | .crudActionListener! 473 | .delete != 474 | null) { 475 | Future? d = widget 476 | .crudViewSource 477 | .crudActionListener! 478 | .delete!(workingDataObj); 479 | d.then( 480 | (value) { 481 | _tableBodyData.removeAt( 482 | clickPos 483 | as int); 484 | ref 485 | .read(crudActionChangeProvider 486 | .notifier) 487 | .changeAction( 488 | CrudAction.init); 489 | ref 490 | .read( 491 | tableBodyRebuildNotifierProvider) 492 | .notify(); 493 | ScaffoldMessenger.of( 494 | context) 495 | .showSnackBar(const SnackBar( 496 | content: 497 | Text('Delete success!'))); 498 | }, 499 | onError: (e) { 500 | ScaffoldMessenger.of( 501 | context) 502 | .showSnackBar(SnackBar( 503 | content: 504 | Text('Delete fails! ${e.toString()}'))); 505 | }, 506 | ); 507 | } 508 | } 509 | break; 510 | case CrudAction.init: 511 | // TODO: Handle this case. 512 | break; 513 | case CrudAction 514 | .refresh: 515 | // TODO: Handle this case. 516 | break; 517 | } 518 | } 519 | //ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Processing Data'))); 520 | } 521 | }, 522 | label: 523 | Text(getActionBtnText(v)), 524 | ), 525 | ], 526 | ), 527 | ), 528 | ), 529 | ) 530 | ], 531 | )); 532 | }, 533 | ), 534 | ) 535 | ], 536 | ), 537 | ), // Form section 538 | ], 539 | )); 540 | } 541 | 542 | List crateHeaders(double headerColumnFullSize) { 543 | bool initValEmpty = false; 544 | late double initRatio; 545 | if (headerColumnSizes.isEmpty) { 546 | initValEmpty = true; 547 | initRatio = 1 / widget.crudViewSource.columns.length; 548 | } 549 | 550 | List columnWidgets = []; 551 | for (String s in widget.crudViewSource.columns) { 552 | GlobalKey k = GlobalKey(); 553 | headerKeys.add(k); 554 | if (initValEmpty) headerColumnSizes.add(initRatio); 555 | 556 | columnWidgets.add( 557 | Container( 558 | color: Colors.white, 559 | key: k, 560 | child: Padding( 561 | padding: const EdgeInsets.only(left: 8), 562 | child: Align( 563 | alignment: Alignment.centerLeft, 564 | child: Text( 565 | s, 566 | style: 567 | const TextStyle(fontWeight: FontWeight.bold, fontSize: 16), 568 | softWrap: false, 569 | overflow: TextOverflow.ellipsis, 570 | ), 571 | ), 572 | ), 573 | ), 574 | ); 575 | } 576 | return columnWidgets; 577 | } 578 | 579 | List createFormItems(CrudViewSource source, T workingDataObj) { 580 | if (!refreshFormDueToMainSplitViewChange) { 581 | sections.clear(); 582 | formWidgets.clear(); 583 | sections = source.createForm!(workingDataObj); 584 | int sectionCount = 0; 585 | for (FormSection s in sections) { 586 | sectionCount++; 587 | if (s.sectionTitle != null) { 588 | formWidgets.add(Padding( 589 | padding: sectionCount == 1 590 | ? const EdgeInsets.only(bottom: 24.0) 591 | : const EdgeInsets.only(top: 24, bottom: 24.0), 592 | child: Align( 593 | alignment: Alignment.centerLeft, 594 | child: Text(s.sectionTitle.toString())), 595 | )); 596 | } 597 | 598 | List rows = s.formRows!(); 599 | for (FormRow r in rows) { 600 | List items = r.formItems(); 601 | List fItem = []; 602 | for (FormItem i in items) { 603 | fItem.add(Fluidable( 604 | fluid: i.ratio, 605 | // minWidth: 100, 606 | child: Padding( 607 | padding: const EdgeInsets.only(right: 8.0, bottom: 8.0), 608 | child: i.item, 609 | ), 610 | )); 611 | } 612 | 613 | formWidgets.add(Fluid( 614 | children: fItem, 615 | )); 616 | } 617 | } 618 | } else { 619 | refreshFormDueToMainSplitViewChange = false; 620 | } 621 | 622 | return formWidgets; 623 | } 624 | 625 | Widget createTableBody(WidgetRef ref) { 626 | if (_tableBodyData.isEmpty) { 627 | if (_loading) { 628 | return const Center( 629 | child: Padding( 630 | padding: EdgeInsets.all(8), 631 | child: CircularProgressIndicator(), 632 | )); 633 | } else if (_error) { 634 | return Center( 635 | child: InkWell( 636 | onTap: () { 637 | setState(() { 638 | _loading = true; 639 | _error = false; 640 | notifyPageChange(0); 641 | }); 642 | }, 643 | child: const Padding( 644 | padding: EdgeInsets.all(16), 645 | child: Text("Error while loading photos, tap to try again"), 646 | ), 647 | )); 648 | } 649 | } else { 650 | return Column( 651 | children: [ 652 | Expanded( 653 | child: ListView.builder( 654 | controller: ScrollController(keepScrollOffset: true), 655 | itemCount: _tableBodyData.length + (_hasMore ? 1 : 0), 656 | itemBuilder: (context, index) { 657 | if (index == _tableBodyData.length - _nextPageThreshold && 658 | _hasMore) { 659 | // if (!refreshDueToListItemClick) { 660 | notifyPageChange(_pageNumber); 661 | // } 662 | refreshDueToListItemClick = false; 663 | } 664 | if (index == _tableBodyData.length) { 665 | if (_error) { 666 | return Center( 667 | child: InkWell( 668 | onTap: () { 669 | setState(() { 670 | _loading = true; 671 | _error = false; 672 | notifyPageChange(_pageNumber); 673 | }); 674 | }, 675 | child: const Padding( 676 | padding: EdgeInsets.all(16), 677 | child: Text( 678 | "Error while loading photos, tap to try again"), 679 | ), 680 | )); 681 | } else { 682 | return const Center( 683 | child: Padding( 684 | padding: EdgeInsets.all(8), 685 | child: CircularProgressIndicator(), 686 | )); 687 | } 688 | } 689 | final T data = _tableBodyData[index]; 690 | var w = widget.crudViewSource.createRows(data, index); 691 | 692 | List r = []; 693 | double left = 0; 694 | int a = 0; 695 | 696 | // without this row stack will crash. (setting row a size ) 697 | r.add(Container( 698 | height: widget.crudViewSource.rowHeight, 699 | )); 700 | 701 | for (Widget wi in w) { 702 | double weight = headerColumnSizes[a]; 703 | r.add(Positioned.fill( 704 | left: left, 705 | top: 0, 706 | bottom: 0, 707 | child: Container( 708 | color: clickPos != null && clickPos == index 709 | ? CrudTableConst.selectedItemColor 710 | : Colors.white, 711 | child: Align( 712 | alignment: Alignment.centerLeft, 713 | child: Padding( 714 | padding: const EdgeInsets.only(left: 8), 715 | child: ClipRect(child: wi), 716 | )), 717 | ))); 718 | left += (headerColumnFullSize * weight); 719 | a++; 720 | } 721 | 722 | return VisibilityDetector( 723 | key: Key(index.toString()), 724 | onVisibilityChanged: (visibilityInfo) { 725 | if (index == _tableBodyData.length - 1) { 726 | canShowLastPageRefreshButton = true; 727 | ref.read(tableBodyRebuildNotifierProvider).notify(); 728 | } else { 729 | canShowLastPageRefreshButton = false; 730 | } 731 | }, 732 | child: LayoutBuilder(builder: (context, constraint) { 733 | return InkWell( 734 | onTap: () { 735 | // ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(index.toString()))); 736 | workingDataObj = data; 737 | ref 738 | .read(crudActionChangeProvider.notifier) 739 | .changeAction(CrudAction.edit); 740 | widget.onTap(data); 741 | 742 | if (clickPos != null && clickPos == index) { 743 | clickPos = null; 744 | ref 745 | .read(crudActionChangeProvider.notifier) 746 | .changeAction(CrudAction.init); 747 | } else { 748 | clickPos = index; 749 | } 750 | refreshDueToListItemClick = true; 751 | ref.read(tableBodyRebuildNotifierProvider).notify(); 752 | }, 753 | child: Container( 754 | color: clickPos != null && clickPos == index 755 | ? Colors.lightBlue.shade100 756 | : Colors.white, 757 | child: Column( 758 | children: [ 759 | Stack( 760 | children: r, 761 | ), 762 | const Divider( 763 | height: 0, 764 | ) 765 | ], 766 | )), 767 | ); 768 | }), 769 | ); 770 | }), 771 | ), 772 | canShowLastPageRefreshButton 773 | ? Padding( 774 | padding: const EdgeInsets.only(top: 8.0), 775 | child: TextButton.icon( 776 | onPressed: () { 777 | notifyPageChange(_pageNumber); 778 | }, 779 | icon: const Icon(Icons.refresh, size: 18), 780 | label: const Text("Check for new Data"), 781 | ), 782 | ) 783 | : Container() 784 | ], 785 | ); 786 | } 787 | return Container(); 788 | } 789 | 790 | String getActionBtnText(v) { 791 | if (v == CrudAction.edit) { 792 | return "Update"; 793 | } else if (v == CrudAction.delete) { 794 | return "Delete"; 795 | } else { 796 | return "Submit"; 797 | } 798 | } 799 | 800 | @override 801 | void initState() { 802 | columnHeaderWidgets = []; 803 | headerColumnSizes = []; 804 | headerKeys = []; 805 | crudActionChangeProvider = widget.crudActionChangeProvider; 806 | pageNumberChangeProvider = widget.pageNumberChangeProvider; 807 | tableBodyRebuildNotifierProvider = widget.tableBodyRebuildNotifierProvider; 808 | tableDataProvider = widget.tableDataProvider; 809 | // columnHeaderWidgets = crateHeaders(); 810 | setTableInitSettings(); // reset 811 | 812 | WidgetsBinding.instance.addPostFrameCallback((timeStamp) async { 813 | for (GlobalKey k in headerKeys) { 814 | headerColumnSizes.add(k.currentContext!.size!.width); 815 | } 816 | notifyPageChange(0); 817 | }); 818 | super.initState(); 819 | } 820 | 821 | notifyPageChange(int page) { 822 | Future data = widget.crudViewSource.onPageChange( 823 | Pagination(pageNumber: page, limit: widget.crudViewSource.pageLimit)); 824 | data.then( 825 | (value) => { 826 | ref 827 | .read(tableDataProvider.notifier) 828 | .setData(CrudTableDataModel(data: value)) 829 | }, 830 | onError: (r) { 831 | ref 832 | .read(tableDataProvider.notifier) 833 | .setData(CrudTableDataModel(isError: true)); 834 | }, 835 | ); 836 | } 837 | 838 | setTableInitSettings() { 839 | _hasMore = true; 840 | _pageNumber = 0; 841 | // ignore: unnecessary_null_comparison 842 | pageLimit = widget.crudViewSource.pageLimit != null && 843 | widget.crudViewSource.pageLimit != 0 844 | ? widget.crudViewSource.pageLimit 845 | : 20; 846 | _error = false; 847 | _loading = true; 848 | _tableBodyData = []; 849 | workingDataObj = widget.crudViewSource.getEmptyEntity(); 850 | clickPos = null; 851 | } 852 | } 853 | -------------------------------------------------------------------------------- /lib/table/crud_table_const.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | abstract class CrudTableConst { 4 | /// color of the item click highlight 5 | static final Color selectedItemColor = Colors.lightBlue.shade100; 6 | } 7 | -------------------------------------------------------------------------------- /lib/table/crud_table_data_model.dart: -------------------------------------------------------------------------------- 1 | // internal use 2 | class CrudTableDataModel { 3 | bool? isError = false; 4 | bool? isLoading = false; 5 | List? data; 6 | 7 | CrudTableDataModel({this.isError, this.isLoading, this.data}); 8 | 9 | @override 10 | String toString() { 11 | return 'CrudTableDataModel{isError: $isError, isLoading: $isLoading, data: $data}'; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/table/crud_table_row_holder.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | 3 | import 'crud_action_listener.dart'; 4 | import 'crud_table.dart'; 5 | import 'form_section.dart'; 6 | 7 | class CrudViewSource { 8 | /// columns of the table, provide name of the column as a string array 9 | List columns; 10 | 11 | /// row height of the table 12 | double rowHeight; 13 | 14 | /// page limit when lazy loading 15 | int pageLimit; 16 | 17 | /// provide an empty Object which you are use with this CRUD UI, which we get back when click on the submit button of the form 18 | final T Function() emptyEntityFactory; 19 | 20 | /// function which will crate rows of the table (check example for more details) 21 | List Function(T data, int index) createRows; 22 | 23 | /// when click a row of table, form will create according, here you have to provide the form fields crate function (check example for more details) 24 | List Function(T data)? createForm; 25 | 26 | /// when scrolling the table you will notify with the result of pagination object 27 | Future> Function(Pagination pagination) onPageChange; 28 | 29 | ///form crud actions listener (add, delete, update) 30 | CrudActionListener? crudActionListener; 31 | 32 | CrudViewSource({ 33 | required this.columns, 34 | required this.rowHeight, 35 | required this.pageLimit, 36 | required this.emptyEntityFactory, 37 | required this.createRows, 38 | this.createForm, 39 | required this.onPageChange, 40 | this.crudActionListener, 41 | }); 42 | T getEmptyEntity() => emptyEntityFactory(); 43 | } 44 | -------------------------------------------------------------------------------- /lib/table/crud_table_util.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | ///Util class of CURD Table 4 | class CrudTableUtil { 5 | /// return a Key base on the value you provides 6 | static Key? formFieldKey(var value) { 7 | return value != null ? Key(value.toString()) : null; 8 | } 9 | 10 | /// return a String value of on the value you provides 11 | static String? formFieldInitValue(var value) { 12 | return value?.toString(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/table/form_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | 3 | /// FormItem Class user for provide form field widgets for CRUD Table 4 | class FormItem { 5 | /// define the how much width ratio the form field is compare to sibling form fields 6 | int ratio; 7 | 8 | /// form field widget (ex: TextFormField,Checkbox, etc) 9 | Widget item; 10 | 11 | FormItem({required this.ratio, required this.item}); 12 | } 13 | -------------------------------------------------------------------------------- /lib/table/form_row.dart: -------------------------------------------------------------------------------- 1 | import 'form_item.dart'; 2 | 3 | /// single row of the form 4 | class FormRow { 5 | /// widgets which need to display in the row 6 | List Function() formItems; 7 | FormRow({required this.formItems}); 8 | } 9 | -------------------------------------------------------------------------------- /lib/table/form_section.dart: -------------------------------------------------------------------------------- 1 | import 'form_row.dart'; 2 | 3 | /// Section of the form 4 | /// you can have multiple form sections 5 | class FormSection { 6 | /// Title of the section 7 | String? sectionTitle; 8 | 9 | /// Rows of the section, (rows consist of widgets) 10 | List Function()? formRows; 11 | 12 | FormSection({this.sectionTitle, required this.formRows}); 13 | } 14 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.11.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.3.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.2" 44 | fake_async: 45 | dependency: transitive 46 | description: 47 | name: fake_async 48 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.3.1" 52 | fluid_kit: 53 | dependency: "direct main" 54 | description: 55 | name: fluid_kit 56 | sha256: bb7d443356a7d8fa48bd0fe2073c5bd3a2f571782459856fe715ae8cdaf22d91 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "3.0.0" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_lints: 66 | dependency: "direct dev" 67 | description: 68 | name: flutter_lints 69 | sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 70 | url: "https://pub.dev" 71 | source: hosted 72 | version: "2.0.3" 73 | flutter_riverpod: 74 | dependency: "direct main" 75 | description: 76 | name: flutter_riverpod 77 | sha256: e667e406a74d67715f1fa0bd941d9ded49aff72f3a9f4440a36aece4e8d457a7 78 | url: "https://pub.dev" 79 | source: hosted 80 | version: "2.4.3" 81 | flutter_test: 82 | dependency: "direct dev" 83 | description: flutter 84 | source: sdk 85 | version: "0.0.0" 86 | lints: 87 | dependency: transitive 88 | description: 89 | name: lints 90 | sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" 91 | url: "https://pub.dev" 92 | source: hosted 93 | version: "2.1.1" 94 | matcher: 95 | dependency: transitive 96 | description: 97 | name: matcher 98 | sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "0.12.16" 102 | material_color_utilities: 103 | dependency: transitive 104 | description: 105 | name: material_color_utilities 106 | sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" 107 | url: "https://pub.dev" 108 | source: hosted 109 | version: "0.5.0" 110 | meta: 111 | dependency: transitive 112 | description: 113 | name: meta 114 | sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" 115 | url: "https://pub.dev" 116 | source: hosted 117 | version: "1.9.1" 118 | path: 119 | dependency: transitive 120 | description: 121 | name: path 122 | sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" 123 | url: "https://pub.dev" 124 | source: hosted 125 | version: "1.8.3" 126 | riverpod: 127 | dependency: transitive 128 | description: 129 | name: riverpod 130 | sha256: "494bf2cfb4df30000273d3052bdb1cc1de738574c6b678f0beb146ea56f5e208" 131 | url: "https://pub.dev" 132 | source: hosted 133 | version: "2.4.3" 134 | sky_engine: 135 | dependency: transitive 136 | description: flutter 137 | source: sdk 138 | version: "0.0.99" 139 | source_span: 140 | dependency: transitive 141 | description: 142 | name: source_span 143 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 144 | url: "https://pub.dev" 145 | source: hosted 146 | version: "1.10.0" 147 | split_view: 148 | dependency: "direct main" 149 | description: 150 | name: split_view 151 | sha256: "7ad0e1c40703901aa1175fd465dec5e965b55324f9cc8e51526479a4a96d01a4" 152 | url: "https://pub.dev" 153 | source: hosted 154 | version: "3.2.1" 155 | stack_trace: 156 | dependency: transitive 157 | description: 158 | name: stack_trace 159 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 160 | url: "https://pub.dev" 161 | source: hosted 162 | version: "1.11.0" 163 | state_notifier: 164 | dependency: transitive 165 | description: 166 | name: state_notifier 167 | sha256: "8fe42610f179b843b12371e40db58c9444f8757f8b69d181c97e50787caed289" 168 | url: "https://pub.dev" 169 | source: hosted 170 | version: "0.7.2+1" 171 | stream_channel: 172 | dependency: transitive 173 | description: 174 | name: stream_channel 175 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 176 | url: "https://pub.dev" 177 | source: hosted 178 | version: "2.1.1" 179 | string_scanner: 180 | dependency: transitive 181 | description: 182 | name: string_scanner 183 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 184 | url: "https://pub.dev" 185 | source: hosted 186 | version: "1.2.0" 187 | term_glyph: 188 | dependency: transitive 189 | description: 190 | name: term_glyph 191 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 192 | url: "https://pub.dev" 193 | source: hosted 194 | version: "1.2.1" 195 | test_api: 196 | dependency: transitive 197 | description: 198 | name: test_api 199 | sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" 200 | url: "https://pub.dev" 201 | source: hosted 202 | version: "0.6.0" 203 | vector_math: 204 | dependency: transitive 205 | description: 206 | name: vector_math 207 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 208 | url: "https://pub.dev" 209 | source: hosted 210 | version: "2.1.4" 211 | visibility_detector: 212 | dependency: "direct main" 213 | description: 214 | name: visibility_detector 215 | sha256: dd5cc11e13494f432d15939c3aa8ae76844c42b723398643ce9addb88a5ed420 216 | url: "https://pub.dev" 217 | source: hosted 218 | version: "0.4.0+2" 219 | web: 220 | dependency: transitive 221 | description: 222 | name: web 223 | sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 224 | url: "https://pub.dev" 225 | source: hosted 226 | version: "0.1.4-beta" 227 | sdks: 228 | dart: ">=3.1.0-185.0.dev <4.0.0" 229 | flutter: ">=3.10.0" 230 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: crud_table 2 | description: CRUD Table Flutter is a package for crating CURD-UI for your entity/object/class easily. It consists of a Lazy loading function, resizable columns, and integrated CRUD Form. 3 | version: 0.0.7 4 | homepage: https://github.com/ireshmw/crud_table 5 | repository: https://github.com/ireshmw/crud_table 6 | issue_tracker: https://github.com/ireshmw/crud_table/issues 7 | 8 | screenshots: 9 | - description: "CRUD Table Explain" 10 | path: img/crud_table_ui_explain.jpg 11 | - description: "CRUD Table Image 2" 12 | path: img/crud_table_img2.png 13 | - description: "CRUD Table Image" 14 | path: img/crud_table_img.png 15 | 16 | topics: 17 | - crud-table 18 | - flutter-table 19 | - crud-ui 20 | - riverpod-crud 21 | - flutter-crud-table 22 | 23 | environment: 24 | sdk: ">=3.0.0 <4.0.0" 25 | flutter: ">=3.10.0" 26 | 27 | dependencies: 28 | flutter: 29 | sdk: flutter 30 | 31 | fluid_kit: ^3.0.0 32 | flutter_riverpod: ^2.4.3 33 | split_view: ^3.2.1 34 | visibility_detector: ^0.4.0+2 35 | 36 | dev_dependencies: 37 | flutter_test: 38 | sdk: flutter 39 | flutter_lints: ^2.0.3 40 | 41 | # The following section is specific to Flutter. 42 | flutter: 43 | -------------------------------------------------------------------------------- /test/crud_table_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | 4 | void main() { 5 | test('adds one to input values', () {}); 6 | } 7 | --------------------------------------------------------------------------------