├── .gitignore ├── .idea ├── .gitignore ├── codeStyles │ └── Project.xml ├── libraries │ ├── Dart_SDK.xml │ ├── Flutter_Plugins.xml │ └── Flutter_for_Android.xml ├── modules.xml ├── runConfigurations │ └── example_lib_main_dart.xml ├── vcs.xml └── workspace.xml ├── .metadata ├── .vscode └── launch.json ├── 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 │ │ │ │ │ └── example │ │ │ │ │ └── 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 │ ├── Podfile │ ├── 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 ├── linux │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Makefile │ ├── app_configuration.mk │ ├── flutter │ │ ├── .template_version │ │ ├── CMakeLists.txt │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ └── generated_plugins.mk │ ├── main.cc │ ├── my_application.cc │ ├── my_application.h │ ├── window_configuration.cc │ └── window_configuration.h ├── macos │ ├── .gitignore │ ├── Flutter │ │ ├── Flutter-Debug.xcconfig │ │ ├── Flutter-Release.xcconfig │ │ └── GeneratedPluginRegistrant.swift │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ │ ├── Base.lproj │ │ └── MainMenu.xib │ │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ │ ├── DebugProfile.entitlements │ │ ├── Info.plist │ │ ├── MainFlutterWindow.swift │ │ └── Release.entitlements ├── 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 └── windows │ ├── .gitignore │ ├── AppConfiguration.props │ ├── CMakeLists.txt │ ├── FlutterBuild.vcxproj │ ├── Runner.sln │ ├── Runner.vcxproj │ ├── Runner.vcxproj.filters │ ├── flutter │ ├── .template_version │ ├── CMakeLists.txt │ ├── GeneratedPlugins.props │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake │ ├── runner │ ├── CMakeLists.txt │ ├── Runner.rc │ ├── flutter_window.cpp │ ├── flutter_window.h │ ├── main.cpp │ ├── resource.h │ ├── resources │ │ └── app_icon.ico │ ├── run_loop.cpp │ ├── run_loop.h │ ├── runner.exe.manifest │ ├── utils.cpp │ ├── utils.h │ ├── win32_window.cpp │ ├── win32_window.h │ ├── window_configuration.cpp │ └── window_configuration.h │ └── scripts │ ├── bundle_assets_and_deps.bat │ └── prepare_dependencies.bat ├── flutter_responsive_table.iml ├── lib ├── responsive_table.dart └── src │ ├── datatable_header.dart │ └── responsive_datatable.dart ├── pubspec.lock ├── pubspec.yaml ├── responsive_table.iml ├── screenshot ├── screenshot1.png ├── screenshot2.png ├── screenshot3.png └── screenshot4.png └── test ├── flutter_responsive_table_test.dart └── responsive_table_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Project exclude paths 2 | /. -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 |
116 |
-------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_for_Android.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations/example_lib_main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 26 | 27 | 29 | 30 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 1587646893529 64 | 68 | 69 | 70 | 71 | 80 | 81 | -------------------------------------------------------------------------------- /.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: 8e5b575174bc4c0c92c1e6978a4b82baced05c23 8 | channel: unknown 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Flutter for web", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "example/lib/main.dart", 12 | "args": [ 13 | "-d", 14 | "chrome" 15 | ] 16 | }, 17 | ] 18 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 0.2.0+2 2 | 3 | * `headerDecoration`: decorate the data row 4 | * `rowDecoration`: decorate the data row 5 | * `selectedDecoration`: decorate the selected data row 6 | * `headerTextStyle`: styling the header row 7 | * `rowTextStyle`: styling the data row 8 | * `selectedTextStyle`: styling the selected data row 9 | 10 | # 0.2.0+1 11 | 12 | * update example and split TextEditableWidget 13 | 14 | # 0.2.0 15 | 16 | * null safety 17 | 18 | # 0.1.1+8 19 | 20 | * fixed the update 21 | 22 | ## 0.1.1+7 23 | 24 | * integrate with responsive_context 25 | * return (value, row) onSourceBuilder 26 | * add hideUnderline to hideBottomBorder 27 | 28 | ## 0.1.1+6 29 | 30 | * seperate editable widget 31 | 32 | ## 0.1.1+5 33 | 34 | * add editable to DatatableHeader (false by default) 35 | 36 | * update some example for editable field 37 | 38 | ## 0.1.1+4 39 | 40 | * remove some warnings 41 | 42 | ## 0.1.1+3 43 | 44 | * remove selectableKey , constrains, and decoration 45 | 46 | * change select from List to List>(), 47 | 48 | * restructured widget to serpated parts. 49 | 50 | * add responsive_context into widget, change from stateful to stateless 51 | 52 | * autoHeight was added into order to work with shortlist and scrollalbe inside of SingleScrollView without maxHeight 53 | 54 | ## 0.1.1+2 55 | 56 | * TODO: add linear progress 57 | 58 | ## 0.1.1+1 59 | 60 | * TODO: update readme version 61 | 62 | ## 0.0.1 63 | 64 | * TODO: Describe initial release. 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2020, kechankrisna 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | analyzer: 4 | exclude: [lib/generated_plugin_registrant.dart] 5 | 6 | linter: 7 | rules: 8 | avoid_shadowing_type_parameters: false 9 | await_only_futures: false 10 | unawaited_futures: false 11 | prefer_single_quotes: false 12 | unnecessary_this: false 13 | omit_local_variable_types: false 14 | always_declare_return_types: false 15 | prefer_final_fields: false -------------------------------------------------------------------------------- /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 | # Exceptions to above rules. 44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 45 | -------------------------------------------------------------------------------- /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: 8e5b575174bc4c0c92c1e6978a4b82baced05c23 8 | channel: unknown 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # responsive_table_example 2 | 3 | Demonstrates how to use the responsive_table plugin. 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 flutter.compileSdkVersion 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.example.example" 47 | minSdkVersion flutter.minSdkVersion 48 | targetSdkVersion flutter.targetSdkVersion 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 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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.6.10' 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 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /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? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /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 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:responsive_table/responsive_table.dart'; 4 | 5 | void main() { 6 | WidgetsFlutterBinding.ensureInitialized(); 7 | runApp(MyApp()); 8 | } 9 | 10 | class MyApp extends StatelessWidget { 11 | @override 12 | Widget build(BuildContext context) { 13 | return MaterialApp( 14 | title: 'Flutter Demo', 15 | debugShowCheckedModeBanner: false, 16 | theme: ThemeData( 17 | primarySwatch: Colors.blue, 18 | visualDensity: VisualDensity.adaptivePlatformDensity, 19 | ), 20 | initialRoute: '/', 21 | routes: { 22 | '/': (_) => DataPage(), 23 | }, 24 | ); 25 | } 26 | } 27 | 28 | class DataPage extends StatefulWidget { 29 | DataPage({Key? key}) : super(key: key); 30 | @override 31 | _DataPageState createState() => _DataPageState(); 32 | } 33 | 34 | class _DataPageState extends State { 35 | late List _headers; 36 | 37 | List _perPages = [10, 20, 50, 100]; 38 | int _total = 100; 39 | int? _currentPerPage = 10; 40 | List? _expanded; 41 | String? _searchKey = "id"; 42 | 43 | int _currentPage = 1; 44 | bool _isSearch = false; 45 | List> _sourceOriginal = []; 46 | List> _sourceFiltered = []; 47 | List> _source = []; 48 | List> _selecteds = []; 49 | // ignore: unused_field 50 | String _selectableKey = "id"; 51 | 52 | String? _sortColumn; 53 | bool _sortAscending = true; 54 | bool _isLoading = true; 55 | bool _showSelect = true; 56 | var random = new Random(); 57 | 58 | List> _generateData({int n: 100}) { 59 | final List source = List.filled(n, Random.secure()); 60 | List> temps = []; 61 | var i = 1; 62 | print(i); 63 | // ignore: unused_local_variable 64 | for (var data in source) { 65 | temps.add({ 66 | "id": i, 67 | "sku": "$i\000$i", 68 | "name": "Product $i", 69 | "category": "Category-$i", 70 | "price": i * 10.00, 71 | "cost": "20.00", 72 | "margin": "${i}0.20", 73 | "in_stock": "${i}0", 74 | "alert": "5", 75 | "received": [i + 20, 150] 76 | }); 77 | i++; 78 | } 79 | return temps; 80 | } 81 | 82 | _initializeData() async { 83 | _mockPullData(); 84 | } 85 | 86 | _mockPullData() async { 87 | _expanded = List.generate(_currentPerPage!, (index) => false); 88 | 89 | setState(() => _isLoading = true); 90 | Future.delayed(Duration(seconds: 3)).then((value) { 91 | _sourceOriginal.clear(); 92 | _sourceOriginal.addAll(_generateData(n: random.nextInt(10000))); 93 | _sourceFiltered = _sourceOriginal; 94 | _total = _sourceFiltered.length; 95 | _source = _sourceFiltered.getRange(0, _currentPerPage!).toList(); 96 | setState(() => _isLoading = false); 97 | }); 98 | } 99 | 100 | _resetData({start: 0}) async { 101 | setState(() => _isLoading = true); 102 | var _expandedLen = 103 | _total - start < _currentPerPage! ? _total - start : _currentPerPage; 104 | Future.delayed(Duration(seconds: 0)).then((value) { 105 | _expanded = List.generate(_expandedLen as int, (index) => false); 106 | _source.clear(); 107 | _source = _sourceFiltered.getRange(start, start + _expandedLen).toList(); 108 | setState(() => _isLoading = false); 109 | }); 110 | } 111 | 112 | _filterData(value) { 113 | setState(() => _isLoading = true); 114 | 115 | try { 116 | if (value == "" || value == null) { 117 | _sourceFiltered = _sourceOriginal; 118 | } else { 119 | _sourceFiltered = _sourceOriginal 120 | .where((data) => data[_searchKey!] 121 | .toString() 122 | .toLowerCase() 123 | .contains(value.toString().toLowerCase())) 124 | .toList(); 125 | } 126 | 127 | _total = _sourceFiltered.length; 128 | var _rangeTop = _total < _currentPerPage! ? _total : _currentPerPage!; 129 | _expanded = List.generate(_rangeTop, (index) => false); 130 | _source = _sourceFiltered.getRange(0, _rangeTop).toList(); 131 | } catch (e) { 132 | print(e); 133 | } 134 | setState(() => _isLoading = false); 135 | } 136 | 137 | @override 138 | void initState() { 139 | super.initState(); 140 | 141 | /// set headers 142 | _headers = [ 143 | DatatableHeader( 144 | text: "ID", 145 | value: "id", 146 | show: true, 147 | sortable: true, 148 | textAlign: TextAlign.center), 149 | DatatableHeader( 150 | text: "Name", 151 | value: "name", 152 | show: true, 153 | flex: 2, 154 | sortable: true, 155 | editable: true, 156 | textAlign: TextAlign.left), 157 | DatatableHeader( 158 | text: "SKU", 159 | value: "sku", 160 | show: true, 161 | sortable: true, 162 | textAlign: TextAlign.center), 163 | DatatableHeader( 164 | text: "Category", 165 | value: "category", 166 | show: true, 167 | sortable: true, 168 | textAlign: TextAlign.left), 169 | DatatableHeader( 170 | text: "Price", 171 | value: "price", 172 | show: true, 173 | sortable: true, 174 | textAlign: TextAlign.left), 175 | DatatableHeader( 176 | text: "Margin", 177 | value: "margin", 178 | show: true, 179 | sortable: true, 180 | textAlign: TextAlign.left), 181 | DatatableHeader( 182 | text: "In Stock", 183 | value: "in_stock", 184 | show: true, 185 | sortable: true, 186 | textAlign: TextAlign.left), 187 | DatatableHeader( 188 | text: "Alert", 189 | value: "alert", 190 | show: true, 191 | sortable: true, 192 | textAlign: TextAlign.left), 193 | DatatableHeader( 194 | text: "Received", 195 | value: "received", 196 | show: true, 197 | sortable: false, 198 | sourceBuilder: (value, row) { 199 | List list = List.from(value); 200 | return Container( 201 | child: Column( 202 | children: [ 203 | Container( 204 | width: 85, 205 | child: LinearProgressIndicator( 206 | value: list.first / list.last, 207 | ), 208 | ), 209 | Text("${list.first} of ${list.last}") 210 | ], 211 | ), 212 | ); 213 | }, 214 | textAlign: TextAlign.center), 215 | ]; 216 | 217 | _initializeData(); 218 | } 219 | 220 | @override 221 | void dispose() { 222 | super.dispose(); 223 | } 224 | 225 | @override 226 | Widget build(BuildContext context) { 227 | return Scaffold( 228 | appBar: AppBar( 229 | title: Text("RESPONSIVE DATA TABLE"), 230 | actions: [ 231 | IconButton( 232 | onPressed: _initializeData, 233 | icon: Icon(Icons.refresh_sharp), 234 | ), 235 | ], 236 | ), 237 | drawer: Drawer( 238 | child: ListView( 239 | children: [ 240 | ListTile( 241 | leading: Icon(Icons.home), 242 | title: Text("home"), 243 | onTap: () {}, 244 | ), 245 | ListTile( 246 | leading: Icon(Icons.storage), 247 | title: Text("data"), 248 | onTap: () {}, 249 | ) 250 | ], 251 | ), 252 | ), 253 | body: SingleChildScrollView( 254 | child: Column( 255 | mainAxisAlignment: MainAxisAlignment.start, 256 | mainAxisSize: MainAxisSize.max, 257 | children: [ 258 | Container( 259 | margin: EdgeInsets.all(10), 260 | padding: EdgeInsets.all(0), 261 | constraints: BoxConstraints( 262 | maxHeight: 700, 263 | ), 264 | child: Card( 265 | elevation: 1, 266 | shadowColor: Colors.black, 267 | clipBehavior: Clip.none, 268 | child: ResponsiveDatatable( 269 | title: TextButton.icon( 270 | onPressed: () => {}, 271 | icon: Icon(Icons.add), 272 | label: Text("new item"), 273 | ), 274 | reponseScreenSizes: [ScreenSize.xs], 275 | actions: [ 276 | if (_isSearch) 277 | Expanded( 278 | child: TextField( 279 | decoration: InputDecoration( 280 | hintText: 'Enter search term based on ' + 281 | _searchKey! 282 | .replaceAll(new RegExp('[\\W_]+'), ' ') 283 | .toUpperCase(), 284 | prefixIcon: IconButton( 285 | icon: Icon(Icons.cancel), 286 | onPressed: () { 287 | setState(() { 288 | _isSearch = false; 289 | }); 290 | _initializeData(); 291 | }), 292 | suffixIcon: IconButton( 293 | icon: Icon(Icons.search), onPressed: () {})), 294 | onSubmitted: (value) { 295 | _filterData(value); 296 | }, 297 | )), 298 | if (!_isSearch) 299 | IconButton( 300 | icon: Icon(Icons.search), 301 | onPressed: () { 302 | setState(() { 303 | _isSearch = true; 304 | }); 305 | }) 306 | ], 307 | headers: _headers, 308 | source: _source, 309 | selecteds: _selecteds, 310 | showSelect: _showSelect, 311 | autoHeight: false, 312 | dropContainer: (data) { 313 | if (int.tryParse(data['id'].toString())!.isEven) { 314 | return Text("is Even"); 315 | } 316 | return _DropDownContainer(data: data); 317 | }, 318 | onChangedRow: (value, header) { 319 | /// print(value); 320 | /// print(header); 321 | }, 322 | onSubmittedRow: (value, header) { 323 | /// print(value); 324 | /// print(header); 325 | }, 326 | onTabRow: (data) { 327 | print(data); 328 | }, 329 | onSort: (value) { 330 | setState(() => _isLoading = true); 331 | 332 | setState(() { 333 | _sortColumn = value; 334 | _sortAscending = !_sortAscending; 335 | if (_sortAscending) { 336 | _sourceFiltered.sort((a, b) => 337 | b["$_sortColumn"].compareTo(a["$_sortColumn"])); 338 | } else { 339 | _sourceFiltered.sort((a, b) => 340 | a["$_sortColumn"].compareTo(b["$_sortColumn"])); 341 | } 342 | var _rangeTop = _currentPerPage! < _sourceFiltered.length 343 | ? _currentPerPage! 344 | : _sourceFiltered.length; 345 | _source = _sourceFiltered.getRange(0, _rangeTop).toList(); 346 | _searchKey = value; 347 | 348 | _isLoading = false; 349 | }); 350 | }, 351 | expanded: _expanded, 352 | sortAscending: _sortAscending, 353 | sortColumn: _sortColumn, 354 | isLoading: _isLoading, 355 | onSelect: (value, item) { 356 | print("$value $item "); 357 | if (value!) { 358 | setState(() => _selecteds.add(item)); 359 | } else { 360 | setState( 361 | () => _selecteds.removeAt(_selecteds.indexOf(item))); 362 | } 363 | }, 364 | onSelectAll: (value) { 365 | if (value!) { 366 | setState(() => _selecteds = 367 | _source.map((entry) => entry).toList().cast()); 368 | } else { 369 | setState(() => _selecteds.clear()); 370 | } 371 | }, 372 | footers: [ 373 | Container( 374 | padding: EdgeInsets.symmetric(horizontal: 15), 375 | child: Text("Rows per page:"), 376 | ), 377 | if (_perPages.isNotEmpty) 378 | Container( 379 | padding: EdgeInsets.symmetric(horizontal: 15), 380 | child: DropdownButton( 381 | value: _currentPerPage, 382 | items: _perPages 383 | .map((e) => DropdownMenuItem( 384 | child: Text("$e"), 385 | value: e, 386 | )) 387 | .toList(), 388 | onChanged: (dynamic value) { 389 | setState(() { 390 | _currentPerPage = value; 391 | _currentPage = 1; 392 | _resetData(); 393 | }); 394 | }, 395 | isExpanded: false, 396 | ), 397 | ), 398 | Container( 399 | padding: EdgeInsets.symmetric(horizontal: 15), 400 | child: 401 | Text("$_currentPage - $_currentPerPage of $_total"), 402 | ), 403 | IconButton( 404 | icon: Icon( 405 | Icons.arrow_back_ios, 406 | size: 16, 407 | ), 408 | onPressed: _currentPage == 1 409 | ? null 410 | : () { 411 | var _nextSet = _currentPage - _currentPerPage!; 412 | setState(() { 413 | _currentPage = _nextSet > 1 ? _nextSet : 1; 414 | _resetData(start: _currentPage - 1); 415 | }); 416 | }, 417 | padding: EdgeInsets.symmetric(horizontal: 15), 418 | ), 419 | IconButton( 420 | icon: Icon(Icons.arrow_forward_ios, size: 16), 421 | onPressed: _currentPage + _currentPerPage! - 1 > _total 422 | ? null 423 | : () { 424 | var _nextSet = _currentPage + _currentPerPage!; 425 | 426 | setState(() { 427 | _currentPage = _nextSet < _total 428 | ? _nextSet 429 | : _total - _currentPerPage!; 430 | _resetData(start: _nextSet - 1); 431 | }); 432 | }, 433 | padding: EdgeInsets.symmetric(horizontal: 15), 434 | ) 435 | ], 436 | headerDecoration: BoxDecoration( 437 | color: Colors.grey, 438 | border: Border( 439 | bottom: BorderSide(color: Colors.red, width: 1))), 440 | selectedDecoration: BoxDecoration( 441 | border: Border( 442 | bottom: 443 | BorderSide(color: Colors.green[300]!, width: 1)), 444 | color: Colors.green, 445 | ), 446 | headerTextStyle: TextStyle(color: Colors.white), 447 | rowTextStyle: TextStyle(color: Colors.green), 448 | selectedTextStyle: TextStyle(color: Colors.white), 449 | ), 450 | ), 451 | ), 452 | ])), 453 | ); 454 | } 455 | } 456 | 457 | class _DropDownContainer extends StatelessWidget { 458 | final Map data; 459 | const _DropDownContainer({Key? key, required this.data}) : super(key: key); 460 | 461 | @override 462 | Widget build(BuildContext context) { 463 | List _children = data.entries.map((entry) { 464 | Widget w = Row( 465 | children: [ 466 | Text(entry.key.toString()), 467 | Spacer(), 468 | Text(entry.value.toString()), 469 | ], 470 | ); 471 | return w; 472 | }).toList(); 473 | 474 | return Container( 475 | /// height: 100, 476 | child: Column( 477 | /// children: [ 478 | /// Expanded( 479 | /// child: Container( 480 | /// color: Colors.red, 481 | /// height: 50, 482 | /// )), 483 | /// ], 484 | children: _children, 485 | ), 486 | ); 487 | } 488 | } 489 | -------------------------------------------------------------------------------- /example/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /example/linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(runner LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "flutter_responsive_table_example") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 12 | set(CMAKE_BUILD_TYPE "Debug" CACHE 13 | STRING "Flutter build mode" FORCE) 14 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 15 | "Debug" "Profile" "Release") 16 | endif() 17 | 18 | # Compilation settings that should be applied to most targets. 19 | function(APPLY_STANDARD_SETTINGS TARGET) 20 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 21 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 22 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 23 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 24 | endfunction() 25 | 26 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 27 | 28 | # Flutter library and tool build rules. 29 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 30 | 31 | # System-level dependencies. 32 | find_package(PkgConfig REQUIRED) 33 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 34 | 35 | # Application build 36 | add_executable(${BINARY_NAME} 37 | "main.cc" 38 | "my_application.cc" 39 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 40 | ) 41 | apply_standard_settings(${BINARY_NAME}) 42 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 43 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 44 | add_dependencies(${BINARY_NAME} flutter_assemble) 45 | 46 | # Generated plugin build rules, which manage building the plugins and adding 47 | # them to the application. 48 | include(flutter/generated_plugins.cmake) 49 | 50 | 51 | # === Installation === 52 | # By default, "installing" just makes a relocatable bundle in the build 53 | # directory. 54 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 55 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 56 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 57 | endif() 58 | 59 | # Start with a clean build bundle directory every time. 60 | install(CODE " 61 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 62 | " COMPONENT Runtime) 63 | 64 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 65 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 66 | 67 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 68 | COMPONENT Runtime) 69 | 70 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 71 | COMPONENT Runtime) 72 | 73 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 74 | COMPONENT Runtime) 75 | 76 | if(PLUGIN_BUNDLED_LIBRARIES) 77 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 78 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 79 | COMPONENT Runtime) 80 | endif() 81 | 82 | # Fully re-copy the assets directory on each build to avoid having stale files 83 | # from a previous install. 84 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 85 | install(CODE " 86 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 87 | " COMPONENT Runtime) 88 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 89 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 90 | 91 | # Install the AOT library on non-Debug builds only. 92 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 94 | COMPONENT Runtime) 95 | endif() 96 | -------------------------------------------------------------------------------- /example/linux/Makefile: -------------------------------------------------------------------------------- 1 | include app_configuration.mk 2 | 3 | # Default build type. 4 | BUILD=debug 5 | 6 | FLUTTER_MANAGED_DIR=flutter 7 | FLUTTER_EPHEMERAL_DIR=$(FLUTTER_MANAGED_DIR)/ephemeral 8 | 9 | # Configuration provided via flutter tool. 10 | FLUTTER_CONFIG_FILE=$(FLUTTER_EPHEMERAL_DIR)/generated_config.mk 11 | include $(FLUTTER_CONFIG_FILE) 12 | 13 | # Dependency locations 14 | FLUTTER_APP_DIR=$(CURDIR)/.. 15 | FLUTTER_APP_BUILD_DIR=$(FLUTTER_APP_DIR)/build 16 | 17 | OUT_DIR=$(FLUTTER_APP_BUILD_DIR)/linux 18 | OBJ_DIR=$(OUT_DIR)/obj/$(BUILD) 19 | 20 | # Libraries 21 | FLUTTER_LIB_NAME=flutter_linux_glfw 22 | FLUTTER_LIB=$(FLUTTER_EPHEMERAL_DIR)/lib$(FLUTTER_LIB_NAME).so 23 | 24 | # Tools 25 | FLUTTER_BIN=$(FLUTTER_ROOT)/bin/flutter 26 | LINUX_BUILD=$(FLUTTER_ROOT)/packages/flutter_tools/bin/tool_backend.sh 27 | 28 | # Resources 29 | ICU_DATA_NAME=icudtl.dat 30 | ICU_DATA_SOURCE=$(FLUTTER_EPHEMERAL_DIR)/$(ICU_DATA_NAME) 31 | FLUTTER_ASSETS_NAME=flutter_assets 32 | FLUTTER_ASSETS_SOURCE=$(FLUTTER_APP_BUILD_DIR)/$(FLUTTER_ASSETS_NAME) 33 | 34 | # Bundle structure 35 | BUNDLE_OUT_DIR=$(OUT_DIR)/$(BUILD) 36 | BUNDLE_DATA_DIR=$(BUNDLE_OUT_DIR)/data 37 | BUNDLE_LIB_DIR=$(BUNDLE_OUT_DIR)/lib 38 | 39 | BIN_OUT=$(BUNDLE_OUT_DIR)/$(BINARY_NAME) 40 | ICU_DATA_OUT=$(BUNDLE_DATA_DIR)/$(ICU_DATA_NAME) 41 | FLUTTER_LIB_OUT=$(BUNDLE_LIB_DIR)/$(notdir $(FLUTTER_LIB)) 42 | ALL_LIBS_OUT=$(FLUTTER_LIB_OUT) \ 43 | $(foreach lib,$(EXTRA_BUNDLED_LIBRARIES),$(BUNDLE_LIB_DIR)/$(notdir $(lib))) 44 | 45 | # Add relevant code from the wrapper library, which is intended to be statically 46 | # built into the client. 47 | # Use abspath for the wrapper root, which can contain relative paths; the 48 | # intermediate build files will be based on the source path, which will cause 49 | # issues if they start with one or more '../'s. 50 | WRAPPER_ROOT=$(abspath $(FLUTTER_EPHEMERAL_DIR)/cpp_client_wrapper_glfw) 51 | WRAPPER_SOURCES= \ 52 | $(WRAPPER_ROOT)/flutter_window_controller.cc \ 53 | $(WRAPPER_ROOT)/plugin_registrar.cc \ 54 | $(WRAPPER_ROOT)/engine_method_result.cc 55 | 56 | # Use abspath for extra sources, which may also contain relative paths (see 57 | # note above about WRAPPER_ROOT). 58 | SOURCES=main.cc window_configuration.cc \ 59 | flutter/generated_plugin_registrant.cc \ 60 | $(WRAPPER_SOURCES) $(abspath $(EXTRA_SOURCES)) 61 | 62 | # Headers 63 | WRAPPER_INCLUDE_DIR=$(WRAPPER_ROOT)/include 64 | INCLUDE_DIRS=$(FLUTTER_EPHEMERAL_DIR) $(WRAPPER_INCLUDE_DIR) 65 | 66 | # Build settings 67 | ifneq ($(strip $(SYSTEM_LIBRARIES)),) 68 | EXTRA_CPPFLAGS+=$(patsubst -I%,-isystem%,$(shell pkg-config --cflags $(SYSTEM_LIBRARIES))) 69 | EXTRA_LDFLAGS+=$(shell pkg-config --libs $(SYSTEM_LIBRARIES)) 70 | endif 71 | CXX=clang++ 72 | CPPFLAGS.release=-DNDEBUG 73 | CPPFLAGS.profile=$(CPPFLAGS.release) 74 | CXXFLAGS.release=-O2 75 | CXXFLAGS.profile=$(CXXFLAGS.release) 76 | CXXFLAGS=-std=c++14 -Wall -Werror $(CXXFLAGS.$(BUILD)) $(EXTRA_CXXFLAGS) 77 | CPPFLAGS=$(patsubst %,-I%,$(INCLUDE_DIRS)) \ 78 | $(CPPFLAGS.$(BUILD)) $(EXTRA_CPPFLAGS) 79 | LDFLAGS=-L$(BUNDLE_LIB_DIR) \ 80 | -l$(FLUTTER_LIB_NAME) \ 81 | $(EXTRA_LDFLAGS) \ 82 | -Wl,-rpath=\$$ORIGIN/lib 83 | 84 | # Intermediate files. 85 | OBJ_FILES=$(SOURCES:%.cc=$(OBJ_DIR)/%.o) 86 | DEPENDENCY_FILES=$(OBJ_FILES:%.o=%.d) 87 | 88 | # Targets 89 | 90 | .PHONY: all 91 | all: $(BIN_OUT) bundle 92 | 93 | # Add the plugin targets, and their associated settings. 94 | include $(FLUTTER_MANAGED_DIR)/generated_plugins.mk 95 | EXTRA_BUNDLED_LIBRARIES+=$(PLUGIN_LIBRARIES) 96 | EXTRA_LDFLAGS+=$(PLUGIN_LDFLAGS) 97 | EXTRA_CPPFLAGS+=$(PLUGIN_CPPFLAGS) 98 | 99 | # This is a phony target because the flutter tool cannot describe 100 | # its inputs and outputs yet. 101 | .PHONY: sync 102 | sync: $(FLUTTER_CONFIG_FILE) 103 | $(LINUX_BUILD) linux-x64 $(BUILD) 104 | 105 | .PHONY: bundle 106 | bundle: $(ICU_DATA_OUT) $(ALL_LIBS_OUT) bundleflutterassets 107 | 108 | $(BIN_OUT): $(OBJ_FILES) $(ALL_LIBS_OUT) 109 | mkdir -p $(@D) 110 | $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OBJ_FILES) $(LDFLAGS) -o $@ 111 | 112 | $(WRAPPER_SOURCES) $(FLUTTER_LIB) $(ICU_DATA_SOURCE) $(FLUTTER_ASSETS_SOURCE) \ 113 | $(PLUGIN_TARGETS): | sync 114 | 115 | # Plugin library bundling pattern. 116 | $(BUNDLE_LIB_DIR)/%: $(OUT_DIR)/% 117 | mkdir -p $(BUNDLE_LIB_DIR) 118 | cp $< $@ 119 | 120 | $(FLUTTER_LIB_OUT): $(FLUTTER_LIB) 121 | mkdir -p $(@D) 122 | cp $< $@ 123 | 124 | $(ICU_DATA_OUT): $(ICU_DATA_SOURCE) 125 | mkdir -p $(@D) 126 | cp $< $@ 127 | 128 | -include $(DEPENDENCY_FILES) 129 | 130 | $(OBJ_DIR)/%.o : %.cc | sync 131 | mkdir -p $(@D) 132 | $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MMD -c $< -o $@ 133 | 134 | # Fully re-copy the assets directory on each build to avoid having to keep a 135 | # comprehensive list of all asset files here, which would be fragile to changes 136 | # in other files (e.g., adding a new font to pubspec.yaml). 137 | .PHONY: bundleflutterassets 138 | bundleflutterassets: $(FLUTTER_ASSETS_SOURCE) 139 | mkdir -p $(BUNDLE_DATA_DIR) 140 | rsync -rpu --delete $(FLUTTER_ASSETS_SOURCE) $(BUNDLE_DATA_DIR) 141 | 142 | .PHONY: clean 143 | clean: 144 | rm -rf $(OUT_DIR); \ 145 | cd $(FLUTTER_APP_DIR); \ 146 | $(FLUTTER_BIN) clean 147 | -------------------------------------------------------------------------------- /example/linux/app_configuration.mk: -------------------------------------------------------------------------------- 1 | # This file contains variables that applications are likely to need to 2 | # change, to isolate them from the main Makefile where the build rules are still 3 | # in flux. This should simplify re-creating the runner while preserving local 4 | # changes. 5 | 6 | # Executable name. 7 | BINARY_NAME=responsive_table_example 8 | # Any extra source files to build. 9 | EXTRA_SOURCES= 10 | # Paths of any additional libraries to be bundled in the output directory. 11 | EXTRA_BUNDLED_LIBRARIES= 12 | # Extra flags (e.g., for library dependencies). 13 | SYSTEM_LIBRARIES= 14 | EXTRA_CXXFLAGS= 15 | EXTRA_CPPFLAGS= 16 | EXTRA_LDFLAGS= -------------------------------------------------------------------------------- /example/linux/flutter/.template_version: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /example/linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | 11 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 12 | # which isn't available in 3.10. 13 | function(list_prepend LIST_NAME PREFIX) 14 | set(NEW_LIST "") 15 | foreach(element ${${LIST_NAME}}) 16 | list(APPEND NEW_LIST "${PREFIX}${element}") 17 | endforeach(element) 18 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 19 | endfunction() 20 | 21 | # === Flutter Library === 22 | # System-level dependencies. 23 | find_package(PkgConfig REQUIRED) 24 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 25 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 26 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 27 | 28 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 29 | 30 | # Published to parent scope for install step. 31 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 32 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 33 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 34 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 35 | 36 | list(APPEND FLUTTER_LIBRARY_HEADERS 37 | "fl_basic_message_channel.h" 38 | "fl_binary_codec.h" 39 | "fl_binary_messenger.h" 40 | "fl_dart_project.h" 41 | "fl_engine.h" 42 | "fl_json_message_codec.h" 43 | "fl_json_method_codec.h" 44 | "fl_message_codec.h" 45 | "fl_method_call.h" 46 | "fl_method_channel.h" 47 | "fl_method_codec.h" 48 | "fl_method_response.h" 49 | "fl_plugin_registrar.h" 50 | "fl_plugin_registry.h" 51 | "fl_standard_message_codec.h" 52 | "fl_standard_method_codec.h" 53 | "fl_string_codec.h" 54 | "fl_value.h" 55 | "fl_view.h" 56 | "flutter_linux.h" 57 | ) 58 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 59 | add_library(flutter INTERFACE) 60 | target_include_directories(flutter INTERFACE 61 | "${EPHEMERAL_DIR}" 62 | ) 63 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 64 | target_link_libraries(flutter INTERFACE 65 | PkgConfig::GTK 66 | PkgConfig::GLIB 67 | PkgConfig::GIO 68 | ) 69 | add_dependencies(flutter flutter_assemble) 70 | 71 | # === Flutter tool backend === 72 | # _phony_ is a non-existent file to force this command to run every time, 73 | # since currently there's no way to get a full input/output list from the 74 | # flutter tool. 75 | add_custom_command( 76 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 77 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 78 | COMMAND ${CMAKE_COMMAND} -E env 79 | ${FLUTTER_TOOL_ENVIRONMENT} 80 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 81 | linux-x64 ${CMAKE_BUILD_TYPE} 82 | ) 83 | add_custom_target(flutter_assemble DEPENDS 84 | "${FLUTTER_LIBRARY}" 85 | ${FLUTTER_LIBRARY_HEADERS} 86 | ) 87 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #include "generated_plugin_registrant.h" 6 | 7 | #include 8 | 9 | void RegisterPlugins(flutter::PluginRegistry* registry) { 10 | ResponsiveTablePluginRegisterWithRegistrar( 11 | registry->GetRegistrarForPlugin("ResponsiveTablePlugin")); 12 | } 13 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 6 | #define GENERATED_PLUGIN_REGISTRANT_ 7 | 8 | #include 9 | 10 | // Registers Flutter plugins. 11 | void RegisterPlugins(flutter::PluginRegistry* registry); 12 | 13 | #endif // GENERATED_PLUGIN_REGISTRANT_ 14 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugins.mk: -------------------------------------------------------------------------------- 1 | # Plugins to include in the build. 2 | GENERATED_PLUGINS=\ 3 | responsive_table \ 4 | 5 | GENERATED_PLUGINS_DIR=flutter/ephemeral/.plugin_symlinks 6 | # A plugin library name plugin name with _plugin appended. 7 | GENERATED_PLUGIN_LIB_NAMES=$(foreach plugin,$(GENERATED_PLUGINS),$(plugin)_plugin) 8 | 9 | # Variables for use in the enclosing Makefile. Changes to these names are 10 | # breaking changes. 11 | PLUGIN_TARGETS=$(GENERATED_PLUGINS) 12 | PLUGIN_LIBRARIES=$(foreach plugin,$(GENERATED_PLUGIN_LIB_NAMES),\ 13 | $(OUT_DIR)/lib$(plugin).so) 14 | PLUGIN_LDFLAGS=$(patsubst %,-l%,$(GENERATED_PLUGIN_LIB_NAMES)) 15 | PLUGIN_CPPFLAGS=$(foreach plugin,$(GENERATED_PLUGINS),\ 16 | -I$(GENERATED_PLUGINS_DIR)/$(plugin)/linux) 17 | 18 | # Targets 19 | 20 | # Implicit rules don't match phony targets, so list plugin builds explicitly. 21 | $(OUT_DIR)/libresponsive_table_plugin.so: | responsive_table 22 | 23 | .PHONY: $(GENERATED_PLUGINS) 24 | $(GENERATED_PLUGINS): 25 | make -C $(GENERATED_PLUGINS_DIR)/$@/linux \ 26 | OUT_DIR=$(OUT_DIR) \ 27 | FLUTTER_EPHEMERAL_DIR="$(abspath flutter/ephemeral)" 28 | -------------------------------------------------------------------------------- /example/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "flutter/generated_plugin_registrant.h" 11 | #include "window_configuration.h" 12 | 13 | namespace { 14 | 15 | // Returns the path of the directory containing this executable, or an empty 16 | // string if the directory cannot be found. 17 | std::string GetExecutableDirectory() { 18 | char buffer[PATH_MAX + 1]; 19 | ssize_t length = readlink("/proc/self/exe", buffer, sizeof(buffer)); 20 | if (length > PATH_MAX) { 21 | std::cerr << "Couldn't locate executable" << std::endl; 22 | return ""; 23 | } 24 | std::string executable_path(buffer, length); 25 | size_t last_separator_position = executable_path.find_last_of('/'); 26 | if (last_separator_position == std::string::npos) { 27 | std::cerr << "Unabled to find parent directory of " << executable_path 28 | << std::endl; 29 | return ""; 30 | } 31 | return executable_path.substr(0, last_separator_position); 32 | } 33 | 34 | } // namespace 35 | 36 | int main(int argc, char **argv) { 37 | // Resources are located relative to the executable. 38 | std::string base_directory = GetExecutableDirectory(); 39 | if (base_directory.empty()) { 40 | base_directory = "."; 41 | } 42 | std::string data_directory = base_directory + "/data"; 43 | std::string assets_path = data_directory + "/flutter_assets"; 44 | std::string icu_data_path = data_directory + "/icudtl.dat"; 45 | 46 | // Arguments for the Flutter Engine. 47 | std::vector arguments; 48 | 49 | flutter::FlutterWindowController flutter_controller(icu_data_path); 50 | flutter::WindowProperties window_properties = {}; 51 | window_properties.title = kFlutterWindowTitle; 52 | window_properties.width = kFlutterWindowWidth; 53 | window_properties.height = kFlutterWindowHeight; 54 | 55 | // Start the engine. 56 | if (!flutter_controller.CreateWindow(window_properties, assets_path, 57 | arguments)) { 58 | return EXIT_FAILURE; 59 | } 60 | RegisterPlugins(&flutter_controller); 61 | 62 | // Run until the window is closed. 63 | while (flutter_controller.RunEventLoopWithTimeout( 64 | std::chrono::milliseconds::max())) { 65 | } 66 | return EXIT_SUCCESS; 67 | } 68 | -------------------------------------------------------------------------------- /example/linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | struct _MyApplication { 8 | GtkApplication parent_instance; 9 | }; 10 | 11 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 12 | 13 | // Implements GApplication::activate. 14 | static void my_application_activate(GApplication* application) { 15 | GtkWindow* window = 16 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 17 | GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 18 | gtk_widget_show(GTK_WIDGET(header_bar)); 19 | gtk_header_bar_set_title(header_bar, "flutter_responsive_table_example"); 20 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 21 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 22 | gtk_window_set_default_size(window, 1280, 720); 23 | gtk_widget_show(GTK_WIDGET(window)); 24 | 25 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 26 | 27 | FlView* view = fl_view_new(project); 28 | gtk_widget_show(GTK_WIDGET(view)); 29 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 30 | 31 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 32 | 33 | gtk_widget_grab_focus(GTK_WIDGET(view)); 34 | } 35 | 36 | static void my_application_class_init(MyApplicationClass* klass) { 37 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 38 | } 39 | 40 | static void my_application_init(MyApplication* self) {} 41 | 42 | MyApplication* my_application_new() { 43 | return MY_APPLICATION(g_object_new(my_application_get_type(), nullptr)); 44 | } 45 | -------------------------------------------------------------------------------- /example/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /example/linux/window_configuration.cc: -------------------------------------------------------------------------------- 1 | #include "window_configuration.h" 2 | 3 | const char *kFlutterWindowTitle = "responsive_table_example"; 4 | const unsigned int kFlutterWindowWidth = 800; 5 | const unsigned int kFlutterWindowHeight = 600; 6 | -------------------------------------------------------------------------------- /example/linux/window_configuration.h: -------------------------------------------------------------------------------- 1 | #ifndef WINDOW_CONFIGURATION_ 2 | #define WINDOW_CONFIGURATION_ 3 | 4 | // This is a temporary approach to isolate common customizations from main.cpp, 5 | // where the APIs are still in flux. This should simplify re-creating the 6 | // runner while preserving local changes. 7 | // 8 | // Longer term there should be simpler configuration options for common 9 | // customizations like this, without requiring native code changes. 10 | 11 | extern const char *kFlutterWindowTitle; 12 | extern const unsigned int kFlutterWindowWidth; 13 | extern const unsigned int kFlutterWindowHeight; 14 | 15 | #endif // WINDOW_CONFIGURATION_ 16 | -------------------------------------------------------------------------------- /example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | 9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 10 | } 11 | -------------------------------------------------------------------------------- /example/macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.11' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | adaptivex: 5 | dependency: transitive 6 | description: 7 | name: adaptivex 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.0.1+2" 11 | async: 12 | dependency: transitive 13 | description: 14 | name: async 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.8.2" 18 | boolean_selector: 19 | dependency: transitive 20 | description: 21 | name: boolean_selector 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.1.0" 25 | characters: 26 | dependency: transitive 27 | description: 28 | name: characters 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.2.0" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.3.1" 39 | clock: 40 | dependency: transitive 41 | description: 42 | name: clock 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.0" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.15.0" 53 | cupertino_icons: 54 | dependency: "direct main" 55 | description: 56 | name: cupertino_icons 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "0.1.3" 60 | fake_async: 61 | dependency: transitive 62 | description: 63 | name: fake_async 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.2.0" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | matcher: 78 | dependency: transitive 79 | description: 80 | name: matcher 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "0.12.11" 84 | material_color_utilities: 85 | dependency: transitive 86 | description: 87 | name: material_color_utilities 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.1.3" 91 | meta: 92 | dependency: transitive 93 | description: 94 | name: meta 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "1.7.0" 98 | path: 99 | dependency: transitive 100 | description: 101 | name: path 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.8.0" 105 | responsive_table: 106 | dependency: "direct main" 107 | description: 108 | path: ".." 109 | relative: true 110 | source: path 111 | version: "0.2.0+2" 112 | sky_engine: 113 | dependency: transitive 114 | description: flutter 115 | source: sdk 116 | version: "0.0.99" 117 | source_span: 118 | dependency: transitive 119 | description: 120 | name: source_span 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "1.8.1" 124 | stack_trace: 125 | dependency: transitive 126 | description: 127 | name: stack_trace 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.10.0" 131 | stream_channel: 132 | dependency: transitive 133 | description: 134 | name: stream_channel 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "2.1.0" 138 | string_scanner: 139 | dependency: transitive 140 | description: 141 | name: string_scanner 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.1.0" 145 | term_glyph: 146 | dependency: transitive 147 | description: 148 | name: term_glyph 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.2.0" 152 | test_api: 153 | dependency: transitive 154 | description: 155 | name: test_api 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "0.4.8" 159 | typed_data: 160 | dependency: transitive 161 | description: 162 | name: typed_data 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.3.0" 166 | vector_math: 167 | dependency: transitive 168 | description: 169 | name: vector_math 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "2.1.1" 173 | sdks: 174 | dart: ">=2.15.1 <3.0.0" 175 | flutter: ">=1.17.0" 176 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: responsive_table_example 2 | description: Demonstrates how to use the responsive_table plugin. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | environment: 9 | sdk: '>=2.12.0 <3.0.0' 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | responsive_table: 16 | # When depending on this package from a real application you should use: 17 | # responsive_table: ^x.y.z 18 | # See https://dart.dev/tools/pub/dependencies#version-constraints 19 | # The example app is bundled with the plugin so we use a path dependency on 20 | # the parent directory to use the current plugin's version. 21 | path: ../ 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^0.1.3 26 | 27 | dev_dependencies: 28 | flutter_test: 29 | sdk: flutter 30 | 31 | # For information on the generic Dart part of this file, see the 32 | # following page: https://dart.dev/tools/pub/pubspec 33 | 34 | # The following section is specific to Flutter. 35 | flutter: 36 | 37 | # The following line ensures that the Material Icons font is 38 | # included with your application, so that you can use the icons in 39 | # the material Icons class. 40 | uses-material-design: true 41 | 42 | # To add assets to your application, add an assets section, like this: 43 | # assets: 44 | # - images/a_dot_burr.jpeg 45 | # - images/a_dot_ham.jpeg 46 | 47 | # An image asset can refer to one or more resolution-specific "variants", see 48 | # https://flutter.dev/assets-and-images/#resolution-aware. 49 | 50 | # For details regarding adding assets from package dependencies, see 51 | # https://flutter.dev/assets-and-images/#from-packages 52 | 53 | # To add custom fonts to your application, add a fonts section here, 54 | # in this "flutter" section. Each entry in this list should have a 55 | # "family" key with the font family name, and a "fonts" key with a 56 | # list giving the asset and other descriptors for the font. For 57 | # example: 58 | # fonts: 59 | # - family: Schyler 60 | # fonts: 61 | # - asset: fonts/Schyler-Regular.ttf 62 | # - asset: fonts/Schyler-Italic.ttf 63 | # style: italic 64 | # - family: Trajan Pro 65 | # fonts: 66 | # - asset: fonts/TrajanPro.ttf 67 | # - asset: fonts/TrajanPro_Bold.ttf 68 | # weight: 700 69 | # 70 | # For details regarding fonts from package dependencies, 71 | # see https://flutter.dev/custom-fonts/#from-packages 72 | -------------------------------------------------------------------------------- /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:responsive_table_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => 22 | widget is Text && widget.data!.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/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 | 30 | 31 | 32 | example 33 | 34 | 35 | 36 | 39 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "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 | -------------------------------------------------------------------------------- /example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /example/windows/AppConfiguration.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | responsive_table_example 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(example LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "example") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 12 | if(IS_MULTICONFIG) 13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 14 | CACHE STRING "" FORCE) 15 | else() 16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 17 | set(CMAKE_BUILD_TYPE "Debug" CACHE 18 | STRING "Flutter build mode" FORCE) 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 20 | "Debug" "Profile" "Release") 21 | endif() 22 | endif() 23 | 24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 28 | 29 | # Use Unicode for all projects. 30 | add_definitions(-DUNICODE -D_UNICODE) 31 | 32 | # Compilation settings that should be applied to most targets. 33 | function(APPLY_STANDARD_SETTINGS TARGET) 34 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 36 | target_compile_options(${TARGET} PRIVATE /EHsc) 37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 39 | endfunction() 40 | 41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 42 | 43 | # Flutter library and tool build rules. 44 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 45 | 46 | # Application build 47 | add_subdirectory("runner") 48 | 49 | # Generated plugin build rules, which manage building the plugins and adding 50 | # them to the application. 51 | include(flutter/generated_plugins.cmake) 52 | 53 | 54 | # === Installation === 55 | # Support files are copied into place next to the executable, so that it can 56 | # run in place. This is done instead of making a separate bundle (as on Linux) 57 | # so that building and running from within Visual Studio will work. 58 | set(BUILD_BUNDLE_DIR "$") 59 | # Make the "install" step default, as it's required to run. 60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 63 | endif() 64 | 65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 67 | 68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 69 | COMPONENT Runtime) 70 | 71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 72 | COMPONENT Runtime) 73 | 74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 75 | COMPONENT Runtime) 76 | 77 | if(PLUGIN_BUNDLED_LIBRARIES) 78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 80 | COMPONENT Runtime) 81 | endif() 82 | 83 | # Fully re-copy the assets directory on each build to avoid having stale files 84 | # from a previous install. 85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 86 | install(CODE " 87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 88 | " COMPONENT Runtime) 89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 91 | 92 | # Install the AOT library on non-Debug builds only. 93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 94 | CONFIGURATIONS Profile;Release 95 | COMPONENT Runtime) 96 | -------------------------------------------------------------------------------- /example/windows/FlutterBuild.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Profile 10 | x64 11 | 12 | 13 | Release 14 | x64 15 | 16 | 17 | 18 | 15.0 19 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F} 20 | Flutter Build 21 | 10.0 22 | 23 | 24 | 25 | v141 26 | v142 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | "$(ProjectDir)scripts\prepare_dependencies" $(Configuration) 41 | Running Flutter backend build 42 | force_to_run_every_time 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /example/windows/Runner.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29709.97 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Runner", "Runner.vcxproj", "{5A827760-CF8B-408A-99A3-B6C0AD2271E7}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F} = {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Flutter Build", "FlutterBuild.vcxproj", "{6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}" 12 | EndProject 13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Flutter Plugins", "Flutter Plugins", "{5C2E738A-1DD3-445A-AAC8-EEB9648DD07C}" 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|x64 = Debug|x64 18 | Profile|x64 = Profile|x64 19 | Release|x64 = Release|x64 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug|x64.ActiveCfg = Debug|x64 23 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Debug|x64.Build.0 = Debug|x64 24 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Profile|x64.ActiveCfg = Profile|x64 25 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Profile|x64.Build.0 = Profile|x64 26 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release|x64.ActiveCfg = Release|x64 27 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7}.Release|x64.Build.0 = Release|x64 28 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Debug|x64.ActiveCfg = Debug|x64 29 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Debug|x64.Build.0 = Debug|x64 30 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Profile|x64.ActiveCfg = Profile|x64 31 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Profile|x64.Build.0 = Profile|x64 32 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Release|x64.ActiveCfg = Release|x64 33 | {6419BF13-6ECD-4CD2-9E85-E566A1F03F8F}.Release|x64.Build.0 = Release|x64 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | GlobalSection(ExtensibilityGlobals) = postSolution 39 | SolutionGuid = {B8A69CB0-A974-4774-9EBD-1E5EECACD186} 40 | EndGlobalSection 41 | GlobalSection(NestedProjects) = preSolution 42 | EndGlobalSection 43 | EndGlobal -------------------------------------------------------------------------------- /example/windows/Runner.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Profile 10 | x64 11 | 12 | 13 | Release 14 | x64 15 | 16 | 17 | 18 | 15.0 19 | {5A827760-CF8B-408A-99A3-B6C0AD2271E7} 20 | responsive_table_example 21 | 10.0 22 | 23 | 24 | 25 | Application 26 | true 27 | v141 28 | v142 29 | Unicode 30 | 31 | 32 | Application 33 | false 34 | v141 35 | v142 36 | true 37 | Unicode 38 | 39 | 40 | Application 41 | false 42 | v141 43 | v142 44 | true 45 | Unicode 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | $(ProjectDir)..\build\windows\$(Platform)\$(Configuration)\$(ProjectName)\ 73 | $(ProjectDir)..\build\windows\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\ 74 | 75 | 76 | $(ProjectDir)..\build\windows\$(Platform)\$(Configuration)\$(ProjectName)\ 77 | $(ProjectDir)..\build\windows\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\ 78 | 79 | 80 | $(ProjectDir)..\build\windows\$(Platform)\$(Configuration)\$(ProjectName)\ 81 | $(ProjectDir)..\build\windows\intermediates\$(Platform)\$(Configuration)\$(ProjectName)\ 82 | 83 | 84 | 85 | Level4 86 | Disabled 87 | true 88 | true 89 | $(ProjectDir);$(FLUTTER_EPHEMERAL_DIR);$(FLUTTER_EPHEMERAL_DIR)\cpp_client_wrapper\include;%(AdditionalIncludeDirectories) 90 | _MBCS;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) 91 | true 92 | 4100 93 | 94 | 95 | flutter_windows.dll.lib;%(AdditionalDependencies) 96 | $(FLUTTER_EPHEMERAL_DIR);$(OutDir)..\Plugins;%(AdditionalLibraryDirectories) 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | "$(ProjectDir)scripts\bundle_assets_and_deps" "$(FLUTTER_EPHEMERAL_DIR)\" "$(OutputPath)" "$(OutputPath)..\Plugins\" "$(TargetFileName)" 120 | 121 | 122 | Bundling dependencies 123 | Dummy_Run_Always 124 | 125 | 126 | 127 | 128 | 129 | 130 | Level4 131 | MaxSpeed 132 | true 133 | true 134 | true 135 | true 136 | $(ProjectDir);$(FLUTTER_EPHEMERAL_DIR);$(FLUTTER_EPHEMERAL_DIR)\cpp_client_wrapper\include;%(AdditionalIncludeDirectories) 137 | _MBCS;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) 138 | true 139 | 4100 140 | 141 | 142 | true 143 | true 144 | flutter_windows.dll.lib;%(AdditionalDependencies) 145 | $(FLUTTER_EPHEMERAL_DIR);$(OutDir)..\Plugins;%(AdditionalLibraryDirectories) 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | "$(ProjectDir)scripts\bundle_assets_and_deps" "$(FLUTTER_EPHEMERAL_DIR)\" "$(OutputPath)" "$(OutputPath)..\Plugins\" "$(TargetFileName)" 169 | 170 | 171 | Bundling dependencies 172 | Dummy_Run_Always 173 | 174 | 175 | 176 | 177 | 178 | 179 | Level4 180 | MaxSpeed 181 | true 182 | true 183 | true 184 | true 185 | $(ProjectDir);$(FLUTTER_EPHEMERAL_DIR);$(FLUTTER_EPHEMERAL_DIR)\cpp_client_wrapper\include;%(AdditionalIncludeDirectories) 186 | _MBCS;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions) 187 | true 188 | 4100 189 | 190 | 191 | true 192 | true 193 | flutter_windows.dll.lib;%(AdditionalDependencies) 194 | $(FLUTTER_EPHEMERAL_DIR);$(OutDir)..\Plugins;%(AdditionalLibraryDirectories) 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | "$(ProjectDir)scripts\bundle_assets_and_deps" "$(FLUTTER_EPHEMERAL_DIR)\" "$(OutputPath)" "$(OutputPath)..\Plugins\" "$(TargetFileName)" 218 | 219 | 220 | Bundling dependencies 221 | Dummy_Run_Always 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | $(SolutionDir) 259 | 260 | 261 | -------------------------------------------------------------------------------- /example/windows/Runner.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {2761a4b5-57b2-4d50-a677-d20ddc17a7f1} 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files\Client Wrapper 41 | 42 | 43 | Source Files\Client Wrapper 44 | 45 | 46 | Source Files\Client Wrapper 47 | 48 | 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | Header Files 61 | 62 | 63 | Header Files 64 | 65 | 66 | Header Files 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | Resource Files 75 | 76 | 77 | 78 | 79 | Resource Files 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /example/windows/flutter/.template_version: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /example/windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 11 | 12 | # === Flutter Library === 13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 14 | 15 | # Published to parent scope for install step. 16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 20 | 21 | list(APPEND FLUTTER_LIBRARY_HEADERS 22 | "flutter_export.h" 23 | "flutter_windows.h" 24 | "flutter_messenger.h" 25 | "flutter_plugin_registrar.h" 26 | "flutter_texture_registrar.h" 27 | ) 28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 29 | add_library(flutter INTERFACE) 30 | target_include_directories(flutter INTERFACE 31 | "${EPHEMERAL_DIR}" 32 | ) 33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 34 | add_dependencies(flutter flutter_assemble) 35 | 36 | # === Wrapper === 37 | list(APPEND CPP_WRAPPER_SOURCES_CORE 38 | "core_implementations.cc" 39 | "standard_codec.cc" 40 | ) 41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 43 | "plugin_registrar.cc" 44 | ) 45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 46 | list(APPEND CPP_WRAPPER_SOURCES_APP 47 | "flutter_engine.cc" 48 | "flutter_view_controller.cc" 49 | ) 50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 51 | 52 | # Wrapper sources needed for a plugin. 53 | add_library(flutter_wrapper_plugin STATIC 54 | ${CPP_WRAPPER_SOURCES_CORE} 55 | ${CPP_WRAPPER_SOURCES_PLUGIN} 56 | ) 57 | apply_standard_settings(flutter_wrapper_plugin) 58 | set_target_properties(flutter_wrapper_plugin PROPERTIES 59 | POSITION_INDEPENDENT_CODE ON) 60 | set_target_properties(flutter_wrapper_plugin PROPERTIES 61 | CXX_VISIBILITY_PRESET hidden) 62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 63 | target_include_directories(flutter_wrapper_plugin PUBLIC 64 | "${WRAPPER_ROOT}/include" 65 | ) 66 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 67 | 68 | # Wrapper sources needed for the runner. 69 | add_library(flutter_wrapper_app STATIC 70 | ${CPP_WRAPPER_SOURCES_CORE} 71 | ${CPP_WRAPPER_SOURCES_APP} 72 | ) 73 | apply_standard_settings(flutter_wrapper_app) 74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 75 | target_include_directories(flutter_wrapper_app PUBLIC 76 | "${WRAPPER_ROOT}/include" 77 | ) 78 | add_dependencies(flutter_wrapper_app flutter_assemble) 79 | 80 | # === Flutter tool backend === 81 | # _phony_ is a non-existent file to force this command to run every time, 82 | # since currently there's no way to get a full input/output list from the 83 | # flutter tool. 84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 86 | add_custom_command( 87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 89 | ${CPP_WRAPPER_SOURCES_APP} 90 | ${PHONY_OUTPUT} 91 | COMMAND ${CMAKE_COMMAND} -E env 92 | ${FLUTTER_TOOL_ENVIRONMENT} 93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 94 | windows-x64 $ 95 | VERBATIM 96 | ) 97 | add_custom_target(flutter_assemble DEPENDS 98 | "${FLUTTER_LIBRARY}" 99 | ${FLUTTER_LIBRARY_HEADERS} 100 | ${CPP_WRAPPER_SOURCES_CORE} 101 | ${CPP_WRAPPER_SOURCES_PLUGIN} 102 | ${CPP_WRAPPER_SOURCES_APP} 103 | ) 104 | -------------------------------------------------------------------------------- /example/windows/flutter/GeneratedPlugins.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | set(PLUGIN_BUNDLED_LIBRARIES) 9 | 10 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 15 | endforeach(plugin) 16 | -------------------------------------------------------------------------------- /example/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "utils.cpp" 8 | "win32_window.cpp" 9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 10 | "Runner.rc" 11 | "runner.exe.manifest" 12 | ) 13 | apply_standard_settings(${BINARY_NAME}) 14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 17 | add_dependencies(${BINARY_NAME} flutter_assemble) 18 | -------------------------------------------------------------------------------- /example/windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | #endif // English (United States) resources 58 | ///////////////////////////////////////////////////////////////////////////// 59 | 60 | 61 | 62 | #ifndef APSTUDIO_INVOKED 63 | ///////////////////////////////////////////////////////////////////////////// 64 | // 65 | // Generated from the TEXTINCLUDE 3 resource. 66 | // 67 | 68 | 69 | ///////////////////////////////////////////////////////////////////////////// 70 | #endif // not APSTUDIO_INVOKED 71 | -------------------------------------------------------------------------------- /example/windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include "flutter/generated_plugin_registrant.h" 4 | 5 | FlutterWindow::FlutterWindow(RunLoop* run_loop, 6 | const flutter::DartProject& project) 7 | : run_loop_(run_loop), project_(project) {} 8 | 9 | FlutterWindow::~FlutterWindow() {} 10 | 11 | void FlutterWindow::OnCreate() { 12 | Win32Window::OnCreate(); 13 | 14 | // The size here is arbitrary since SetChildContent will resize it. 15 | flutter_controller_ = 16 | std::make_unique(100, 100, project_); 17 | RegisterPlugins(flutter_controller_.get()); 18 | run_loop_->RegisterFlutterInstance(flutter_controller_.get()); 19 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 20 | } 21 | 22 | void FlutterWindow::OnDestroy() { 23 | if (flutter_controller_) { 24 | run_loop_->UnregisterFlutterInstance(flutter_controller_.get()); 25 | flutter_controller_ = nullptr; 26 | } 27 | 28 | Win32Window::OnDestroy(); 29 | } 30 | -------------------------------------------------------------------------------- /example/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_WINDOW_H_ 2 | #define FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "run_loop.h" 8 | #include "win32_window.h" 9 | 10 | #include 11 | 12 | // A window that does nothing but host a Flutter view. 13 | class FlutterWindow : public Win32Window { 14 | public: 15 | // Creates a new FlutterWindow driven by the |run_loop|, hosting a 16 | // Flutter view running |project|. 17 | explicit FlutterWindow(RunLoop* run_loop, 18 | const flutter::DartProject& project); 19 | virtual ~FlutterWindow(); 20 | 21 | protected: 22 | // Win32Window: 23 | void OnCreate() override; 24 | void OnDestroy() override; 25 | 26 | private: 27 | // The run loop driving events for this window. 28 | RunLoop* run_loop_; 29 | 30 | // The project to run. 31 | flutter::DartProject project_; 32 | 33 | // The Flutter instance hosted by this window. 34 | std::unique_ptr flutter_controller_; 35 | }; 36 | 37 | #endif // FLUTTER_WINDOW_H_ 38 | -------------------------------------------------------------------------------- /example/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "run_loop.h" 7 | #include "window_configuration.h" 8 | 9 | int APIENTRY wWinMain(_In_ HINSTANCE instance, 10 | _In_opt_ HINSTANCE prev, 11 | _In_ wchar_t* command_line, 12 | _In_ int show_command) { 13 | // Attach to console when present (e.g., 'flutter run') or create a 14 | // new console when running with a debugger. 15 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 16 | ::AllocConsole(); 17 | } 18 | 19 | // Initialize COM, so that it is available for use in the library and/or plugins. 20 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 21 | 22 | RunLoop run_loop; 23 | 24 | flutter::DartProject project(L"data"); 25 | FlutterWindow window(&run_loop, project); 26 | Win32Window::Point origin(kFlutterWindowOriginX, kFlutterWindowOriginY); 27 | Win32Window::Size size(kFlutterWindowWidth, kFlutterWindowHeight); 28 | if (!window.CreateAndShow(kFlutterWindowTitle, origin, size)) { 29 | return EXIT_FAILURE; 30 | } 31 | window.SetQuitOnClose(true); 32 | 33 | run_loop.Run(); 34 | 35 | ::CoUninitialize(); 36 | return EXIT_SUCCESS; 37 | } 38 | -------------------------------------------------------------------------------- /example/windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /example/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /example/windows/runner/run_loop.cpp: -------------------------------------------------------------------------------- 1 | #include "run_loop.h" 2 | 3 | #include 4 | // Don't stomp std::min/std::max 5 | #undef max 6 | #undef min 7 | 8 | #include 9 | 10 | RunLoop::RunLoop() {} 11 | 12 | RunLoop::~RunLoop() {} 13 | 14 | void RunLoop::Run() { 15 | bool keep_running = true; 16 | TimePoint next_flutter_event_time = TimePoint::clock::now(); 17 | while (keep_running) { 18 | std::chrono::nanoseconds wait_duration = 19 | std::max(std::chrono::nanoseconds(0), 20 | next_flutter_event_time - TimePoint::clock::now()); 21 | ::MsgWaitForMultipleObjects( 22 | 0, nullptr, FALSE, static_cast(wait_duration.count() / 1000), 23 | QS_ALLINPUT); 24 | bool processed_events = false; 25 | MSG message; 26 | // All pending Windows messages must be processed; MsgWaitForMultipleObjects 27 | // won't return again for items left in the queue after PeekMessage. 28 | while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { 29 | processed_events = true; 30 | if (message.message == WM_QUIT) { 31 | keep_running = false; 32 | break; 33 | } 34 | ::TranslateMessage(&message); 35 | ::DispatchMessage(&message); 36 | // Allow Flutter to process messages each time a Windows message is 37 | // processed, to prevent starvation. 38 | next_flutter_event_time = 39 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 40 | } 41 | // If the PeekMessage loop didn't run, process Flutter messages. 42 | if (!processed_events) { 43 | next_flutter_event_time = 44 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 45 | } 46 | } 47 | } 48 | 49 | void RunLoop::RegisterFlutterInstance( 50 | flutter::FlutterViewController* flutter_instance) { 51 | flutter_instances_.insert(flutter_instance); 52 | } 53 | 54 | void RunLoop::UnregisterFlutterInstance( 55 | flutter::FlutterViewController* flutter_instance) { 56 | flutter_instances_.erase(flutter_instance); 57 | } 58 | 59 | RunLoop::TimePoint RunLoop::ProcessFlutterMessages() { 60 | TimePoint next_event_time = TimePoint::max(); 61 | for (auto flutter_controller : flutter_instances_) { 62 | std::chrono::nanoseconds wait_duration = 63 | flutter_controller->ProcessMessages(); 64 | if (wait_duration != std::chrono::nanoseconds::max()) { 65 | next_event_time = 66 | std::min(next_event_time, TimePoint::clock::now() + wait_duration); 67 | } 68 | } 69 | return next_event_time; 70 | } 71 | -------------------------------------------------------------------------------- /example/windows/runner/run_loop.h: -------------------------------------------------------------------------------- 1 | #ifndef RUN_LOOP_H_ 2 | #define RUN_LOOP_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | // A runloop that will service events for Flutter instances as well 10 | // as native messages. 11 | class RunLoop { 12 | public: 13 | RunLoop(); 14 | ~RunLoop(); 15 | 16 | // Prevent copying 17 | RunLoop(RunLoop const&) = delete; 18 | RunLoop& operator=(RunLoop const&) = delete; 19 | 20 | // Runs the run loop until the application quits. 21 | void Run(); 22 | 23 | // Registers the given Flutter instance for event servicing. 24 | void RegisterFlutterInstance( 25 | flutter::FlutterViewController* flutter_instance); 26 | 27 | // Unregisters the given Flutter instance from event servicing. 28 | void UnregisterFlutterInstance( 29 | flutter::FlutterViewController* flutter_instance); 30 | 31 | private: 32 | using TimePoint = std::chrono::steady_clock::time_point; 33 | 34 | // Processes all currently pending messages for registered Flutter instances. 35 | TimePoint ProcessFlutterMessages(); 36 | 37 | std::set flutter_instances_; 38 | }; 39 | 40 | #endif // RUN_LOOP_H_ 41 | -------------------------------------------------------------------------------- /example/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /example/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /example/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /example/windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | 5 | #include "resource.h" 6 | 7 | namespace { 8 | 9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 10 | 11 | // The number of Win32Window objects that currently exist. 12 | static int g_active_window_count = 0; 13 | 14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 15 | 16 | // Scale helper to convert logical scaler values to physical using passed in 17 | // scale factor 18 | int Scale(int source, double scale_factor) { 19 | return static_cast(source * scale_factor); 20 | } 21 | 22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 23 | // This API is only needed for PerMonitor V1 awareness mode. 24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 25 | HMODULE user32_module = LoadLibraryA("User32.dll"); 26 | if (!user32_module) { 27 | return; 28 | } 29 | auto enable_non_client_dpi_scaling = 30 | reinterpret_cast( 31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 32 | if (enable_non_client_dpi_scaling != nullptr) { 33 | enable_non_client_dpi_scaling(hwnd); 34 | FreeLibrary(user32_module); 35 | } 36 | } 37 | 38 | } // namespace 39 | 40 | // Manages the Win32Window's window class registration. 41 | class WindowClassRegistrar { 42 | public: 43 | ~WindowClassRegistrar() = default; 44 | 45 | // Returns the singleton registar instance. 46 | static WindowClassRegistrar* GetInstance() { 47 | if (!instance_) { 48 | instance_ = new WindowClassRegistrar(); 49 | } 50 | return instance_; 51 | } 52 | 53 | // Returns the name of the window class, registering the class if it hasn't 54 | // previously been registered. 55 | const wchar_t* GetWindowClass(); 56 | 57 | // Unregisters the window class. Should only be called if there are no 58 | // instances of the window. 59 | void UnregisterWindowClass(); 60 | 61 | private: 62 | WindowClassRegistrar() = default; 63 | 64 | static WindowClassRegistrar* instance_; 65 | 66 | bool class_registered_ = false; 67 | }; 68 | 69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 70 | 71 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 72 | if (!class_registered_) { 73 | WNDCLASS window_class{}; 74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 75 | window_class.lpszClassName = kWindowClassName; 76 | window_class.style = CS_HREDRAW | CS_VREDRAW; 77 | window_class.cbClsExtra = 0; 78 | window_class.cbWndExtra = 0; 79 | window_class.hInstance = GetModuleHandle(nullptr); 80 | window_class.hIcon = 81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 82 | window_class.hbrBackground = 0; 83 | window_class.lpszMenuName = nullptr; 84 | window_class.lpfnWndProc = Win32Window::WndProc; 85 | RegisterClass(&window_class); 86 | class_registered_ = true; 87 | } 88 | return kWindowClassName; 89 | } 90 | 91 | void WindowClassRegistrar::UnregisterWindowClass() { 92 | UnregisterClass(kWindowClassName, nullptr); 93 | class_registered_ = false; 94 | } 95 | 96 | Win32Window::Win32Window() { 97 | ++g_active_window_count; 98 | } 99 | 100 | Win32Window::~Win32Window() { 101 | --g_active_window_count; 102 | Destroy(); 103 | } 104 | 105 | bool Win32Window::CreateAndShow(const std::wstring& title, 106 | const Point& origin, 107 | const Size& size) { 108 | Destroy(); 109 | 110 | const wchar_t* window_class = 111 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 112 | 113 | const POINT target_point = {static_cast(origin.x), 114 | static_cast(origin.y)}; 115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 117 | double scale_factor = dpi / 96.0; 118 | 119 | HWND window = CreateWindow( 120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 123 | nullptr, nullptr, GetModuleHandle(nullptr), this); 124 | 125 | OnCreate(); 126 | 127 | return window != nullptr; 128 | } 129 | 130 | // static 131 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 132 | UINT const message, 133 | WPARAM const wparam, 134 | LPARAM const lparam) noexcept { 135 | if (message == WM_NCCREATE) { 136 | auto window_struct = reinterpret_cast(lparam); 137 | SetWindowLongPtr(window, GWLP_USERDATA, 138 | reinterpret_cast(window_struct->lpCreateParams)); 139 | 140 | auto that = static_cast(window_struct->lpCreateParams); 141 | EnableFullDpiSupportIfAvailable(window); 142 | that->window_handle_ = window; 143 | } else if (Win32Window* that = GetThisFromHandle(window)) { 144 | return that->MessageHandler(window, message, wparam, lparam); 145 | } 146 | 147 | return DefWindowProc(window, message, wparam, lparam); 148 | } 149 | 150 | LRESULT 151 | Win32Window::MessageHandler(HWND hwnd, 152 | UINT const message, 153 | WPARAM const wparam, 154 | LPARAM const lparam) noexcept { 155 | auto window = 156 | reinterpret_cast(GetWindowLongPtr(hwnd, GWLP_USERDATA)); 157 | 158 | if (window == nullptr) { 159 | return 0; 160 | } 161 | 162 | switch (message) { 163 | case WM_DESTROY: 164 | window_handle_ = nullptr; 165 | Destroy(); 166 | if (quit_on_close_) { 167 | PostQuitMessage(0); 168 | } 169 | return 0; 170 | 171 | case WM_DPICHANGED: { 172 | auto newRectSize = reinterpret_cast(lparam); 173 | LONG newWidth = newRectSize->right - newRectSize->left; 174 | LONG newHeight = newRectSize->bottom - newRectSize->top; 175 | 176 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 177 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 178 | 179 | return 0; 180 | } 181 | case WM_SIZE: 182 | RECT rect; 183 | GetClientRect(hwnd, &rect); 184 | if (child_content_ != nullptr) { 185 | // Size and position the child window. 186 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 187 | rect.bottom - rect.top, TRUE); 188 | } 189 | return 0; 190 | 191 | case WM_ACTIVATE: 192 | if (child_content_ != nullptr) { 193 | SetFocus(child_content_); 194 | } 195 | return 0; 196 | 197 | // Messages that are directly forwarded to embedding. 198 | case WM_FONTCHANGE: 199 | SendMessage(child_content_, WM_FONTCHANGE, NULL, NULL); 200 | return 0; 201 | } 202 | 203 | return DefWindowProc(window_handle_, message, wparam, lparam); 204 | } 205 | 206 | void Win32Window::Destroy() { 207 | OnDestroy(); 208 | 209 | if (window_handle_) { 210 | DestroyWindow(window_handle_); 211 | window_handle_ = nullptr; 212 | } 213 | if (g_active_window_count == 0) { 214 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 215 | } 216 | } 217 | 218 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 219 | return reinterpret_cast( 220 | GetWindowLongPtr(window, GWLP_USERDATA)); 221 | } 222 | 223 | void Win32Window::SetChildContent(HWND content) { 224 | child_content_ = content; 225 | SetParent(content, window_handle_); 226 | RECT frame; 227 | GetClientRect(window_handle_, &frame); 228 | 229 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 230 | frame.bottom - frame.top, true); 231 | 232 | SetFocus(child_content_); 233 | } 234 | 235 | HWND Win32Window::GetHandle() { 236 | return window_handle_; 237 | } 238 | 239 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 240 | quit_on_close_ = quit_on_close; 241 | } 242 | 243 | void Win32Window::OnCreate() { 244 | // No-op; provided for subclasses. 245 | } 246 | 247 | void Win32Window::OnDestroy() { 248 | // No-op; provided for subclasses. 249 | } 250 | -------------------------------------------------------------------------------- /example/windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN32_WINDOW_H_ 2 | #define WIN32_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 12 | // inherited from by classes that wish to specialize with custom 13 | // rendering and input handling 14 | class Win32Window { 15 | public: 16 | struct Point { 17 | unsigned int x; 18 | unsigned int y; 19 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 20 | }; 21 | 22 | struct Size { 23 | unsigned int width; 24 | unsigned int height; 25 | Size(unsigned int width, unsigned int height) 26 | : width(width), height(height) {} 27 | }; 28 | 29 | Win32Window(); 30 | virtual ~Win32Window(); 31 | 32 | // Creates and shows a win32 window with |title| and position and size using 33 | // |origin| and |size|. New windows are created on the default monitor. Window 34 | // sizes are specified to the OS in physical pixels, hence to ensure a 35 | // consistent size to will treat the width height passed in to this function 36 | // as logical pixels and scale to appropriate for the default monitor. Returns 37 | // true if the window was created successfully. 38 | bool CreateAndShow(const std::wstring& title, 39 | const Point& origin, 40 | const Size& size); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | protected: 56 | // Processes and route salient window messages for mouse handling, 57 | // size change and DPI. Delegates handling of these to member overloads that 58 | // inheriting classes can handle. 59 | virtual LRESULT MessageHandler(HWND window, 60 | UINT const message, 61 | WPARAM const wparam, 62 | LPARAM const lparam) noexcept; 63 | 64 | // Called when CreateAndShow is called, allowing subclass window-related 65 | // setup. 66 | virtual void OnCreate(); 67 | 68 | // Called when Destroy is called. 69 | virtual void OnDestroy(); 70 | 71 | private: 72 | friend class WindowClassRegistrar; 73 | 74 | // OS callback called by message pump. Handles the WM_NCCREATE message which 75 | // is passed when the non-client area is being created and enables automatic 76 | // non-client DPI scaling so that the non-client area automatically 77 | // responsponds to changes in DPI. All other messages are handled by 78 | // MessageHandler. 79 | static LRESULT CALLBACK WndProc(HWND const window, 80 | UINT const message, 81 | WPARAM const wparam, 82 | LPARAM const lparam) noexcept; 83 | 84 | // Retrieves a class instance pointer for |window| 85 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 86 | 87 | bool quit_on_close_ = false; 88 | 89 | // window handle for top level window. 90 | HWND window_handle_ = nullptr; 91 | 92 | // window handle for hosted content. 93 | HWND child_content_ = nullptr; 94 | }; 95 | 96 | #endif // WIN32_WINDOW_H_ 97 | -------------------------------------------------------------------------------- /example/windows/runner/window_configuration.cpp: -------------------------------------------------------------------------------- 1 | #include "window_configuration.h" 2 | 3 | const wchar_t* kFlutterWindowTitle = L"responsive_table_example"; 4 | const unsigned int kFlutterWindowOriginX = 10; 5 | const unsigned int kFlutterWindowOriginY = 10; 6 | const unsigned int kFlutterWindowWidth = 800; 7 | const unsigned int kFlutterWindowHeight = 600; 8 | -------------------------------------------------------------------------------- /example/windows/runner/window_configuration.h: -------------------------------------------------------------------------------- 1 | #ifndef WINDOW_CONFIGURATION_ 2 | #define WINDOW_CONFIGURATION_ 3 | 4 | // This is a temporary approach to isolate changes that people are likely to 5 | // make to main.cpp, where the APIs are still in flux. This will reduce the 6 | // need to resolve conflicts or re-create changes slightly differently every 7 | // time the Windows Flutter API surface changes. 8 | // 9 | // Longer term there should be simpler configuration options for common 10 | // customizations like this, without requiring native code changes. 11 | 12 | extern const wchar_t* kFlutterWindowTitle; 13 | extern const unsigned int kFlutterWindowOriginX; 14 | extern const unsigned int kFlutterWindowOriginY; 15 | extern const unsigned int kFlutterWindowWidth; 16 | extern const unsigned int kFlutterWindowHeight; 17 | 18 | #endif // WINDOW_CONFIGURATION_ 19 | -------------------------------------------------------------------------------- /example/windows/scripts/bundle_assets_and_deps.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set FLUTTER_CACHE_DIR=%~1 4 | set BUNDLE_DIR=%~2 5 | set PLUGIN_DIR=%~3 6 | set EXE_NAME=%~4 7 | 8 | set DATA_DIR=%BUNDLE_DIR%data 9 | 10 | if not exist "%DATA_DIR%" call mkdir "%DATA_DIR%" 11 | if %errorlevel% neq 0 exit /b %errorlevel% 12 | 13 | :: Write the executable name to the location expected by the Flutter tool. 14 | echo %EXE_NAME%>"%FLUTTER_CACHE_DIR%exe_filename" 15 | 16 | :: Copy the Flutter assets to the data directory. 17 | set FLUTTER_APP_DIR=%~dp0..\.. 18 | set ASSET_DIR_NAME=flutter_assets 19 | set TARGET_ASSET_DIR=%DATA_DIR%\%ASSET_DIR_NAME% 20 | if exist "%TARGET_ASSET_DIR%" call rmdir /s /q "%TARGET_ASSET_DIR%" 21 | if %errorlevel% neq 0 exit /b %errorlevel% 22 | call xcopy /s /e /i /q "%FLUTTER_APP_DIR%\build\%ASSET_DIR_NAME%" "%TARGET_ASSET_DIR%" 23 | if %errorlevel% neq 0 exit /b %errorlevel% 24 | 25 | :: Copy the icudtl.dat file from the Flutter tree to the data directory. 26 | call xcopy /y /d /q "%FLUTTER_CACHE_DIR%icudtl.dat" "%DATA_DIR%" 27 | if %errorlevel% neq 0 exit /b %errorlevel% 28 | 29 | :: Copy the Flutter DLL to the target location. 30 | call xcopy /y /d /q "%FLUTTER_CACHE_DIR%flutter_windows.dll" "%BUNDLE_DIR%" 31 | if %errorlevel% neq 0 exit /b %errorlevel% 32 | 33 | :: Copy any Plugin DLLs to the target location. 34 | if exist "%PLUGIN_DIR%" ( 35 | call xcopy /y /d /q "%PLUGIN_DIR%"*.dll "%BUNDLE_DIR%" 36 | if %errorlevel% neq 0 exit /b %errorlevel% 37 | ) 38 | -------------------------------------------------------------------------------- /example/windows/scripts/prepare_dependencies.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: Run flutter tool backend. 4 | set BUILD_MODE=%~1 5 | "%FLUTTER_ROOT%\packages\flutter_tools\bin\tool_backend" windows-x64 %BUILD_MODE% 6 | -------------------------------------------------------------------------------- /flutter_responsive_table.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /lib/responsive_table.dart: -------------------------------------------------------------------------------- 1 | export 'src/datatable_header.dart'; 2 | export 'src/responsive_datatable.dart'; 3 | export 'package:adaptivex/adaptivex.dart'; 4 | -------------------------------------------------------------------------------- /lib/src/datatable_header.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class DatatableHeader { 4 | final String text; 5 | final String value; 6 | final bool sortable; 7 | final bool editable; 8 | bool show; 9 | final TextAlign textAlign; 10 | final int flex; 11 | final Widget Function(dynamic value)? headerBuilder; 12 | final Widget Function(dynamic value, Map row)? 13 | sourceBuilder; 14 | 15 | DatatableHeader({ 16 | required this.text, 17 | required this.value, 18 | this.textAlign = TextAlign.center, 19 | this.sortable = false, 20 | this.show = true, 21 | this.editable = false, 22 | this.flex = 1, 23 | this.headerBuilder, 24 | this.sourceBuilder, 25 | }); 26 | 27 | factory DatatableHeader.fromMap(Map map) => DatatableHeader( 28 | text: map['text'], 29 | value: map['value'], 30 | sortable: map['sortable'], 31 | show: map['show'], 32 | textAlign: map['textAlign'], 33 | flex: map['flex'], 34 | headerBuilder: map['headerBuilder'], 35 | sourceBuilder: map['sourceBuilder'], 36 | ); 37 | Map toMap() => { 38 | "text": this.text, 39 | "value": this.value, 40 | "sortable": this.sortable, 41 | "show": this.show, 42 | "textAlign": this.textAlign, 43 | "flex": this.flex, 44 | "headerBuilder": this.headerBuilder, 45 | "sourceBuilder": this.sourceBuilder, 46 | }; 47 | } 48 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | adaptivex: 5 | dependency: "direct main" 6 | description: 7 | name: adaptivex 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.0.1+2" 11 | async: 12 | dependency: transitive 13 | description: 14 | name: async 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.8.2" 18 | boolean_selector: 19 | dependency: transitive 20 | description: 21 | name: boolean_selector 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.1.0" 25 | characters: 26 | dependency: transitive 27 | description: 28 | name: characters 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.2.0" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.3.1" 39 | clock: 40 | dependency: transitive 41 | description: 42 | name: clock 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.0" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.15.0" 53 | fake_async: 54 | dependency: transitive 55 | description: 56 | name: fake_async 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.2.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 | url: "https://pub.dartlang.org" 70 | source: hosted 71 | version: "1.0.4" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | lints: 78 | dependency: transitive 79 | description: 80 | name: lints 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "1.0.1" 84 | matcher: 85 | dependency: transitive 86 | description: 87 | name: matcher 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.12.11" 91 | material_color_utilities: 92 | dependency: transitive 93 | description: 94 | name: material_color_utilities 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.1.3" 98 | meta: 99 | dependency: transitive 100 | description: 101 | name: meta 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.7.0" 105 | path: 106 | dependency: transitive 107 | description: 108 | name: path 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.8.0" 112 | sky_engine: 113 | dependency: transitive 114 | description: flutter 115 | source: sdk 116 | version: "0.0.99" 117 | source_span: 118 | dependency: transitive 119 | description: 120 | name: source_span 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "1.8.1" 124 | stack_trace: 125 | dependency: transitive 126 | description: 127 | name: stack_trace 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.10.0" 131 | stream_channel: 132 | dependency: transitive 133 | description: 134 | name: stream_channel 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "2.1.0" 138 | string_scanner: 139 | dependency: transitive 140 | description: 141 | name: string_scanner 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "1.1.0" 145 | term_glyph: 146 | dependency: transitive 147 | description: 148 | name: term_glyph 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.2.0" 152 | test_api: 153 | dependency: transitive 154 | description: 155 | name: test_api 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "0.4.8" 159 | typed_data: 160 | dependency: transitive 161 | description: 162 | name: typed_data 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.3.0" 166 | vector_math: 167 | dependency: transitive 168 | description: 169 | name: vector_math 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "2.1.1" 173 | sdks: 174 | dart: ">=2.15.1 <3.0.0" 175 | flutter: ">=1.17.0" 176 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: responsive_table 2 | description: Responsive Data table is a highly flexible tool built upon the foundations of progressive enhancement, that adds all of these advanced features to any flutter table. 3 | version: 0.2.0+2 4 | homepage: https://github.com/kechankrisna/flutter_responsive_table 5 | 6 | environment: 7 | sdk: ">=2.15.1 <3.0.0" 8 | flutter: ">=1.17.0" 9 | 10 | dependencies: 11 | adaptivex: ^0.0.1+2 12 | flutter: 13 | sdk: flutter 14 | 15 | dev_dependencies: 16 | flutter_lints: ^1.0.4 17 | flutter_test: 18 | sdk: flutter 19 | 20 | # For information on the generic Dart part of this file, see the 21 | # following page: https://dart.dev/tools/pub/pubspec 22 | 23 | # The following section is specific to Flutter. 24 | flutter: 25 | # This section identifies this Flutter project as a plugin project. 26 | # The 'pluginClass' and Android 'package' identifiers should not ordinarily 27 | # be modified. They are used by the tooling to maintain consistency when 28 | # adding or updating assets for this project. 29 | 30 | # To add assets to your plugin package, add an assets section, like this: 31 | # assets: 32 | # - images/a_dot_burr.jpeg 33 | # - images/a_dot_ham.jpeg 34 | # 35 | # For details regarding assets in packages, see 36 | # https://flutter.dev/assets-and-images/#from-packages 37 | # 38 | # An image asset can refer to one or more resolution-specific "variants", see 39 | # https://flutter.dev/assets-and-images/#resolution-aware. 40 | 41 | # To add custom fonts to your plugin package, add a fonts section here, 42 | # in this "flutter" section. Each entry in this list should have a 43 | # "family" key with the font family name, and a "fonts" key with a 44 | # list giving the asset and other descriptors for the font. For 45 | # example: 46 | # fonts: 47 | # - family: Schyler 48 | # fonts: 49 | # - asset: fonts/Schyler-Regular.ttf 50 | # - asset: fonts/Schyler-Italic.ttf 51 | # style: italic 52 | # - family: Trajan Pro 53 | # fonts: 54 | # - asset: fonts/TrajanPro.ttf 55 | # - asset: fonts/TrajanPro_Bold.ttf 56 | # weight: 700 57 | # 58 | # For details regarding fonts in packages, see 59 | # https://flutter.dev/custom-fonts/#from-packages 60 | # example\lib\main.dart -------------------------------------------------------------------------------- /responsive_table.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /screenshot/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/screenshot/screenshot1.png -------------------------------------------------------------------------------- /screenshot/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/screenshot/screenshot2.png -------------------------------------------------------------------------------- /screenshot/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/screenshot/screenshot3.png -------------------------------------------------------------------------------- /screenshot/screenshot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kechankrisna/flutter_responsive_table/dc5096bc88e7b327d8b9720aa848d4cbd7f6f23f/screenshot/screenshot4.png -------------------------------------------------------------------------------- /test/flutter_responsive_table_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | void main() { 5 | TestWidgetsFlutterBinding.ensureInitialized(); 6 | 7 | setUp(() {}); 8 | 9 | tearDown(() {}); 10 | } 11 | -------------------------------------------------------------------------------- /test/responsive_table_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | // import 'package:responsive_table/responsive_table.dart'; 4 | 5 | void main() { 6 | TestWidgetsFlutterBinding.ensureInitialized(); 7 | 8 | setUp(() {}); 9 | 10 | tearDown(() {}); 11 | } 12 | --------------------------------------------------------------------------------